Skip to content

Commit 1d0b634

Browse files
authored
Feature: Added styles back to controls (#115)
1 parent a82eac8 commit 1d0b634

File tree

2 files changed

+262
-2
lines changed

2 files changed

+262
-2
lines changed

src/core/Riverside.GlowUI.Styles/CubeUI.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:ToolkitControls="using:Riverside.Toolkit.Controls"
55
xmlns:icons="using:Riverside.Toolkit.Icons">
6-
<ResourceDictionary.MergedDictionaries>
6+
<!--<ResourceDictionary.MergedDictionaries> There's positively no way to get this to work without using code-behind.
77
<ResourceDictionary Source="ms-appx:///Riverside.Toolkit/Styles/CubeThemeDictionary.xaml" />
8-
</ResourceDictionary.MergedDictionaries>
8+
</ResourceDictionary.MergedDictionaries>-->
99
<Style x:Key="MicaFlyoutStyle" TargetType="FlyoutPresenter">
1010
<Setter Property="Margin" Value="0" />
1111
<Setter Property="Opacity" Value="1" />
Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
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="using:Riverside.Toolkit.Controls"
5+
xmlns:muxc="using:Microsoft.UI.Xaml.Controls">
6+
7+
<Style TargetType="local:CommandLink">
8+
<Setter Property="Foreground" Value="{StaticResource AccentTextFillColorPrimaryBrush}" />
9+
<Setter Property="Template">
10+
<Setter.Value>
11+
<ControlTemplate TargetType="local:CommandLink">
12+
<Grid
13+
x:Name="ContentArea"
14+
Padding="16,10,16,14"
15+
Background="{TemplateBinding Background}"
16+
BorderBrush="{TemplateBinding BorderBrush}"
17+
BorderThickness="1"
18+
CornerRadius="4">
19+
<Grid.BackgroundTransition>
20+
<BrushTransition Duration="0:0:0.083" />
21+
</Grid.BackgroundTransition>
22+
23+
<FontIcon
24+
Margin="0,10,0,0"
25+
HorizontalAlignment="Left"
26+
VerticalAlignment="Top"
27+
Foreground="{TemplateBinding Foreground}"
28+
Glyph="&#xEBE7;" />
29+
<StackPanel Margin="40,0,0,0" Spacing="10">
30+
<TextBlock
31+
Foreground="{TemplateBinding Foreground}"
32+
Style="{StaticResource TitleTextBlockStyle}"
33+
Text="{TemplateBinding Title}"
34+
TextWrapping="WrapWholeWords" />
35+
<TextBlock
36+
Foreground="{TemplateBinding Foreground}"
37+
Text="{TemplateBinding Description}"
38+
TextWrapping="WrapWholeWords" />
39+
</StackPanel>
40+
<VisualStateManager.VisualStateGroups>
41+
<VisualStateGroup x:Name="CommonStates">
42+
<VisualState x:Name="Normal" />
43+
<VisualState x:Name="PointerOver">
44+
<VisualState.Setters>
45+
<Setter Target="ContentArea.Background" Value="{StaticResource ControlFillColorSecondaryBrush}" />
46+
<Setter Target="ContentArea.BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
47+
</VisualState.Setters>
48+
</VisualState>
49+
<VisualState x:Name="Pressed">
50+
<VisualState.Setters>
51+
<Setter Target="ContentArea.Background" Value="{StaticResource ControlFillColorTertiaryBrush}" />
52+
<Setter Target="ContentArea.BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
53+
</VisualState.Setters>
54+
</VisualState>
55+
</VisualStateGroup>
56+
</VisualStateManager.VisualStateGroups>
57+
</Grid>
58+
</ControlTemplate>
59+
</Setter.Value>
60+
</Setter>
61+
</Style>
62+
<Style x:Key="UACCommandLinkStyle" TargetType="local:CommandLink">
63+
<Setter Property="Foreground" Value="{StaticResource AccentTextFillColorPrimaryBrush}" />
64+
<Setter Property="Template">
65+
<Setter.Value>
66+
<ControlTemplate TargetType="local:CommandLink">
67+
<Grid
68+
x:Name="ContentArea"
69+
Padding="16,10,16,14"
70+
Background="{TemplateBinding Background}"
71+
BorderBrush="{TemplateBinding BorderBrush}"
72+
BorderThickness="1"
73+
CornerRadius="4">
74+
<Grid.BackgroundTransition>
75+
<BrushTransition Duration="0:0:0.083" />
76+
</Grid.BackgroundTransition>
77+
78+
<muxc:ImageIcon
79+
Width="25"
80+
Margin="0,8,0,0"
81+
HorizontalAlignment="Left"
82+
VerticalAlignment="Top"
83+
Source="/Assets/Windows/UserAccountControl.png" />
84+
<StackPanel Margin="40,0,0,0" Spacing="10">
85+
<TextBlock
86+
Foreground="{TemplateBinding Foreground}"
87+
Style="{StaticResource TitleTextBlockStyle}"
88+
Text="{TemplateBinding Title}"
89+
TextWrapping="WrapWholeWords" />
90+
<TextBlock
91+
Foreground="{TemplateBinding Foreground}"
92+
Text="{TemplateBinding Description}"
93+
TextWrapping="WrapWholeWords" />
94+
</StackPanel>
95+
<VisualStateManager.VisualStateGroups>
96+
<VisualStateGroup x:Name="CommonStates">
97+
<VisualState x:Name="Normal" />
98+
<VisualState x:Name="PointerOver">
99+
<VisualState.Setters>
100+
<Setter Target="ContentArea.Background" Value="{StaticResource ControlFillColorSecondaryBrush}" />
101+
<Setter Target="ContentArea.BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
102+
</VisualState.Setters>
103+
</VisualState>
104+
<VisualState x:Name="Pressed">
105+
<VisualState.Setters>
106+
<Setter Target="ContentArea.Background" Value="{StaticResource ControlFillColorTertiaryBrush}" />
107+
<Setter Target="ContentArea.BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
108+
</VisualState.Setters>
109+
</VisualState>
110+
</VisualStateGroup>
111+
</VisualStateManager.VisualStateGroups>
112+
</Grid>
113+
</ControlTemplate>
114+
</Setter.Value>
115+
</Setter>
116+
</Style>
117+
<Style x:Key="AccentCommandLinkStyle" TargetType="local:CommandLink">
118+
<Setter Property="Foreground" Value="{StaticResource TextOnAccentFillColorPrimaryBrush}" />
119+
<Setter Property="Template">
120+
<Setter.Value>
121+
<ControlTemplate TargetType="local:CommandLink">
122+
<Grid
123+
x:Name="ContentArea"
124+
Padding="16,10,16,14"
125+
Background="{StaticResource AccentFillColorDefaultBrush}"
126+
BorderBrush="{TemplateBinding BorderBrush}"
127+
BorderThickness="1"
128+
CornerRadius="4">
129+
<Grid.BackgroundTransition>
130+
<BrushTransition Duration="0:0:0.083" />
131+
</Grid.BackgroundTransition>
132+
133+
<FontIcon
134+
Margin="0,10,0,0"
135+
HorizontalAlignment="Left"
136+
VerticalAlignment="Top"
137+
Foreground="{TemplateBinding Foreground}"
138+
Glyph="" />
139+
<StackPanel Margin="40,0,0,0" Spacing="10">
140+
<TextBlock
141+
Foreground="{TemplateBinding Foreground}"
142+
Style="{StaticResource TitleTextBlockStyle}"
143+
Text="{TemplateBinding Title}"
144+
TextWrapping="WrapWholeWords" />
145+
<TextBlock
146+
Foreground="{TemplateBinding Foreground}"
147+
Text="{TemplateBinding Description}"
148+
TextWrapping="WrapWholeWords" />
149+
</StackPanel>
150+
<VisualStateManager.VisualStateGroups>
151+
<VisualStateGroup x:Name="CommonStates">
152+
<VisualState x:Name="Normal" />
153+
<VisualState x:Name="PointerOver">
154+
<VisualState.Setters>
155+
<Setter Target="ContentArea.Background" Value="{StaticResource AccentFillColorSecondaryBrush}" />
156+
<Setter Target="ContentArea.BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
157+
</VisualState.Setters>
158+
</VisualState>
159+
<VisualState x:Name="Pressed">
160+
<VisualState.Setters>
161+
<Setter Target="ContentArea.Background" Value="{StaticResource AccentFillColorTertiaryBrush}" />
162+
<Setter Target="ContentArea.BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
163+
</VisualState.Setters>
164+
</VisualState>
165+
</VisualStateGroup>
166+
</VisualStateManager.VisualStateGroups>
167+
</Grid>
168+
</ControlTemplate>
169+
</Setter.Value>
170+
</Setter>
171+
</Style>
172+
173+
<Style TargetType="local:Card">
174+
<Setter Property="Template">
175+
<Setter.Value>
176+
<ControlTemplate TargetType="local:Card">
177+
<Grid
178+
x:Name="ContentArea"
179+
Padding="16,10,16,14"
180+
Background="{StaticResource CardBackgroundFillColorDefaultBrush}"
181+
BorderBrush="{StaticResource CardStrokeColorDefaultBrush}"
182+
BorderThickness="1"
183+
CornerRadius="4">
184+
<Grid.BackgroundTransition>
185+
<BrushTransition Duration="0:0:0.083" />
186+
</Grid.BackgroundTransition>
187+
<StackPanel Spacing="10">
188+
<TextBlock
189+
Foreground="{TemplateBinding Foreground}"
190+
Style="{StaticResource TitleTextBlockStyle}"
191+
Text="{TemplateBinding Title}"
192+
TextWrapping="WrapWholeWords" />
193+
<TextBlock
194+
Foreground="{TemplateBinding Foreground}"
195+
Style="{StaticResource SubtitleTextBlockStyle}"
196+
Text="{TemplateBinding Subtitle}"
197+
TextWrapping="WrapWholeWords" />
198+
<TextBlock
199+
Foreground="{TemplateBinding Foreground}"
200+
Text="{TemplateBinding Content}"
201+
TextWrapping="WrapWholeWords" />
202+
</StackPanel>
203+
<VisualStateManager.VisualStateGroups>
204+
<VisualStateGroup x:Name="CommonStates">
205+
<VisualState x:Name="Normal" />
206+
<VisualState x:Name="PointerOver">
207+
<VisualState.Setters>
208+
<Setter Target="ContentArea.Background" Value="{StaticResource ControlFillColorSecondaryBrush}" />
209+
<Setter Target="ContentArea.BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
210+
</VisualState.Setters>
211+
</VisualState>
212+
<VisualState x:Name="Pressed">
213+
<VisualState.Setters>
214+
<Setter Target="ContentArea.Background" Value="{StaticResource ControlFillColorTertiaryBrush}" />
215+
<Setter Target="ContentArea.BorderBrush" Value="{StaticResource ControlElevationBorderBrush}" />
216+
</VisualState.Setters>
217+
</VisualState>
218+
</VisualStateGroup>
219+
</VisualStateManager.VisualStateGroups>
220+
</Grid>
221+
</ControlTemplate>
222+
</Setter.Value>
223+
</Setter>
224+
</Style>
225+
226+
<Style TargetType="local:ChatBubble">
227+
<Setter Property="Template">
228+
<Setter.Value>
229+
<ControlTemplate TargetType="local:ChatBubble">
230+
<Grid
231+
Padding="8"
232+
VerticalAlignment="Top"
233+
Background="{ThemeResource CardBackgroundFillColorDefault}"
234+
CornerRadius="8">
235+
<TextBlock x:Name="BubbleText" Text="{TemplateBinding Text}" />
236+
</Grid>
237+
</ControlTemplate>
238+
</Setter.Value>
239+
</Setter>
240+
</Style>
241+
242+
<Style x:Key="AccentChatBubbleStyle" TargetType="local:ChatBubble">
243+
<Setter Property="Template">
244+
<Setter.Value>
245+
<ControlTemplate TargetType="local:ChatBubble">
246+
<Grid
247+
Padding="8"
248+
VerticalAlignment="Top"
249+
Background="{ThemeResource AccentFillColorDefaultBrush}"
250+
CornerRadius="8">
251+
<TextBlock
252+
x:Name="BubbleText"
253+
Foreground="{ThemeResource TextOnAccentFillColorPrimaryBrush}"
254+
Text="{TemplateBinding Text}" />
255+
</Grid>
256+
</ControlTemplate>
257+
</Setter.Value>
258+
</Setter>
259+
</Style>
260+
</ResourceDictionary>

0 commit comments

Comments
 (0)