- <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
- xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
- xmlns:visualizationToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
- xmlns:chartingPrimitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
- xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
- xmlns:sys="clr-namespace:System;assembly=mscorlib"
- xmlns:globe="clr-namespace:SilverGlobe;assembly=SilverGlobe"
- xmlns:toolkit="clr-namespace:ESRI.ArcGIS.Client.Toolkit;assembly=ESRI.ArcGIS.Client.Toolkit"
- xmlns:esriSymbols="clr-namespace:ESRI.ArcGIS.Client.Symbols;assembly=ESRI.ArcGIS.Client"
- xmlns:pie="clr-namespace:ESRI.ArcGIS.Samples.PieChartSymbology;assembly=ESRI.ArcGIS.Samples.PieChartSymbology"
- x:Class="ESRI.ArcGIS.Samples.SilverMapDemo.App" >
- <Application.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="Styles.Black.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <sys:String x:Name="Title">Silverlight Showcase</sys:String>
- <sys:String x:Name="menu1">Base Map</sys:String>
- <sys:String x:Name="menu2">Web Feeds</sys:String>
- <sys:String x:Name="menu3">Weather</sys:String>
- <sys:String x:Name="menu4">Demographics</sys:String>
- <sys:String x:Name="menu5">Media</sys:String>
- <Style x:Name="titleTextStyle" TargetType="TextBlock">
- <Setter Property="Foreground" Value="White" />
- <Setter Property="VerticalAlignment" Value="Bottom" />
- <Setter Property="HorizontalAlignment" Value="Right" />
- <Setter Property="Margin" Value="0" />
- <Setter Property="Opacity" Value=".1" />
- <Setter Property="FontSize" Value="60" />
- <Setter Property="FontWeight" Value="Bold" />
- </Style>
- <Style x:Name="titleTextStyle2" TargetType="TextBlock">
- <Setter Property="Foreground" Value="#eeeeee" />
- <Setter Property="VerticalAlignment" Value="Bottom" />
- <Setter Property="HorizontalAlignment" Value="Right" />
- <Setter Property="Margin" Value="0,0,0,10" />
- <Setter Property="FontSize" Value="40" />
- <Setter Property="FontWeight" Value="Bold" />
- </Style>
- <!-- Pie Marker Symbol -->
- <esriSymbols:MarkerSymbol x:Name="pieMarkerSymbol">
- <esriSymbols:MarkerSymbol.ControlTemplate>
- <ControlTemplate>
- <Canvas RenderTransformOrigin=".5,.5" Name="RootElement">
- <Canvas.RenderTransform>
- <ScaleTransform ScaleX="1" ScaleY="1" />
- </Canvas.RenderTransform>
- <!--- Doubling the size of pie chart symbology when mouse pointer is hovered on the symbol -->
- <vsm:VisualStateManager.VisualStateGroups>
- <vsm:VisualStateGroup x:Name="CommonStates">
- <vsm:VisualState x:Name="Normal">
- <Storyboard>
- <DoubleAnimation BeginTime="00:00:00"
- Storyboard.TargetName="RootElement"
- Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
- To="1" Duration="0:0:0.1" />
- <DoubleAnimation BeginTime="00:00:00"
- Storyboard.TargetName="RootElement"
- Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
- To="1" Duration="0:0:0.1" />
- </Storyboard>
- </vsm:VisualState>
- <vsm:VisualState x:Name="MouseOver">
- <Storyboard>
- <DoubleAnimation BeginTime="00:00:00"
- Storyboard.TargetName="RootElement"
- Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
- To="2" Duration="0:0:0.1" />
- <DoubleAnimation BeginTime="00:00:00"
- Storyboard.TargetName="RootElement"
- Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
- To="2" Duration="0:0:0.1" />
- </Storyboard>
- </vsm:VisualState>
- </vsm:VisualStateGroup>
- </vsm:VisualStateManager.VisualStateGroups>
- <pie:PieChartMapTip Width="20" Height="20"
- Canvas.Left="-10" Canvas.Top="-10"
- DataContext="{Binding Path=Attributes}">
- <pie:PieChartMapTip.Template>
- <ControlTemplate>
- <Grid>
- <Grid.Resources>
- <Style TargetType="Panel" x:Name="chartStyle">
- <Setter Property="MinWidth" Value="0"/>
- <Setter Property="MinHeight" Value="0"/>
- </Style>
- </Grid.Resources>
- <chartingToolkit:Chart Name="pieChart" UseLayoutRounding="True">
- <chartingToolkit:Chart.Resources>
- <ControlTemplate x:Key="PieDataPointControlTemplate" TargetType="chartingToolkit:PieDataPoint">
- <Grid>
- <Path x:Name="Slice" Data="{TemplateBinding Geometry}" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}">
- <ToolTipService.ToolTip>
- <StackPanel>
- <ContentControl FontWeight="Bold" Content="{TemplateBinding IndependentValue}"/>
- <ContentControl Foreground="DarkBlue" Content="{TemplateBinding FormattedDependentValue}"/>
- <ContentControl Foreground="DarkBlue" Content="{TemplateBinding FormattedRatio}"/>
- </StackPanel>
- </ToolTipService.ToolTip>
- </Path>
- </Grid>
- </ControlTemplate>
- </chartingToolkit:Chart.Resources>
- <chartingToolkit:Chart.Series>
- <chartingToolkit:PieSeries Name="mainPieSeries" Margin="0"
- IndependentValueBinding="{Binding Path=Key}"
- DependentValueBinding="{Binding Path=Value}">
- <chartingToolkit:PieSeries.StylePalette>
- <visualizationToolkit:StylePalette>
- <Style TargetType="chartingToolkit:PieDataPoint">
- <Setter Property="Background" Value="DarkRed" />
- <Setter Property="BorderBrush" Value="{x:Null}" />
- <Setter Property="Template" Value="{StaticResource PieDataPointControlTemplate}"/>
- </Style>
- <Style TargetType="chartingToolkit:PieDataPoint">
- <Setter Property="Background" Value="Yellow" />
- <Setter Property="BorderBrush" Value="{x:Null}" />
- <Setter Property="Template" Value="{StaticResource PieDataPointControlTemplate}"/>
- </Style>
- <Style TargetType="chartingToolkit:PieDataPoint">
- <Setter Property="Background" Value="DarkBlue"/>
- <Setter Property="BorderBrush" Value="{x:Null}" />
- <Setter Property="Template" Value="{StaticResource PieDataPointControlTemplate}"/>
- </Style>
- <Style TargetType="Control">
- <Setter Property="Background" Value="DarkOrange" />
- <Setter Property="BorderBrush" Value="{x:Null}" />
- <Setter Property="Template" Value="{StaticResource PieDataPointControlTemplate}"/>
- </Style>
- <Style TargetType="Control">
- <Setter Property="Background" Value="SteelBlue" />
- <Setter Property="BorderBrush" Value="{x:Null}" />
- <Setter Property="Template" Value="{StaticResource PieDataPointControlTemplate}"/>
- </Style>
- <Style TargetType="Control">
- <Setter Property="Background" Value="DarkGreen"/>
- <Setter Property="BorderBrush" Value="{x:Null}" />
- <Setter Property="Template" Value="{StaticResource PieDataPointControlTemplate}"/>
- </Style>
- <Style TargetType="Control">
- <Setter Property="Background" Value="DarkCyan"/>
- <Setter Property="BorderBrush" Value="{x:Null}" />
- <Setter Property="Template" Value="{StaticResource PieDataPointControlTemplate}"/>
- </Style>
- <Style TargetType="Control">
- <Setter Property="Background" Value="DarkOliveGreen"/>
- <Setter Property="BorderBrush" Value="{x:Null}" />
- <Setter Property="Template" Value="{StaticResource PieDataPointControlTemplate}"/>
- </Style>
- </visualizationToolkit:StylePalette>
- </chartingToolkit:PieSeries.StylePalette>
- </chartingToolkit:PieSeries>
- </chartingToolkit:Chart.Series>
- <chartingToolkit:Chart.Template>
- <ControlTemplate TargetType="chartingToolkit:Chart">
- <chartingPrimitives:EdgePanel x:Name="ChartArea" />
- </ControlTemplate>
- </chartingToolkit:Chart.Template>
- </chartingToolkit:Chart>
- </Grid>
- </ControlTemplate>
- </pie:PieChartMapTip.Template>
- </pie:PieChartMapTip>
- </Canvas>
- </ControlTemplate>
- </esriSymbols:MarkerSymbol.ControlTemplate>
- </esriSymbols:MarkerSymbol>
- </ResourceDictionary>
- </Application.Resources>
- </Application>