|
POST
|
Unfortunately in Silverlight you cannot set event handlers in Style (AFAIK).
... View more
06-30-2012
02:28 AM
|
0
|
0
|
352
|
|
POST
|
The FeatureDataGrid Xaml is in the FeatureDataGrid.Theme.xaml file of the toolkit
... View more
06-29-2012
08:01 PM
|
0
|
0
|
880
|
|
POST
|
For this definition
Relationships:
Campus.DBO.SpeciesDomain (0) -- Related To: Campus.DBO.SpeciesDomain (1)
The RelationshipId = 0. The (1) after the second layer is the LayerId of the layer it is related to
... View more
06-29-2012
07:54 PM
|
0
|
0
|
571
|
|
POST
|
Looking at this some more I realize that the Action would not have a DataContext because it is not a FrameworkElement. So you would need to set the DataContext on something like the Button and use that to set the property on the Action So something like this in the XAML
<Button x:Name="QueryButton" Height="30" Width="30" Margin="0,0,2,0"
HorizontalContentAlignment="Left" Padding="2" Content="Query">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<Actions:SpatialQueryAction
DrawMode="Rectangle"
OutFields="FID,STATE_NAME,STATE_ABBR"
LayerID="MyQueryResultsGraphicsLayer"
Url="{Binding ElementName=QueryButton, Path=DataContext.Url}"
Symbol="{StaticResource GraphicsLayerFillSymbol}" QueryComplete="SpatialQueryAction_QueryComplete"
TargetName="Map" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
And in the code
public MainPage()
{
InitializeComponent();
ActiveLayer = new ActiveLayer { Url = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/2" };
QueryButton.DataContext = ActiveLayer;
}
public ActiveLayer ActiveLayer { get; set; }
private void SpatialQueryAction_QueryComplete(object sender, EventArgs e)
{
}
And because I seemingly have too much time on my hands, and I thought the idea useful I wrote a SpatialQueryAction that throws a QueryComplete event at the end, which I attached
... View more
06-29-2012
09:09 AM
|
0
|
0
|
793
|
|
POST
|
I would post in the javascript forum http://forums.arcgis.com/forums/15-ArcGIS-API-for-JavaScript Good Luck
... View more
06-29-2012
07:16 AM
|
0
|
0
|
489
|
|
POST
|
I certainly don't think those changes could be done with styling, although I also cannot figure out Blend and not for lack of trying. I think the latter change would be pretty straight forward just change the visibility in the CommitButton_Click
private void CommitButton_Click(object sender, RoutedEventArgs e)
{
if (!this.IsReadOnly)
{
ApplyChanges();
this.Visibility = Visibility.Collapsed;
}
}
For your former need, there is a HasChange() method which seems to check if any change is made to know if the Commit button should enable, you could add an additional check in there to see if that particular field was changed. I have made custom versions of different tools myself, I think styling can only do so much. Of course, maybe that is just because I can not make heads nor tails out of Blend 🙂 Good Luck
... View more
06-28-2012
11:31 PM
|
0
|
0
|
242
|
|
POST
|
The info window seems to build everything up in code, not done through template styling. I ended up creating a MapTip to do a similar task for this reason. You can download the InfoWindow code off Codeplex http://esrisilverlight.codeplex.com/ and see where they are building up the border (BuildBorderPath method), you may be able to change for your needs and use a customized version Good Luck
... View more
06-28-2012
10:41 PM
|
0
|
0
|
275
|
|
POST
|
I admire your patience.... Thanks, Miri Toda Raba 🙂 In Silverlight the ah ha moment is when the data binding thing actually makes sense. The DataContext is pretty much a weakly typed object that any control can have attached to it. DataContext is inherited, so if I set the Context at the UserControl level everything shares that DataContext unless the control overrides it. This Xaml
<actions:SetLayerUrlAction Url="{Binding _ActiveLayer.URL}"/>
Is saying look at my DataContext (some object) for a (public) Property called _ActiveLayer and then attach to the Url property. But you have not defined this DataContext so it does not know what to look at. In the Button code it is saying the Map is DataContext and will look for a property on Map (which does not exist) So the DataContext of the page needs to be set so the Binding knows what it should look for (I am not sure if setting on the button works or if it needs to be the page)
public MainPage()
{
InitializeComponent();
DataContext = this;
}
in the class define your ActiveLayer object (public)
public ActiveLayer ActiveLayer { get; set; }
Now the MainPage UserControl is bound to the class MainPage class and so
<actions:SetLayerUrlAction Url="{Binding ActiveLayer.URL}"/>
Knows to look at the ActiveLayer property. Likewise you could set the DataContext to the ActiveLayer object itself, and then your binding is just to the properties on the ActiveLayer. This would be a more common approach because you would normally bind to the object that is raising the PropertyChanged events
public MainPage()
{
InitializeComponent();
ActiveLayer = new ActiveLayer();
DataContext = ActiveLayer ;
}
public ActiveLayer ActiveLayer { get; set; }
<actions:SetLayerUrlAction Url="{Binding URL}"/>
In a statement like {Binding ElementName=MyMap, Path=Layers[MyLayer]} it is setting the DataContext local to that Binding to the specific element. Good Luck
... View more
06-28-2012
06:40 AM
|
0
|
0
|
793
|
|
POST
|
txtBuffer.Text is a string you need to pass a double to the method, that is why the error says you are passing a string where a double is required.
double distancebuffer = double.Parse(txtbuffer.Text);
bufferParams.Distances.Add(distancebuffer);
(perhaps at some point you could thank someone on this forum who offers you help)
... View more
06-28-2012
02:16 AM
|
0
|
0
|
457
|
|
POST
|
I guess the follow-up question is where/how are you setting the DataContext of your Control?
... View more
06-27-2012
09:28 PM
|
0
|
0
|
1077
|
|
POST
|
The toolkit is an open source project available on codeplex, took this out of the style for the AttchmentEditor and commented out the button. Placed it in the resources section of my control that has the AttachmentEditor
<ControlTemplate x:Name="NoButtonTemplate" TargetType="esri:AttachmentEditor">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="BusyStates">
<VisualState x:Name="Loaded">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ProgressIndicator">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Collapsed</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Busy">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ProgressIndicator">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimation Duration="0:0:0.75" RepeatBehavior="Forever" To="360" Storyboard.TargetName="ProgressIndicator"
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid Background="{TemplateBinding Background}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid x:Name="ProgressIndicator" Background="Transparent" Grid.Row="0" Grid.Column="0" Margin="3,0"
Visibility="Collapsed" HorizontalAlignment="Left" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<RotateTransform />
</Grid.RenderTransform>
<Ellipse Fill="#1E525252" Margin="11,2,11,20" Width="2" Height="2"/>
<Ellipse Fill="#3F525252" Height="3" Width="3" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,4,5,0" />
<Ellipse Fill="#7F525252" Width="4" HorizontalAlignment="Right" Height="4" VerticalAlignment="Top" Margin="0,9,1,0" />
<Ellipse Fill="#BF525252" Height="5" Width="5" VerticalAlignment="Bottom" Margin="0,0,3,3" HorizontalAlignment="Right" />
<Ellipse Fill="#FF525252" Height="6" Width="6" VerticalAlignment="Bottom" Margin="9,0" />
</Grid>
<!--<Button x:Name="AddNewButton" Content="Add" HorizontalAlignment="Right"
Margin="3" Padding="3" MinWidth="50" Grid.Row="0" Grid.Column="1" IsEnabled="False" />-->
<ScrollViewer Grid.Row="1" Margin="3,0,3,3" Grid.ColumnSpan="2">
<ItemsControl x:Name="AttachmentList" ItemTemplate="{TemplateBinding ItemTemplate}"/>
</ScrollViewer>
</Grid>
</Border>
</ControlTemplate>
Added this code into the constructor of my control that has the AttachmentEditor on it.
InitializeComponent();
ControlTemplate ct = this.Resources["NoButtonTemplate"] as ControlTemplate;
if ( ct == null ) return;
AttachEditor.Template = ct;
No more button! 🙂 Good luck
... View more
06-27-2012
09:22 PM
|
0
|
0
|
424
|
|
POST
|
It's pretty hard to say without understanding how the DataContext is being set. but are you implementing the INotifyPropertyChanged in your _activeLayer object? This is required to notify the object bound in Xaml that something changed in the bound object. As for the symbol, if you have a Url being bound you could also bind a Symbol.
Symbol="{Binding _activeLayer.Symbol}"
When you set the Url you know the type of layer it is (point, line, polygon) and can set the appropriate symbol type at that time.
... View more
06-26-2012
10:40 PM
|
0
|
0
|
1077
|
|
POST
|
I would just remove the graphic itself (Graphics.Remove) from the Graphics collection, hold onto it and then add it back when needed
... View more
06-26-2012
09:48 PM
|
0
|
0
|
640
|
|
POST
|
Miri, I think you forgot to attach the error message :eek: As for question 2, from what I can see (thanks to .net reflecter) all the Action does is populate the Graphics layer in the ExecuteComplete handler of the QueryTask. It does not seem to throw off any other notification. I think you are probably just as well off doing your own Query, you could even write it as a TriggerAction that fires an event on completion. As strange as this sounds, in many ways I think they most complicated aspect to writing a large application with an ESRI Web Client API (flex also) is handling interactions of tools and buttons with features and the map. I have spent considerable amounts of time developing infrastructure that manages this interaction with notifications between tools so everything knows how the next mouse click should be handled. In this case one quick and dirty way (as opposed to simple and elegant ;)) might be to add a CollectionChanged handler to your GraphicsLayer:Graphics collection. So when the points are added to the GraphicsLayer as a result of the query you will catch it and can flip the tool back on. Of course if the query returns nada well then.....? Good luck -Joe
... View more
06-26-2012
06:42 AM
|
0
|
0
|
1077
|
|
POST
|
Have you tried layer.UpdateCompleted += (snd, evt) => { Map.Extent = layer.FullExtent; }; Good Luck
... View more
06-26-2012
12:48 AM
|
0
|
0
|
1004
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-23-2025 12:16 PM | |
| 1 | 10-19-2022 01:08 PM | |
| 1 | 09-03-2025 09:25 AM | |
| 1 | 04-16-2025 12:37 PM | |
| 1 | 03-18-2025 12:17 PM |
| Online Status |
Offline
|
| Date Last Visited |
12-04-2025
04:12 PM
|