NavigationBar.xaml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:cnvt="clr-namespace:Waaagh.Converters"
  6. xmlns:cc="clr-namespace:Waaagh.CustomControl"
  7. xmlns:james="https://jamesnet.dev/xaml/presentation"
  8. xmlns:helper="clr-namespace:Waaagh.Helpers">
  9. <Storyboard x:Key="Selected">
  10. <james:ThickItem Mode="CubicEaseInOut" TargetName="icon" Duration="0:0:0.5" Property="Margin" To="0 -80 0 0"/>
  11. <james:ThickItem Mode="CubicEaseInOut" TargetName="name" Duration="0:0:0.5" Property="Margin" To="0 45 0 0"/>
  12. <james:ColorItem Mode="CubicEaseInOut" TargetName="icon" Duration="0:0:0.5" Property="Fill.Color" To="#333333"/>
  13. <james:ColorItem Mode="CubicEaseInOut" TargetName="name" Duration="0:0:0.5" Property="Foreground.Color" To="#333333"/>
  14. </Storyboard>
  15. <Storyboard x:Key="UnSelected">
  16. <james:ThickItem Mode="CubicEaseInOut" TargetName="icon" Duration="0:0:0.5" Property="Margin" To="0 0 0 0"/>
  17. <james:ThickItem Mode="CubicEaseInOut" TargetName="name" Duration="0:0:0.5" Property="Margin" To="0 60 0 0"/>
  18. <james:ColorItem Mode="CubicEaseInOut" TargetName="icon" Duration="0:0:0.5" Property="Fill.Color" To="#44333333"/>
  19. <james:ColorItem Mode="CubicEaseInOut" TargetName="name" Duration="0:0:0.5" Property="Foreground.Color" To="#00000000"/>
  20. </Storyboard>
  21. <Style TargetType="{x:Type james:JamesIcon}" x:Key="Icon">
  22. <Setter Property="Icon" Value="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=Tag}"/>
  23. <Setter Property="Width" Value="40"/>
  24. <Setter Property="Height" Value="40"/>
  25. <Setter Property="Fill" Value="#44333333"/>
  26. </Style>
  27. <Style TargetType="{x:Type TextBlock}" x:Key="Name">
  28. <Setter Property="Text" Value="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=Content}"/>
  29. <Setter Property="HorizontalAlignment" Value="Center"/>
  30. <Setter Property="FontWeight" Value="Bold"/>
  31. <Setter Property="FontSize" Value="14"/>
  32. <Setter Property="Foreground" Value="#00000000"/>
  33. <Setter Property="Margin" Value="0 60 0 0"/>
  34. </Style>
  35. <Style TargetType="{x:Type ListBoxItem}" x:Key="MagicBarItem">
  36. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  37. <Setter Property="Background" Value="Transparent"/>
  38. <Setter Property="Template">
  39. <Setter.Value>
  40. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  41. <Grid Background="{TemplateBinding Background}">
  42. <james:JamesIcon x:Name="icon" Style="{StaticResource Icon}"/>
  43. <TextBlock x:Name="name" Style="{StaticResource Name}"/>
  44. </Grid>
  45. <ControlTemplate.Triggers>
  46. <Trigger Property="IsSelected" Value="True">
  47. <Trigger.EnterActions>
  48. <BeginStoryboard Storyboard="{StaticResource Selected}"/>
  49. </Trigger.EnterActions>
  50. <Trigger.ExitActions>
  51. <BeginStoryboard Storyboard="{StaticResource UnSelected}"/>
  52. </Trigger.ExitActions>
  53. </Trigger>
  54. </ControlTemplate.Triggers>
  55. </ControlTemplate>
  56. </Setter.Value>
  57. </Setter>
  58. </Style>
  59. <Geometry x:Key="ArcData">
  60. M0,0 L100,0 C95.167503,0 91.135628,3.4278221 90.203163,7.9846497 L90.152122,8.2704506 89.963921,9.1416779 C85.813438,27.384438 69.496498,41 50,41 30.5035,41 14.186564,27.384438 10.036079,9.1416779 L9.8478823,8.2704926 9.7968359,7.9846497 C8.8643732,3.4278221 4.8324914,0 0,0 z
  61. </Geometry>
  62. <Style TargetType="{x:Type Path}" x:Key="Arc">
  63. <Setter Property="Data" Value="{StaticResource ArcData}"/>
  64. <Setter Property="Width" Value="100"/>
  65. <Setter Property="Height" Value="100"/>
  66. <Setter Property="Fill" Value="#222222"/>
  67. <Setter Property="Margin" Value="-10 40 -10 -1"/>
  68. </Style>
  69. <Style TargetType="{x:Type Border}" x:Key="Bar">
  70. <Setter Property="Background" Value="#DDDDDD"/>
  71. <Setter Property="Margin" Value="0 40 0 0"/>
  72. <Setter Property="CornerRadius" Value="10"/>
  73. </Style>
  74. <Style TargetType="{x:Type Grid}" x:Key="Circle">
  75. <Setter Property="Width" Value="80"/>
  76. <Setter Property="Height" Value="80"/>
  77. <Setter Property="Canvas.Left" Value="-100"/>
  78. </Style>
  79. <Style TargetType="{x:Type cc:NavigationBar}">
  80. <Setter Property="ItemContainerStyle" Value="{StaticResource MagicBarItem}"/>
  81. <Setter Property="SnapsToDevicePixels" Value="True"/>
  82. <Setter Property="UseLayoutRounding" Value="True"/>
  83. <Setter Property="Background" Value="Transparent"/>
  84. <Setter Property="Width" Value="440"/>
  85. <Setter Property="Height" Value="120"/>
  86. <Setter Property="Template">
  87. <Setter.Value>
  88. <ControlTemplate TargetType="{x:Type cc:NavigationBar}">
  89. <Grid Background="{TemplateBinding Background}">
  90. <Grid.Clip>
  91. <RectangleGeometry Rect="0 0 440 120"/>
  92. </Grid.Clip>
  93. <Border Style="{StaticResource Bar}"/>
  94. <Canvas Margin="20 0 20 0">
  95. <Grid x:Name="PART_Circle" Style="{StaticResource Circle}">
  96. <Path Style="{StaticResource Arc}"/>
  97. <Ellipse Fill="#222222"/>
  98. <Ellipse Fill="CadetBlue" Margin="6"/>
  99. </Grid>
  100. </Canvas>
  101. <ItemsPresenter Margin="20 40 20 0"/>
  102. </Grid>
  103. </ControlTemplate>
  104. </Setter.Value>
  105. </Setter>
  106. <Setter Property="ItemsPanel">
  107. <Setter.Value>
  108. <ItemsPanelTemplate>
  109. <UniformGrid Columns="5"/>
  110. </ItemsPanelTemplate>
  111. </Setter.Value>
  112. </Setter>
  113. </Style>
  114. </ResourceDictionary>