POST
|
thank you very much i return back the StringToBrushConverter file and i try these string colorString = BorderBrushCmbo1.SelectionBoxItem.ToString();
Color c = new Color();
c.A = 255;
c.R = byte.Parse(colorString.Substring(0, 2), NumberStyles.HexNumber);
c.G = byte.Parse(colorString.Substring(2, 2), NumberStyles.HexNumber);
c.B = byte.Parse(colorString.Substring(4, 2), NumberStyles.HexNumber);
lineSymbole.Color = new SolidColorBrush(c); it work for me thank you very much
... View more
03-19-2015
12:37 AM
|
0
|
0
|
956
|
POST
|
thank you for replying Asghar khan i try it but it give me these error message "Specified cast is not valid."
... View more
03-17-2015
10:10 PM
|
0
|
0
|
956
|
POST
|
hi every body i use these color picker ComboBox: <ComboBox x:Name="BorderBrushCmbo" FlowDirection="RightToLeft" ItemsSource="{Binding Colors}" SelectedItem="{Binding Color, Mode=TwoWay}" Width="140" Height="24">
<ComboBox.ItemTemplate>
<DataTemplate>
<Canvas Background="{Binding ., Converter={StaticResource StringToBrushConverter}}" Width="100" Height="18">
</Canvas>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox> to display colors for users it work very well but i could not read the value of selected color of ComboBox to display it on the symbol fore drawing graphic on the map my question is how to read the value of selected color from color picker ComboBox i try to do these: lineSymbole.Color = new SolidColorBrush((Color)BorderBrushCmbo.SelectedItem); then i try also these: Color c = (Color)Convert.ChangeType(BorderBrushCmbo.SelectedItem.ToString(), typeof(Color),null);
lineSymbole.Color = new SolidColorBrush(c); but I face a problem that i can not convert system color to solid color brush any help please????
... View more
03-17-2015
04:17 AM
|
0
|
7
|
5215
|
POST
|
i need to make package for my map but i dont know how id these have any one idea
... View more
03-16-2015
04:43 AM
|
0
|
2
|
3613
|
POST
|
}
} and these is xml code : <Grid Background="#FFF1F1F1" Opacity="0.9">
<TextBlock x:Name="ServiceSearchTitleLbl"
Foreground="#FF762F2F" FontSize="16" Margin="143,4,114,169" HorizontalAlignment="Center" FontFamily="/AlQassimExplorer;component/Fonts/Fonts.zip#Traditional Arabic" FontWeight="Bold" Width="98">
<Run Text="بحث عن "/>
<Run Text="خدمة"/>
</TextBlock>
<TextBlock x:Name="DestrictNameLbl"
Foreground="#FF762F2F" FontSize="16" Margin="10,36,262,137" HorizontalAlignment="Center" FontFamily="/AlQassimExplorer;component/Fonts/Fonts.zip#Traditional Arabic" FontWeight="Bold" Width="83" Text="اسم الحي"/>
<TextBlock x:Name="ServiceTypeLbl"
Foreground="#FF762F2F" FontSize="16" Margin="10,62,267,111" HorizontalAlignment="Center" FontFamily="/AlQassimExplorer;component/Fonts/Fonts.zip#Traditional Arabic" FontWeight="Bold" Width="78" Text="نوع الحدمة"/>
<ComboBox x:Name="ServiceQueryComboBoxy" Width="200" Height="20" SelectionChanged="ServiceQueryComboBoxy_SelectionChanged" Margin="99,68,56,111">
<ComboBoxItem Content="الخدمات التعليمية"/>
<ComboBoxItem Content="الخدمات المالية"/>
<ComboBoxItem Content="الخدمات الحكومية"/>
<ComboBoxItem Content="الخدمات الصحية"/>
<ComboBoxItem Content="خدمات الفنادق"/>
<ComboBoxItem Content="خدمات المساجد"/>
</ComboBox>
<sdk:DataGrid Visibility="Visible" SelectionChanged="FindDetails_SelectionChanged2" x:Name="FindServiceDetailsDataGrid" ColumnWidth="250" AutoGenerateColumns="False" HeadersVisibility="Column" Background="White"
BorderBrush="Black" BorderThickness="1" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Disabled"
IsReadOnly="True" HorizontalAlignment="Right" SelectionMode="Single" Width="250" Margin="0,97,51,5" Height="90">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn Binding="{Binding Attributes[SRV_NAME]}" Header="نتيجة البحث" />
</sdk:DataGrid.Columns>
</sdk:DataGrid>
<ComboBox x:Name="DestrictQueryForServComboBoxy" Width="200" Height="20" SelectionChanged="ServiceDestrictQueryComboBox_SelectionChanged" Margin="100,40,55,139"/>
<Rectangle Fill="#FFEDE4E4" HorizontalAlignment="Left" Height="31" Stroke="Black" VerticalAlignment="Top" Width="354" Opacity="0.25">
<Rectangle.Effect>
<DropShadowEffect Color="#FFD6B0B0"/>
</Rectangle.Effect>
</Rectangle>
</Grid>
... View more
03-15-2015
05:00 AM
|
1
|
0
|
997
|
POST
|
of course Asghar khan take these: private void ServiceQueryComboBoxy_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ESRI.ArcGIS.Client.Tasks.Query Servquery = new ESRI.ArcGIS.Client.Tasks.Query();
QueryTask ServqueryTask = new QueryTask();
//FindTask FindTask = new FindTask();
if (ServiceQueryComboBoxy.SelectedIndex == -1)
return;
else if (ServiceQueryComboBoxy.SelectedIndex == 0)
{
ServqueryTask = new QueryTask("http://84.235.15.69:8399/arcgis/rest/services/Expr_Operational/MapServer/6");
Servquery.OutFields.AddRange(new string[] { "SRV_NAME", "CITY_NAME", "ST_GENDER", "STATUS", "DISTRICT_NAME", "Shape" });
}
else if (ServiceQueryComboBoxy.SelectedIndex == 1)
{
ServqueryTask = new QueryTask("http://84.235.15.69:8399/arcgis/rest/services/Expr_Operational/MapServer/7");
Servquery.OutFields.AddRange(new string[] { "SRV_NAME", "CITY_NAME", "DISTRICT_NAME", "Shape" });
}
else if (ServiceQueryComboBoxy.SelectedIndex == 2)
{
ServqueryTask = new QueryTask("http://84.235.15.69:8399/arcgis/rest/services/Expr_Operational/MapServer/5");
Servquery.OutFields.AddRange(new string[] { "SRV_NAME", "DISTRICT_NAME", "STATUS", "TYPE", "Shape" });
}
else if (ServiceQueryComboBoxy.SelectedIndex == 3)
{
ServqueryTask = new QueryTask("http://84.235.15.69:8399/arcgis/rest/services/Expr_Operational/MapServer/4");
Servquery.OutFields.AddRange(new string[] { "SRV_NAME", "CITY_NAME", "STATUS", "DISTRICT_NAME", "Shape" });
}
else if (ServiceQueryComboBoxy.SelectedIndex == 4)
{
ServqueryTask = new QueryTask("http://84.235.15.69:8399/arcgis/rest/services/Expr_Operational/MapServer/3");
Servquery.OutFields.AddRange(new string[] { "SRV_NAME", "TYPE", "CITY_NAME", "DISTRICT_NAME", "Shape" });
}
else if (ServiceQueryComboBoxy.SelectedIndex == 5)
{
ServqueryTask = new QueryTask("http://84.235.15.69:8399/arcgis/rest/services/Expr_Operational/MapServer/1");
Servquery.OutFields.AddRange(new string[] { "SRV_NAME", "CITY_NAME", "STATUS", "TYPE", "DISTRICT_NAME", "Shape" });
}
//########################
//Expr_Operational Layer 1 link:
//########################
ServqueryTask.ExecuteCompleted += ServicesQueryTask_ExecuteCompleted;
ServqueryTask.Failed += QueryTask_Failed;
Servquery.ReturnGeometry = true;
if (FindServiceDetailsDataGrid.SelectedItem != null)
Servquery.Text = FindServiceDetailsDataGrid.SelectedItem.ToString();
Servquery.Where = "[DISTRICT_NAME] ='" + DestrictQueryForServComboBoxy.SelectedItem.ToString() + "'";
Servquery.OutSpatialReference = MyMap.SpatialReference;
Binding resultFeaturesBinding = new Binding("LastResult");
resultFeaturesBinding.Source = ServqueryTask;
FindServiceDetailsDataGrid.SetBinding(DataGrid.ItemsSourceProperty, resultFeaturesBinding);
ServqueryTask.ExecuteAsync(Servquery);
}
private void ServicesQueryTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.QueryEventArgs args)
{
FeatureSet featureSet = args.FeatureSet;
#region Display Graphic and Data
// If an item has been selected
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
graphicsLayer.Graphics.Clear();
if (featureSet.Features.Count > 0)
{
// Show selected feature attributes in DataGrid
Graphic selectedFeature = featureSet.Features[0];
QueryDetailsDataGrid.ItemsSource = selectedFeature.Attributes;
// Highlight selected feature
string s = selectedFeature.Geometry.ToString();
string left = s.Substring(0, 5);
switch (left)
{
case "Polyg":
selectedFeature.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
case "Polyl":
selectedFeature.Symbol = LayoutRoot.Resources["DefaultLineSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
case "Point":
selectedFeature.Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
// Zoom to selected feature (define expand percentage)
ESRI.ArcGIS.Client.Geometry.Envelope selectedFeatureExtentPoint = selectedFeature.Geometry.Extent;
ESRI.ArcGIS.Client.Geometry.Envelope displayExtentPoint = new ESRI.ArcGIS.Client.Geometry.Envelope(
selectedFeatureExtentPoint.XMin - (500 / .5),
selectedFeatureExtentPoint.YMin - (500 / .5),
selectedFeatureExtentPoint.XMax + (500 / .5),
selectedFeatureExtentPoint.YMax + (500 / .5));
MyMap.ZoomTo(displayExtentPoint);
break;
}
graphicsLayer.Graphics.Add(selectedFeature);
// Zoom to selected feature (define expand percentage)
ESRI.ArcGIS.Client.Geometry.Envelope selectedFeatureExtent = selectedFeature.Geometry.Extent;
double expandPercentage = 30;
double widthExpand = selectedFeatureExtent.Width * (expandPercentage / 100);
double heightExpand = selectedFeatureExtent.Height * (expandPercentage / 100);
ESRI.ArcGIS.Client.Geometry.Envelope displayExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(
selectedFeatureExtent.XMin - (widthExpand / .2),
selectedFeatureExtent.YMin - (heightExpand / .2),
selectedFeatureExtent.XMax + (widthExpand / .2),
selectedFeatureExtent.YMax + (heightExpand / .2));
MyMap.ZoomTo(displayExtent);
// If DataGrid not visible (initial load), show it
if (DataGridScrollViewer.Visibility == Visibility.Collapsed)
{
DataGridScrollViewer.Visibility = Visibility.Visible;
QueryGrid.Height = Double.NaN;
QueryGrid.UpdateLayout();
}
}
else
{
QueryDetailsDataGrid.ItemsSource = null;
DataGridScrollViewer.Visibility = Visibility.Collapsed;
QueryGrid.Height = Double.NaN;
QueryGrid.UpdateLayout();
}
#endregion
}
private void FindDetails_SelectionChanged2(object sender, SelectionChangedEventArgs e)
{
// Highlight the graphic feature associated with the selected row
DataGrid dataGrid = sender as DataGrid;
int selectedIndex = dataGrid.SelectedIndex;
if (selectedIndex > -1)
{
Graphic graphic = (Graphic)FindServiceDetailsDataGrid.SelectedItem;
QueryDetailsDataGrid.ItemsSource = graphic.Attributes;
// If DataGrid not visible (initial load), show it
if (DataGridScrollViewer.Visibility == Visibility.Collapsed)
{
DataGridScrollViewer.Visibility = Visibility.Visible;
QueryGrid.Height = Double.NaN;
QueryGrid.UpdateLayout();
}
string attribut = graphic.Attributes["SHAPE"].ToString();
string SubAtribut = attribut.Substring(18, 5);
switch (SubAtribut)
{
case "Polyg":
graphic.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
case "Polyl":
graphic.Symbol = LayoutRoot.Resources["DefaultLineSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
break;
case "Point":
graphic.Symbol = LayoutRoot.Resources["DefaultMarkerSymbol"] as ESRI.ArcGIS.Client.Symbols.Symbol;
// Zoom to selected feature (define expand percentage)
ESRI.ArcGIS.Client.Geometry.Envelope selectedFeatureExtentPoint = graphic.Geometry.Extent;
ESRI.ArcGIS.Client.Geometry.Envelope displayExtentPoint = new ESRI.ArcGIS.Client.Geometry.Envelope(
selectedFeatureExtentPoint.XMin - (500 / .5),
selectedFeatureExtentPoint.YMin - (500 / .5),
selectedFeatureExtentPoint.XMax + (500 / .5),
selectedFeatureExtentPoint.YMax + (500 / .5));
MyMap.ZoomTo(displayExtentPoint);
SearchTabPanel.Visibility = Visibility.Collapsed;
break;
}
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
graphicsLayer.Graphics.Clear();
graphicsLayer.Graphics.Add(graphic);
//Zoom to selected feature (define expand percentage)
ESRI.ArcGIS.Client.Geometry.Envelope selectedFeatureExtent = graphic.Geometry.Extent;
double expandPercentage = 30;
double widthExpand = selectedFeatureExtent.Width * (expandPercentage / 100);
double heightExpand = selectedFeatureExtent.Height * (expandPercentage / 100);
ESRI.ArcGIS.Client.Geometry.Envelope displayExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(
selectedFeatureExtent.XMin - (widthExpand / .2),
selectedFeatureExtent.YMin - (heightExpand / .2),
selectedFeatureExtent.XMax + (widthExpand / .2),
selectedFeatureExtent.YMax + (heightExpand / .2));
MyMap.ZoomTo(displayExtent);
... View more
03-15-2015
04:52 AM
|
0
|
0
|
997
|
POST
|
thank you i let user to add shape file but now i want him to add Autocad layer i think there is a way to do it
... View more
03-14-2015
11:49 PM
|
0
|
1
|
896
|
Title | Kudos | Posted |
---|---|---|
1 | 09-25-2014 01:23 AM | |
1 | 03-15-2015 05:00 AM | |
1 | 03-15-2015 05:05 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|