Skip to content

Commit d6d4d00

Browse files
authored
Merge pull request #1050 from unoplatform/dev/arde/csharp-markup-lightweight-styling-combobox
feat: add lightweight styling to ComboBox
2 parents e55e49c + 25064ec commit d6d4d00

File tree

2 files changed

+300
-6
lines changed

2 files changed

+300
-6
lines changed

src/library/Uno.Themes.WinUI.Markup/Theme.Styles.cs

-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ public static class CheckBox
2828
public static ResourceValue<Style> Secondary => new("SecondaryCheckBoxStyle");
2929
}
3030

31-
public static class ComboBox
32-
{
33-
[ResourceKeyDefinition(typeof(Style), "ComboBoxStyle", TargetType = typeof(ComboBox))]
34-
public static ResourceValue<Style> Default => new("ComboBoxStyle");
35-
}
36-
3731
public static class AppBarButton
3832
{
3933
[ResourceKeyDefinition(typeof(Style), "AppBarButtonStyle", TargetType = typeof(AppBarButton))]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,300 @@
1+
using Microsoft.UI.Xaml;
2+
using Microsoft.UI.Xaml.Media;
3+
using Uno.Extensions.Markup.Internals;
4+
5+
namespace Uno.Themes.Markup
6+
{
7+
public static partial class Theme
8+
{
9+
public static class ComboBox
10+
{
11+
public static class Resources
12+
{
13+
public static class Default
14+
{
15+
public static class Foreground
16+
{
17+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxForeground")]
18+
public static ResourceValue<Brush> Default => new("ComboBoxForeground", true);
19+
20+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxForegroundPointerOver")]
21+
public static ResourceValue<Brush> PointerOver => new("ComboBoxForegroundPointerOver", true);
22+
23+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxForegroundPressed")]
24+
public static ResourceValue<Brush> Pressed => new("ComboBoxForegroundPressed", true);
25+
26+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxForegroundDisabled")]
27+
public static ResourceValue<Brush> Disabled => new("ComboBoxForegroundDisabled", true);
28+
29+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxForegroundFocused")]
30+
public static ResourceValue<Brush> Focused => new("ComboBoxForegroundFocused", true);
31+
32+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxForegroundFocusedPressed")]
33+
public static ResourceValue<Brush> FocusedPressed => new("ComboBoxForegroundFocusedPressed", true);
34+
}
35+
36+
public static class Background
37+
{
38+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBackground")]
39+
public static ResourceValue<Brush> Default => new("ComboBoxBackground", true);
40+
41+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBackgroundPointerOver")]
42+
public static ResourceValue<Brush> PointerOver => new("ComboBoxBackgroundPointerOver", true);
43+
44+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBackgroundPressed")]
45+
public static ResourceValue<Brush> Pressed => new("ComboBoxBackgroundPressed", true);
46+
47+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBackgroundDisabled")]
48+
public static ResourceValue<Brush> Disabled => new("ComboBoxBackgroundDisabled", true);
49+
50+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBackgroundUnfocused")]
51+
public static ResourceValue<Brush> Unfocused => new("ComboBoxBackgroundUnfocused", true);
52+
53+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBackgroundFocused")]
54+
public static ResourceValue<Brush> Focused => new("ComboBoxBackgroundFocused", true);
55+
56+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBackgroundFocusedPressed")]
57+
public static ResourceValue<Brush> FocusedPressed => new("ComboBoxBackgroundFocusedPressed", true);
58+
}
59+
60+
public static class BorderBrush
61+
{
62+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBorderBrush")]
63+
public static ResourceValue<Brush> Default => new("ComboBoxBorderBrush", true);
64+
65+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBorderBrushPressed")]
66+
public static ResourceValue<Brush> Pressed => new("ComboBoxBorderBrushPressed", true);
67+
68+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBorderBrushPointerOver")]
69+
public static ResourceValue<Brush> PointerOver => new("ComboBoxBorderBrushPointerOver", true);
70+
71+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBorderBrushDisabled")]
72+
public static ResourceValue<Brush> Disabled => new("ComboBoxBorderBrushDisabled", true);
73+
74+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxBorderBrushOpened")]
75+
public static ResourceValue<Brush> Opened => new("ComboBoxBorderBrushOpened", true);
76+
}
77+
78+
public static class PlaceHolderForeground
79+
{
80+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxPlaceHolderForeground")]
81+
public static ResourceValue<Brush> Default => new("ComboBoxPlaceHolderForeground", true);
82+
83+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxPlaceHolderForegroundPointerOver")]
84+
public static ResourceValue<Brush> PointerOver => new("ComboBoxPlaceHolderForegroundPointerOver", true);
85+
86+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxPlaceHolderForegroundPressed")]
87+
public static ResourceValue<Brush> Pressed => new("ComboBoxPlaceHolderForegroundPressed", true);
88+
89+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxPlaceHolderForegroundDisabled")]
90+
public static ResourceValue<Brush> Disabled => new("ComboBoxPlaceHolderForegroundDisabled", true);
91+
92+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxPlaceHolderForegroundFocused")]
93+
public static ResourceValue<Brush> Focused => new("ComboBoxPlaceHolderForegroundFocused", true);
94+
95+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxPlaceHolderForegroundFocusedPressed")]
96+
public static ResourceValue<Brush> FocusedPressed => new("ComboBoxPlaceHolderForegroundFocusedPressed", true);
97+
}
98+
99+
public static class LeadingIconForeground
100+
{
101+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxLeadingIconForeground")]
102+
public static ResourceValue<Brush> Default => new("ComboBoxLeadingIconForeground", true);
103+
104+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxLeadingIconForegroundDisabled")]
105+
public static ResourceValue<Brush> Disabled => new("ComboBoxLeadingIconForegroundDisabled", true);
106+
}
107+
108+
public static class ArrowForeground
109+
{
110+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxArrowForeground")]
111+
public static ResourceValue<Brush> Default => new("ComboBoxArrowForeground", true);
112+
113+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxArrowForegroundOpened")]
114+
public static ResourceValue<Brush> Opened => new("ComboBoxArrowForegroundOpened", true);
115+
}
116+
117+
public static class UpperPlaceHolderForeground
118+
{
119+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxUpperPlaceHolderForeground")]
120+
public static ResourceValue<Brush> Default => new("ComboBoxUpperPlaceHolderForeground", true);
121+
}
122+
}
123+
124+
public static class ComboBoxItem
125+
{
126+
public static class Foreground
127+
{
128+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemForeground")]
129+
public static ResourceValue<Brush> Default => new("ComboBoxItemForeground", true);
130+
131+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemForegroundPressed")]
132+
public static ResourceValue<Brush> Pressed => new("ComboBoxItemForegroundPressed", true);
133+
134+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemForegroundPointerOver")]
135+
public static ResourceValue<Brush> PointerOver => new("ComboBoxItemForegroundPointerOver", true);
136+
137+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemForegroundDisabled")]
138+
public static ResourceValue<Brush> Disabled => new("ComboBoxItemForegroundDisabled", true);
139+
}
140+
141+
public static class ForegroundSelected
142+
{
143+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemForegroundSelected")]
144+
public static ResourceValue<Brush> Default => new("ComboBoxItemForegroundSelected", true);
145+
146+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemForegroundSelectedUnfocused")]
147+
public static ResourceValue<Brush> Unfocused => new("ComboBoxItemForegroundSelectedUnfocused", true);
148+
149+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemForegroundSelectedPressed")]
150+
public static ResourceValue<Brush> Pressed => new("ComboBoxItemForegroundSelectedPressed", true);
151+
152+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemForegroundSelectedPointerOver")]
153+
public static ResourceValue<Brush> PointerOver => new("ComboBoxItemForegroundSelectedPointerOver", true);
154+
155+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemForegroundSelectedDisabled")]
156+
public static ResourceValue<Brush> Disabled => new("ComboBoxItemForegroundSelectedDisabled", true);
157+
}
158+
159+
public static class Background
160+
{
161+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBackground")]
162+
public static ResourceValue<Brush> Default => new("ComboBoxItemBackground", true);
163+
164+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBackgroundPressed")]
165+
public static ResourceValue<Brush> Pressed => new("ComboBoxItemBackgroundPressed", true);
166+
167+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBackgroundPointerOver")]
168+
public static ResourceValue<Brush> PointerOver => new("ComboBoxItemBackgroundPointerOver", true);
169+
170+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBackgroundDisabled")]
171+
public static ResourceValue<Brush> Disabled => new("ComboBoxItemBackgroundDisabled", true);
172+
}
173+
174+
public static class BackgroundSelected
175+
{
176+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBackgroundSelected")]
177+
public static ResourceValue<Brush> Default => new("ComboBoxItemBackgroundSelected", true);
178+
179+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBackgroundSelectedUnfocused")]
180+
public static ResourceValue<Brush> Unfocused => new("ComboBoxItemBackgroundSelectedUnfocused", true);
181+
182+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBackgroundSelectedPressed")]
183+
public static ResourceValue<Brush> Pressed => new("ComboBoxItemBackgroundSelectedPressed", true);
184+
185+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBackgroundSelectedPointerOver")]
186+
public static ResourceValue<Brush> PointerOver => new("ComboBoxItemBackgroundSelectedPointerOver", true);
187+
188+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBackgroundSelectedDisabled")]
189+
public static ResourceValue<Brush> Disabled => new("ComboBoxItemBackgroundSelectedDisabled", true);
190+
}
191+
192+
public static class BorderBrush
193+
{
194+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBorderBrush")]
195+
public static ResourceValue<Brush> Default => new("ComboBoxItemBorderBrush", true);
196+
197+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBorderBrushPressed")]
198+
public static ResourceValue<Brush> Pressed => new("ComboBoxItemBorderBrushPressed", true);
199+
200+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBorderBrushPointerOver")]
201+
public static ResourceValue<Brush> PointerOver => new("ComboBoxItemBorderBrushPointerOver", true);
202+
203+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBorderBrushDisabled")]
204+
public static ResourceValue<Brush> Disabled => new("ComboBoxItemBorderBrushDisabled", true);
205+
}
206+
207+
public static class BorderBrushSelected
208+
{
209+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBorderBrushSelected")]
210+
public static ResourceValue<Brush> Default => new("ComboBoxItemBorderBrushSelected", true);
211+
212+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBorderBrushSelectedUnfocused")]
213+
public static ResourceValue<Brush> Unfocused => new("ComboBoxItemBorderBrushSelectedUnfocused", true);
214+
215+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBorderBrushSelectedPressed")]
216+
public static ResourceValue<Brush> Pressed => new("ComboBoxItemBorderBrushSelectedPressed", true);
217+
218+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBorderBrushSelectedPointerOver")]
219+
public static ResourceValue<Brush> PointerOver => new("ComboBoxItemBorderBrushSelectedPointerOver", true);
220+
221+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemBorderBrushSelectedDisabled")]
222+
public static ResourceValue<Brush> Disabled => new("ComboBoxItemBorderBrushSelectedDisabled", true);
223+
}
224+
225+
public static class PillFill
226+
{
227+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxItemPillFillBrush")]
228+
public static ResourceValue<Brush> Default => new("ComboBoxItemPillFillBrush", true);
229+
}
230+
}
231+
232+
public static class DropDown
233+
{
234+
public static class GlyphForeground
235+
{
236+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownGlyphForeground")]
237+
public static ResourceValue<Brush> Default => new("ComboBoxDropDownGlyphForeground", true);
238+
239+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownGlyphForegroundFocusedPressed")]
240+
public static ResourceValue<Brush> FocusedPressed => new("ComboBoxDropDownGlyphForegroundFocusedPressed", true);
241+
242+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownGlyphForegroundFocused")]
243+
public static ResourceValue<Brush> Focused => new("ComboBoxDropDownGlyphForegroundFocused", true);
244+
245+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownGlyphForegroundDisabled")]
246+
public static ResourceValue<Brush> Disabled => new("ComboBoxDropDownGlyphForegroundDisabled", true);
247+
}
248+
249+
public static class Foreground
250+
{
251+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownForeground")]
252+
public static ResourceValue<Brush> Default => new("ComboBoxDropDownForeground", true);
253+
}
254+
255+
public static class BorderBrush
256+
{
257+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownBorderBrush")]
258+
public static ResourceValue<Brush> Default => new("ComboBoxDropDownBorderBrush", true);
259+
}
260+
261+
public static class Background
262+
{
263+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownBackground")]
264+
public static ResourceValue<Brush> Default => new("ComboBoxDropDownBackground", true);
265+
266+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownBackgroundPointerOver")]
267+
public static ResourceValue<Brush> PointerOver => new("ComboBoxDropDownBackgroundPointerOver", true);
268+
269+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownBackgroundPointerPressed")]
270+
public static ResourceValue<Brush> PointerPressed => new("ComboBoxDropDownBackgroundPointerPressed", true);
271+
272+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownBackgroundPressed")]
273+
public static ResourceValue<Brush> Pressed => new("ComboBoxDropDownBackgroundPressed", true);
274+
275+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownBackgroundFocused")]
276+
public static ResourceValue<Brush> Focused => new("ComboBoxDropDownBackgroundFocused", true);
277+
278+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxDropDownBackgroundFocusedPressed")]
279+
public static ResourceValue<Brush> FocusedPressed => new("ComboBoxDropDownBackgroundFocusedPressed", true);
280+
}
281+
}
282+
283+
public static class EditableDropDown
284+
{
285+
public static class GlyphForeground
286+
{
287+
[ResourceKeyDefinition(typeof(Brush), "ComboBoxEditableDropDownGlyphForeground")]
288+
public static ResourceValue<Brush> Default => new("ComboBoxEditableDropDownGlyphForeground", true);
289+
}
290+
}
291+
}
292+
293+
public static class Styles
294+
{
295+
[ResourceKeyDefinition(typeof(Style), "ComboBoxStyle", TargetType = typeof(ComboBox))]
296+
public static ResourceValue<Style> Default => new("ComboBoxStyle");
297+
}
298+
}
299+
}
300+
}

0 commit comments

Comments
 (0)