Skip to content

Commit 8cf042d

Browse files
author
reunion-maestro-bot
committed
Merged PR 14427705: Update WrapPanel properties to align to released LinedFlowLayout, see discussion #10858
Syncing content from committish 718be114ad87e2aeec1a7ad95aacaef3bb32f689
1 parent e9fd76c commit 8cf042d

File tree

6 files changed

+136
-135
lines changed

6 files changed

+136
-135
lines changed

src/controls/dev/Generated/WrapPanel.properties.cpp

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ namespace winrt::Microsoft::UI::Xaml::Controls
1313

1414
#include "WrapPanel.g.cpp"
1515

16-
GlobalDependencyProperty WrapPanelProperties::s_HorizontalSpacingProperty{ nullptr };
16+
GlobalDependencyProperty WrapPanelProperties::s_ItemSpacingProperty{ nullptr };
17+
GlobalDependencyProperty WrapPanelProperties::s_ItemsStretchProperty{ nullptr };
18+
GlobalDependencyProperty WrapPanelProperties::s_LineSpacingProperty{ nullptr };
1719
GlobalDependencyProperty WrapPanelProperties::s_OrientationProperty{ nullptr };
1820
GlobalDependencyProperty WrapPanelProperties::s_PaddingProperty{ nullptr };
19-
GlobalDependencyProperty WrapPanelProperties::s_StretchChildProperty{ nullptr };
20-
GlobalDependencyProperty WrapPanelProperties::s_VerticalSpacingProperty{ nullptr };
2121

2222
WrapPanelProperties::WrapPanelProperties()
2323
{
@@ -26,16 +26,38 @@ WrapPanelProperties::WrapPanelProperties()
2626

2727
void WrapPanelProperties::EnsureProperties()
2828
{
29-
if (!s_HorizontalSpacingProperty)
29+
if (!s_ItemSpacingProperty)
3030
{
31-
s_HorizontalSpacingProperty =
31+
s_ItemSpacingProperty =
3232
InitializeDependencyProperty(
33-
L"HorizontalSpacing",
33+
L"ItemSpacing",
3434
winrt::name_of<double>(),
3535
winrt::name_of<winrt::WrapPanel>(),
3636
false /* isAttached */,
3737
ValueHelper<double>::BoxedDefaultValue(),
38-
winrt::PropertyChangedCallback(&OnHorizontalSpacingPropertyChanged));
38+
winrt::PropertyChangedCallback(&OnItemSpacingPropertyChanged));
39+
}
40+
if (!s_ItemsStretchProperty)
41+
{
42+
s_ItemsStretchProperty =
43+
InitializeDependencyProperty(
44+
L"ItemsStretch",
45+
winrt::name_of<winrt::WrapPanelItemsStretch>(),
46+
winrt::name_of<winrt::WrapPanel>(),
47+
false /* isAttached */,
48+
ValueHelper<winrt::WrapPanelItemsStretch>::BoxedDefaultValue(),
49+
winrt::PropertyChangedCallback(&OnItemsStretchPropertyChanged));
50+
}
51+
if (!s_LineSpacingProperty)
52+
{
53+
s_LineSpacingProperty =
54+
InitializeDependencyProperty(
55+
L"LineSpacing",
56+
winrt::name_of<double>(),
57+
winrt::name_of<winrt::WrapPanel>(),
58+
false /* isAttached */,
59+
ValueHelper<double>::BoxedDefaultValue(),
60+
winrt::PropertyChangedCallback(&OnLineSpacingPropertyChanged));
3961
}
4062
if (!s_OrientationProperty)
4163
{
@@ -59,140 +81,118 @@ void WrapPanelProperties::EnsureProperties()
5981
ValueHelper<winrt::Thickness>::BoxedDefaultValue(),
6082
winrt::PropertyChangedCallback(&OnPaddingPropertyChanged));
6183
}
62-
if (!s_StretchChildProperty)
63-
{
64-
s_StretchChildProperty =
65-
InitializeDependencyProperty(
66-
L"StretchChild",
67-
winrt::name_of<winrt::StretchChild>(),
68-
winrt::name_of<winrt::WrapPanel>(),
69-
false /* isAttached */,
70-
ValueHelper<winrt::StretchChild>::BoxedDefaultValue(),
71-
winrt::PropertyChangedCallback(&OnStretchChildPropertyChanged));
72-
}
73-
if (!s_VerticalSpacingProperty)
74-
{
75-
s_VerticalSpacingProperty =
76-
InitializeDependencyProperty(
77-
L"VerticalSpacing",
78-
winrt::name_of<double>(),
79-
winrt::name_of<winrt::WrapPanel>(),
80-
false /* isAttached */,
81-
ValueHelper<double>::BoxedDefaultValue(),
82-
winrt::PropertyChangedCallback(&OnVerticalSpacingPropertyChanged));
83-
}
8484
}
8585

8686
void WrapPanelProperties::ClearProperties()
8787
{
88-
s_HorizontalSpacingProperty = nullptr;
88+
s_ItemSpacingProperty = nullptr;
89+
s_ItemsStretchProperty = nullptr;
90+
s_LineSpacingProperty = nullptr;
8991
s_OrientationProperty = nullptr;
9092
s_PaddingProperty = nullptr;
91-
s_StretchChildProperty = nullptr;
92-
s_VerticalSpacingProperty = nullptr;
9393
}
9494

95-
void WrapPanelProperties::OnHorizontalSpacingPropertyChanged(
95+
void WrapPanelProperties::OnItemSpacingPropertyChanged(
9696
winrt::DependencyObject const& sender,
9797
winrt::DependencyPropertyChangedEventArgs const& args)
9898
{
9999
auto owner = sender.as<winrt::WrapPanel>();
100100
winrt::get_self<WrapPanel>(owner)->OnPropertyChanged(args);
101101
}
102102

103-
void WrapPanelProperties::OnOrientationPropertyChanged(
103+
void WrapPanelProperties::OnItemsStretchPropertyChanged(
104104
winrt::DependencyObject const& sender,
105105
winrt::DependencyPropertyChangedEventArgs const& args)
106106
{
107107
auto owner = sender.as<winrt::WrapPanel>();
108108
winrt::get_self<WrapPanel>(owner)->OnPropertyChanged(args);
109109
}
110110

111-
void WrapPanelProperties::OnPaddingPropertyChanged(
111+
void WrapPanelProperties::OnLineSpacingPropertyChanged(
112112
winrt::DependencyObject const& sender,
113113
winrt::DependencyPropertyChangedEventArgs const& args)
114114
{
115115
auto owner = sender.as<winrt::WrapPanel>();
116116
winrt::get_self<WrapPanel>(owner)->OnPropertyChanged(args);
117117
}
118118

119-
void WrapPanelProperties::OnStretchChildPropertyChanged(
119+
void WrapPanelProperties::OnOrientationPropertyChanged(
120120
winrt::DependencyObject const& sender,
121121
winrt::DependencyPropertyChangedEventArgs const& args)
122122
{
123123
auto owner = sender.as<winrt::WrapPanel>();
124124
winrt::get_self<WrapPanel>(owner)->OnPropertyChanged(args);
125125
}
126126

127-
void WrapPanelProperties::OnVerticalSpacingPropertyChanged(
127+
void WrapPanelProperties::OnPaddingPropertyChanged(
128128
winrt::DependencyObject const& sender,
129129
winrt::DependencyPropertyChangedEventArgs const& args)
130130
{
131131
auto owner = sender.as<winrt::WrapPanel>();
132132
winrt::get_self<WrapPanel>(owner)->OnPropertyChanged(args);
133133
}
134134

135-
void WrapPanelProperties::HorizontalSpacing(double value)
135+
void WrapPanelProperties::ItemSpacing(double value)
136136
{
137137
[[gsl::suppress(con)]]
138138
{
139-
static_cast<WrapPanel*>(this)->SetValue(s_HorizontalSpacingProperty, ValueHelper<double>::BoxValueIfNecessary(value));
139+
static_cast<WrapPanel*>(this)->SetValue(s_ItemSpacingProperty, ValueHelper<double>::BoxValueIfNecessary(value));
140140
}
141141
}
142142

143-
double WrapPanelProperties::HorizontalSpacing()
143+
double WrapPanelProperties::ItemSpacing()
144144
{
145-
return ValueHelper<double>::CastOrUnbox(static_cast<WrapPanel*>(this)->GetValue(s_HorizontalSpacingProperty));
145+
return ValueHelper<double>::CastOrUnbox(static_cast<WrapPanel*>(this)->GetValue(s_ItemSpacingProperty));
146146
}
147147

148-
void WrapPanelProperties::Orientation(winrt::Orientation const& value)
148+
void WrapPanelProperties::ItemsStretch(winrt::WrapPanelItemsStretch const& value)
149149
{
150150
[[gsl::suppress(con)]]
151151
{
152-
static_cast<WrapPanel*>(this)->SetValue(s_OrientationProperty, ValueHelper<winrt::Orientation>::BoxValueIfNecessary(value));
152+
static_cast<WrapPanel*>(this)->SetValue(s_ItemsStretchProperty, ValueHelper<winrt::WrapPanelItemsStretch>::BoxValueIfNecessary(value));
153153
}
154154
}
155155

156-
winrt::Orientation WrapPanelProperties::Orientation()
156+
winrt::WrapPanelItemsStretch WrapPanelProperties::ItemsStretch()
157157
{
158-
return ValueHelper<winrt::Orientation>::CastOrUnbox(static_cast<WrapPanel*>(this)->GetValue(s_OrientationProperty));
158+
return ValueHelper<winrt::WrapPanelItemsStretch>::CastOrUnbox(static_cast<WrapPanel*>(this)->GetValue(s_ItemsStretchProperty));
159159
}
160160

161-
void WrapPanelProperties::Padding(winrt::Thickness const& value)
161+
void WrapPanelProperties::LineSpacing(double value)
162162
{
163163
[[gsl::suppress(con)]]
164164
{
165-
static_cast<WrapPanel*>(this)->SetValue(s_PaddingProperty, ValueHelper<winrt::Thickness>::BoxValueIfNecessary(value));
165+
static_cast<WrapPanel*>(this)->SetValue(s_LineSpacingProperty, ValueHelper<double>::BoxValueIfNecessary(value));
166166
}
167167
}
168168

169-
winrt::Thickness WrapPanelProperties::Padding()
169+
double WrapPanelProperties::LineSpacing()
170170
{
171-
return ValueHelper<winrt::Thickness>::CastOrUnbox(static_cast<WrapPanel*>(this)->GetValue(s_PaddingProperty));
171+
return ValueHelper<double>::CastOrUnbox(static_cast<WrapPanel*>(this)->GetValue(s_LineSpacingProperty));
172172
}
173173

174-
void WrapPanelProperties::StretchChild(winrt::StretchChild const& value)
174+
void WrapPanelProperties::Orientation(winrt::Orientation const& value)
175175
{
176176
[[gsl::suppress(con)]]
177177
{
178-
static_cast<WrapPanel*>(this)->SetValue(s_StretchChildProperty, ValueHelper<winrt::StretchChild>::BoxValueIfNecessary(value));
178+
static_cast<WrapPanel*>(this)->SetValue(s_OrientationProperty, ValueHelper<winrt::Orientation>::BoxValueIfNecessary(value));
179179
}
180180
}
181181

182-
winrt::StretchChild WrapPanelProperties::StretchChild()
182+
winrt::Orientation WrapPanelProperties::Orientation()
183183
{
184-
return ValueHelper<winrt::StretchChild>::CastOrUnbox(static_cast<WrapPanel*>(this)->GetValue(s_StretchChildProperty));
184+
return ValueHelper<winrt::Orientation>::CastOrUnbox(static_cast<WrapPanel*>(this)->GetValue(s_OrientationProperty));
185185
}
186186

187-
void WrapPanelProperties::VerticalSpacing(double value)
187+
void WrapPanelProperties::Padding(winrt::Thickness const& value)
188188
{
189189
[[gsl::suppress(con)]]
190190
{
191-
static_cast<WrapPanel*>(this)->SetValue(s_VerticalSpacingProperty, ValueHelper<double>::BoxValueIfNecessary(value));
191+
static_cast<WrapPanel*>(this)->SetValue(s_PaddingProperty, ValueHelper<winrt::Thickness>::BoxValueIfNecessary(value));
192192
}
193193
}
194194

195-
double WrapPanelProperties::VerticalSpacing()
195+
winrt::Thickness WrapPanelProperties::Padding()
196196
{
197-
return ValueHelper<double>::CastOrUnbox(static_cast<WrapPanel*>(this)->GetValue(s_VerticalSpacingProperty));
197+
return ValueHelper<winrt::Thickness>::CastOrUnbox(static_cast<WrapPanel*>(this)->GetValue(s_PaddingProperty));
198198
}

src/controls/dev/Generated/WrapPanel.properties.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,53 +9,53 @@ class WrapPanelProperties
99
public:
1010
WrapPanelProperties();
1111

12-
void HorizontalSpacing(double value);
13-
double HorizontalSpacing();
12+
void ItemSpacing(double value);
13+
double ItemSpacing();
14+
15+
void ItemsStretch(winrt::WrapPanelItemsStretch const& value);
16+
winrt::WrapPanelItemsStretch ItemsStretch();
17+
18+
void LineSpacing(double value);
19+
double LineSpacing();
1420

1521
void Orientation(winrt::Orientation const& value);
1622
winrt::Orientation Orientation();
1723

1824
void Padding(winrt::Thickness const& value);
1925
winrt::Thickness Padding();
2026

21-
void StretchChild(winrt::StretchChild const& value);
22-
winrt::StretchChild StretchChild();
23-
24-
void VerticalSpacing(double value);
25-
double VerticalSpacing();
26-
27-
static winrt::DependencyProperty HorizontalSpacingProperty() { return s_HorizontalSpacingProperty; }
27+
static winrt::DependencyProperty ItemSpacingProperty() { return s_ItemSpacingProperty; }
28+
static winrt::DependencyProperty ItemsStretchProperty() { return s_ItemsStretchProperty; }
29+
static winrt::DependencyProperty LineSpacingProperty() { return s_LineSpacingProperty; }
2830
static winrt::DependencyProperty OrientationProperty() { return s_OrientationProperty; }
2931
static winrt::DependencyProperty PaddingProperty() { return s_PaddingProperty; }
30-
static winrt::DependencyProperty StretchChildProperty() { return s_StretchChildProperty; }
31-
static winrt::DependencyProperty VerticalSpacingProperty() { return s_VerticalSpacingProperty; }
3232

33-
static GlobalDependencyProperty s_HorizontalSpacingProperty;
33+
static GlobalDependencyProperty s_ItemSpacingProperty;
34+
static GlobalDependencyProperty s_ItemsStretchProperty;
35+
static GlobalDependencyProperty s_LineSpacingProperty;
3436
static GlobalDependencyProperty s_OrientationProperty;
3537
static GlobalDependencyProperty s_PaddingProperty;
36-
static GlobalDependencyProperty s_StretchChildProperty;
37-
static GlobalDependencyProperty s_VerticalSpacingProperty;
3838

3939
static void EnsureProperties();
4040
static void ClearProperties();
4141

42-
static void OnHorizontalSpacingPropertyChanged(
42+
static void OnItemSpacingPropertyChanged(
4343
winrt::DependencyObject const& sender,
4444
winrt::DependencyPropertyChangedEventArgs const& args);
4545

46-
static void OnOrientationPropertyChanged(
46+
static void OnItemsStretchPropertyChanged(
4747
winrt::DependencyObject const& sender,
4848
winrt::DependencyPropertyChangedEventArgs const& args);
4949

50-
static void OnPaddingPropertyChanged(
50+
static void OnLineSpacingPropertyChanged(
5151
winrt::DependencyObject const& sender,
5252
winrt::DependencyPropertyChangedEventArgs const& args);
5353

54-
static void OnStretchChildPropertyChanged(
54+
static void OnOrientationPropertyChanged(
5555
winrt::DependencyObject const& sender,
5656
winrt::DependencyPropertyChangedEventArgs const& args);
5757

58-
static void OnVerticalSpacingPropertyChanged(
58+
static void OnPaddingPropertyChanged(
5959
winrt::DependencyObject const& sender,
6060
winrt::DependencyPropertyChangedEventArgs const& args);
6161
};

0 commit comments

Comments
 (0)