1
+ <ResourceDictionary
2
+ xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3
+ xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
4
+ xmlns : controls =" clr-namespace:WPFDevelopers.Controls"
5
+ xmlns : convert =" clr-namespace:WPFDevelopers.Converts" >
6
+ <ResourceDictionary .MergedDictionaries>
7
+ <ResourceDictionary Source =" Basic/ControlBasic.xaml" />
8
+ </ResourceDictionary .MergedDictionaries>
9
+ <convert : IndexToColor x : Key =" WD.IndexToColor" />
10
+ <Style
11
+ x : Key =" WD.CircleMenuItem"
12
+ BasedOn =" {StaticResource WD.ControlBasicStyle}"
13
+ TargetType =" {x:Type controls:CircleMenuItem}" >
14
+ <Setter Property =" Template" >
15
+ <Setter .Value>
16
+ <ControlTemplate TargetType =" {x:Type controls:CircleMenuItem}" >
17
+ <controls : SmallPanel VerticalAlignment =" Top" >
18
+ <controls : SmallPanel .RenderTransform>
19
+ <RotateTransform x : Name =" PART_RotateTransform" Angle =" {TemplateBinding Angle}" CenterX =" 200" CenterY =" 200" />
20
+ </controls : SmallPanel .RenderTransform>
21
+ <Path
22
+ x : Name =" PART_Path"
23
+ VerticalAlignment =" Center"
24
+ Data =" {StaticResource WD.CircularGeometry}"
25
+ Fill =" {TemplateBinding BackgroundColor}" />
26
+ <Image
27
+ Width =" 40"
28
+ Height =" 40"
29
+ Margin =" 60,100,0,0"
30
+ HorizontalAlignment =" Left"
31
+ VerticalAlignment =" Center"
32
+ RenderTransformOrigin =" 0.5,0.5"
33
+ Source =" {TemplateBinding IconImage}" >
34
+ <Image .RenderTransform>
35
+ <RotateTransform Angle =" -70" />
36
+ </Image .RenderTransform>
37
+ </Image >
38
+ </controls : SmallPanel >
39
+ <ControlTemplate .Triggers>
40
+ <Trigger Property =" IsMouseOver" Value =" True" >
41
+ <Setter TargetName =" PART_Path" Property =" Fill" Value =" {DynamicResource WD.PrimaryNormalSolidColorBrush}" />
42
+ </Trigger >
43
+ </ControlTemplate .Triggers>
44
+ </ControlTemplate >
45
+ </Setter .Value>
46
+ </Setter >
47
+ </Style >
48
+ <Style
49
+ x : Key =" WD.CircleMenu"
50
+ BasedOn =" {StaticResource WD.ControlBasicStyle}"
51
+ TargetType =" {x:Type controls:CircleMenu}" >
52
+ <Setter Property =" Width" Value =" 400" />
53
+ <Setter Property =" Height" Value =" 400" />
54
+ <Setter Property =" Template" >
55
+ <Setter .Value>
56
+ <ControlTemplate TargetType =" {x:Type controls:CircleMenu}" >
57
+ <controls : SmallPanel >
58
+ <ItemsControl
59
+ x : Name =" PART_ItemsControl"
60
+ Width =" {TemplateBinding Width}"
61
+ Height =" {TemplateBinding Height}"
62
+ AlternationCount =" {TemplateBinding AlternationCount}"
63
+ ItemsSource =" {TemplateBinding ItemsSource}" >
64
+ <ItemsControl .Clip>
65
+ <EllipseGeometry
66
+ x : Name =" PART_EllipseGeometry"
67
+ Center =" 200,200"
68
+ RadiusX =" 0"
69
+ RadiusY =" 0" />
70
+ </ItemsControl .Clip>
71
+ <ItemsControl .ItemTemplate>
72
+ <DataTemplate >
73
+ <controls : CircleMenuItem
74
+ Angle =" {Binding Angle}"
75
+ BackgroundColor =" {Binding Path=(ItemsControl.AlternationIndex), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource WD.IndexToColor}}"
76
+ IconImage =" {Binding IconImage}"
77
+ MenuTxt =" {Binding MenuTxt}" />
78
+ </DataTemplate >
79
+ </ItemsControl .ItemTemplate>
80
+ <ItemsControl .ItemsPanel>
81
+ <ItemsPanelTemplate >
82
+ <controls : SmallPanel />
83
+ </ItemsPanelTemplate >
84
+ </ItemsControl .ItemsPanel>
85
+ </ItemsControl >
86
+ <ToggleButton x : Name =" PART_ToggleButton" Cursor =" Hand" >
87
+ <ToggleButton .Template>
88
+ <ControlTemplate TargetType =" ToggleButton" >
89
+ <controls : SmallPanel >
90
+ <Ellipse
91
+ x : Name =" PART_Ellipse"
92
+ Width =" 100"
93
+ Height =" 100"
94
+ Fill =" {StaticResource WD.PrimaryNormalSolidColorBrush}" />
95
+ <controls : PathIcon
96
+ x : Name =" PART_Path"
97
+ Width =" 20"
98
+ Height =" 20"
99
+ Foreground =" {StaticResource WD.BackgroundSolidColorBrush}"
100
+ Kind =" Add"
101
+ RenderTransformOrigin =" 0.5,0.5" />
102
+ </controls : SmallPanel >
103
+ <ControlTemplate .Triggers>
104
+ <Trigger Property =" IsChecked" Value =" True" >
105
+ <Setter TargetName =" PART_Path" Property =" RenderTransform" >
106
+ <Setter .Value>
107
+ <RotateTransform Angle =" 45" />
108
+ </Setter .Value>
109
+ </Setter >
110
+ </Trigger >
111
+ </ControlTemplate .Triggers>
112
+ </ControlTemplate >
113
+ </ToggleButton .Template>
114
+ </ToggleButton >
115
+ </controls : SmallPanel >
116
+ </ControlTemplate >
117
+ </Setter .Value>
118
+ </Setter >
119
+ </Style >
120
+ <Style BasedOn =" {StaticResource WD.CircleMenuItem}" TargetType =" {x:Type controls:CircleMenuItem}" />
121
+ <Style BasedOn =" {StaticResource WD.CircleMenu}" TargetType =" {x:Type controls:CircleMenu}" />
122
+ </ResourceDictionary >
0 commit comments