ScaleBar.Theme.xaml
上传用户:huazai0421
上传日期:2008-05-30
资源大小:405k
文件大小:2k
源码类别:

SilverLight

开发平台:

C#

  1. <ResourceDictionary
  2.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  3.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:local="clr-namespace:ESRI.ArcGIS.Samples"
  5. >
  6. <Style TargetType="local:ScaleBar">
  7. <Setter Property="Template">
  8. <Setter.Value>
  9. <ControlTemplate TargetType="local:ScaleBar">
  10. <Grid>
  11. <StackPanel Margin="0" HorizontalAlignment="Right" >
  12. <StackPanel Orientation="Horizontal" Margin="0">
  13. <Rectangle x:Name="PaddingLeftForScaleBarTextMeters" Fill="Transparent" />
  14. <TextBlock x:Name="ScaleBarTextForMeters" HorizontalAlignment="Right" FontSize="8" Foreground="{TemplateBinding Fill}" />
  15. </StackPanel>
  16. <StackPanel Orientation="Horizontal" Margin="0">
  17. <Rectangle x:Name="LeftTopNotch" Width="2" Fill="{TemplateBinding Fill}" Height="5" Stroke="{TemplateBinding Fill}" />
  18. <Rectangle x:Name="PaddingLeftTopNotch" Fill="Transparent"/>
  19. <Rectangle x:Name="RightTopNotch" Width="2" Fill="{TemplateBinding Fill}" Height="5" Stroke="{TemplateBinding Fill}" />
  20. </StackPanel>
  21. <Rectangle x:Name="ScaleBarBlock" Fill="{TemplateBinding Fill}" Height="2" Width="2" Stroke="{TemplateBinding Fill}" Margin="0" HorizontalAlignment="Left" />
  22. <StackPanel Orientation="Horizontal">
  23. <Rectangle x:Name="LeftBottomNotch" Width="2" Fill="{TemplateBinding Fill}" Height="5" Stroke="{TemplateBinding Fill}" />
  24. <Rectangle x:Name="PaddingLeftBottomNotch"  Fill="Transparent" />
  25. <Rectangle x:Name="RightBottomNotch" Width="2" Fill="{TemplateBinding Fill}" Height="5"  Stroke="{TemplateBinding Fill}" />
  26. </StackPanel>
  27. <StackPanel Orientation="Horizontal">
  28. <Rectangle x:Name="PaddingLeftForScaleBarTextMiles" Fill="Transparent" />
  29. <TextBlock x:Name="ScaleBarTextForMiles" HorizontalAlignment="Right" FontSize="8" Foreground="{TemplateBinding Fill}" />
  30. </StackPanel>
  31. </StackPanel>
  32. </Grid>
  33. </ControlTemplate>
  34. </Setter.Value>
  35. </Setter>
  36. </Style>
  37. </ResourceDictionary>