File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
src/Avalonia.Diagnostics/Diagnostics/ViewModels Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,28 @@ public ControlLayoutViewModel(IVisual control)
30
30
31
31
if ( control is AvaloniaObject ao )
32
32
{
33
- MarginThickness = ao . GetValue ( Layoutable . MarginProperty ) ;
34
-
35
- if ( HasPadding )
33
+ try
36
34
{
37
- PaddingThickness = ao . GetValue ( Decorator . PaddingProperty ) ;
38
- }
35
+ _updatingFromControl = true ;
36
+ MarginThickness = ao . GetValue ( Layoutable . MarginProperty ) ;
37
+
38
+ if ( HasPadding )
39
+ {
40
+ PaddingThickness = ao . GetValue ( Decorator . PaddingProperty ) ;
41
+ }
39
42
40
- if ( HasBorder )
43
+ if ( HasBorder )
44
+ {
45
+ BorderThickness = ao . GetValue ( Border . BorderThicknessProperty ) ;
46
+ }
47
+
48
+ HorizontalAlignment = ao . GetValue ( Layoutable . HorizontalAlignmentProperty ) ;
49
+ VerticalAlignment = ao . GetValue ( Layoutable . VerticalAlignmentProperty ) ;
50
+ }
51
+ finally
41
52
{
42
- BorderThickness = ao . GetValue ( Border . BorderThicknessProperty ) ;
53
+ _updatingFromControl = false ;
43
54
}
44
-
45
- HorizontalAlignment = ao . GetValue ( Layoutable . HorizontalAlignmentProperty ) ;
46
- VerticalAlignment = ao . GetValue ( Layoutable . VerticalAlignmentProperty ) ;
47
55
}
48
56
49
57
UpdateSize ( ) ;
You can’t perform that action at this time.
0 commit comments