<!--Style for PushPin--> <Style x:Key="myPushpinStyle" TargetType="m:Pushpin"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <m:Pushpin Name="myPin" Background="{TemplateBinding Property=Background}"> <ToolTipService.ToolTip> <ToolTip Focusable="True" Opacity="50"> <ToolTip.Template> <ControlTemplate> <Border CornerRadius="5" Width="180" Height="auto" MinHeight="60" Opacity="50" ToolTipService.ShowDuration="12000"> <Border.Background> <LinearGradientBrush> <GradientStop Color="#DAFDA7" Offset="0"/> <GradientStop Color="Green" Offset="1"/> </LinearGradientBrush> </Border.Background> <Grid> <Grid.RowDefinitions> <RowDefinition Height="20"></RowDefinition> <RowDefinition Height="20"></RowDefinition> <RowDefinition Height="20"></RowDefinition> <RowDefinition Height="30*"></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition></ColumnDefinition> <ColumnDefinition></ColumnDefinition> </Grid.ColumnDefinitions> <TextBlock Grid.Row="0" FontSize="12" FontWeight="Bold">Information</TextBlock> <TextBlock Grid.Row="1" VerticalAlignment="Top">Latitude</TextBlock> <TextBlock Grid.Row="2" VerticalAlignment="Top">Longitude</TextBlock> <TextBlock Grid.Row="1" Grid.Column="1" VerticalAlignment="Top"> <TextBlock.Text> <Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type m:Pushpin}}" Path="Location.Latitude"> </Binding> </TextBlock.Text> </TextBlock> <TextBlock Grid.Row="2" Grid.Column="1" VerticalAlignment="Top"> <TextBlock.Text> <Binding Path="Location.Longitude"> <Binding.RelativeSource> <RelativeSource Mode="Self"/> </Binding.RelativeSource> </Binding> </TextBlock.Text> </TextBlock> </Grid> </Border> </ControlTemplate> </ToolTip.Template> </ToolTip> </ToolTipService.ToolTip> </m:Pushpin> </ControlTemplate> </Setter.Value> </Setter> </Style>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)