File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ namespace SourceGit.Views
1212 public class HistoriesLayout : Grid
1313 {
1414 public static readonly StyledProperty < bool > UseHorizontalProperty =
15- AvaloniaProperty . Register < HistoriesLayout , bool > ( nameof ( UseHorizontal ) ) ;
15+ AvaloniaProperty . Register < HistoriesLayout , bool > ( nameof ( UseHorizontal ) , false ) ;
1616
1717 public bool UseHorizontal
1818 {
@@ -22,19 +22,20 @@ public bool UseHorizontal
2222
2323 protected override Type StyleKeyOverride => typeof ( Grid ) ;
2424
25- public HistoriesLayout ( )
26- {
27- RefreshLayout ( ) ;
28- }
29-
3025 protected override void OnPropertyChanged ( AvaloniaPropertyChangedEventArgs change )
3126 {
3227 base . OnPropertyChanged ( change ) ;
3328
34- if ( change . Property == UseHorizontalProperty )
29+ if ( change . Property == UseHorizontalProperty && IsLoaded )
3530 RefreshLayout ( ) ;
3631 }
3732
33+ protected override void OnAttachedToVisualTree ( VisualTreeAttachmentEventArgs e )
34+ {
35+ base . OnAttachedToVisualTree ( e ) ;
36+ RefreshLayout ( ) ;
37+ }
38+
3839 private void RefreshLayout ( )
3940 {
4041 if ( UseHorizontal )
You can’t perform that action at this time.
0 commit comments