optimiz<Dashboard>: refresh repository information only when switching to tabs

This commit is contained in:
Jai 2021-07-23 13:54:35 +08:00
parent 650b79a295
commit 932db894a5

View file

@ -55,13 +55,6 @@ namespace SourceGit.Views.Widgets {
InitializeComponent(); InitializeComponent();
InitPages(); InitPages();
UpdateBraches();
UpdateWorkingCopy();
UpdateStashes();
UpdateTags();
UpdateSubmodules();
UpdateSubTrees();
var watcher = Models.Watcher.Get(repo.Path); var watcher = Models.Watcher.Get(repo.Path);
watcher.Navigate += NavigateTo; watcher.Navigate += NavigateTo;
watcher.BranchChanged += UpdateBraches; watcher.BranchChanged += UpdateBraches;
@ -79,6 +72,12 @@ namespace SourceGit.Views.Widgets {
tagList.ItemsSource = new List<Models.Tag>(); tagList.ItemsSource = new List<Models.Tag>();
submoduleList.ItemsSource = new List<string>(); submoduleList.ItemsSource = new List<string>();
}; };
void FirstShowHandler(object _, DependencyPropertyChangedEventArgs __) {
IsVisibleChanged -= FirstShowHandler;
Refresh();
}
IsVisibleChanged += FirstShowHandler;
} }
#region POPUP #region POPUP