@@ -13,18 +13,6 @@ namespace Fluent;
13
13
/// </summary>
14
14
public class RibbonGroupBoxWrapPanel : Panel
15
15
{
16
- private const Orientation DefaultOrientation = Orientation . Vertical ;
17
-
18
- private Orientation orientation ;
19
-
20
- /// <summary>
21
- /// Creates a new instance.
22
- /// </summary>
23
- public RibbonGroupBoxWrapPanel ( )
24
- {
25
- this . orientation = DefaultOrientation ;
26
- }
27
-
28
16
/// <summary>
29
17
/// Attached <see cref="DependencyProperty"/> for <c>SharedSizeGroupName</c>.
30
18
/// </summary>
@@ -155,7 +143,7 @@ public double ItemHeight
155
143
public static readonly DependencyProperty OrientationProperty =
156
144
StackPanel . OrientationProperty . AddOwner (
157
145
typeof ( RibbonGroupBoxWrapPanel ) ,
158
- new FrameworkPropertyMetadata ( Orientation . Horizontal ,
146
+ new FrameworkPropertyMetadata ( Orientation . Vertical ,
159
147
FrameworkPropertyMetadataOptions . AffectsMeasure ,
160
148
OnOrientationChanged ) ) ;
161
149
@@ -168,17 +156,20 @@ public double ItemHeight
168
156
/// </summary>
169
157
public Orientation Orientation
170
158
{
171
- get { return this . orientation ; }
159
+ get { return ( Orientation ) this . GetValue ( OrientationProperty ) ; }
172
160
set { this . SetValue ( OrientationProperty , value ) ; }
173
161
}
174
162
175
- /// <summary>
176
- /// <see cref="PropertyMetadata.PropertyChangedCallback"/>
177
- /// </summary>
178
163
private static void OnOrientationChanged ( DependencyObject d , DependencyPropertyChangedEventArgs e )
179
164
{
180
- var p = ( RibbonGroupBoxWrapPanel ) d ;
181
- p . orientation = ( Orientation ) e . NewValue ;
165
+ var control = ( RibbonGroupBoxWrapPanel ) d ;
166
+
167
+ if ( control . IsLoaded is false )
168
+ {
169
+ return ;
170
+ }
171
+
172
+ UIHelper . GetParent < RibbonGroupBox > ( control ) ? . TryClearCacheAndResetStateAndScaleAndNotifyParentRibbonGroupsContainer ( ) ;
182
173
}
183
174
184
175
private struct UvSize
0 commit comments