<ControlTemplate x:Key="FeatureFill"> <Path x:Name="Element" Fill="{Binding Symbol.Fill}" Stroke="{Binding Symbol.BorderBrush}" StrokeThickness="{Binding Symbol.BorderThickness}" Opacity="0.10"> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CommonStates"> <VisualState x:Name="Normal" > <Storyboard> <DoubleAnimation Storyboard.TargetName="Element" Storyboard.TargetProperty="(Symbol.Opacity)" To="{Binding Symbol.Opacity}" Duration="00:00:00" /> <DoubleAnimation Storyboard.TargetName="Element" Storyboard.TargetProperty="(Path.StrokeThickness)" To="{Binding Symbol.BorderThickness}" Duration="00:00:00.5" /> </Storyboard> </VisualState> <VisualState x:Name="MouseOver"> <Storyboard> <DoubleAnimation Storyboard.TargetName="Element" Storyboard.TargetProperty="(Symbol.Opacity)" To="1" Duration="00:00:00" /> <DoubleAnimation Storyboard.TargetName="Element" Storyboard.TargetProperty="(Path.StrokeThickness)" To="3" Duration="00:00:00.2" /> </Storyboard> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups> </Path> </ControlTemplate>
resDict = new ResourceDictionary() { Source = new Uri("/IViewer;component/Styles/FeatureLayerStyle.xaml", UriKind.Relative) }; ControlTemplate ct = resDict["FeatureFill"] as ControlTemplate; foreach (Graphic g in fLayer.Graphics) { g.Symbol.ControlTemplate = ct; }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.