File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,19 +114,23 @@ public HistoriesCommitList()
114114 VerticalScrollBarVisibility = ScrollBarVisibility . Auto ;
115115 }
116116
117- protected override void OnLoaded ( RoutedEventArgs e )
118- {
119- base . OnLoaded ( e ) ;
120- ApplySelection ( ) ;
121- UpdateLayout ( ) ;
122- }
123-
124117 protected override void OnPropertyChanged ( AvaloniaPropertyChangedEventArgs change )
125118 {
126119 base . OnPropertyChanged ( change ) ;
127120
128121 if ( change . Property == SelectedCommitsProperty && IsLoaded && ! _ignoreSelectionChanged )
129- ApplySelection ( ) ;
122+ {
123+ _ignoreSelectionChanged = true ;
124+
125+ SelectedItems . Clear ( ) ;
126+ if ( SelectedCommits is { Count : > 0 } )
127+ {
128+ foreach ( var c in SelectedCommits )
129+ SelectedItems . Add ( c ) ;
130+ }
131+
132+ _ignoreSelectionChanged = false ;
133+ }
130134 }
131135
132136 protected override void OnSelectionChanged ( SelectionChangedEventArgs e )
@@ -176,20 +180,6 @@ protected override void OnSelectionChanged(SelectionChangedEventArgs e)
176180 }
177181 }
178182
179- private void ApplySelection ( )
180- {
181- _ignoreSelectionChanged = true ;
182-
183- SelectedItems . Clear ( ) ;
184- if ( SelectedCommits is { Count : > 0 } )
185- {
186- foreach ( var c in SelectedCommits )
187- SelectedItems . Add ( c ) ;
188- }
189-
190- _ignoreSelectionChanged = false ;
191- }
192-
193183 private bool _ignoreSelectionChanged = false ;
194184 }
195185
You can’t perform that action at this time.
0 commit comments