mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
optimize<*>: use custom view locator instead of ContentControl.DataTemplates to avoid memory leak.
This commit is contained in:
parent
27d4dd5f64
commit
60e664ab26
9 changed files with 77 additions and 62 deletions
|
@ -2,7 +2,6 @@ using Avalonia.Controls;
|
|||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.VisualTree;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SourceGit.Views {
|
||||
|
@ -11,18 +10,6 @@ namespace SourceGit.Views {
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnUnloaded(RoutedEventArgs e) {
|
||||
var vm = DataContext as ViewModels.WorkingCopy;
|
||||
vm.SelectedStagedChange = null;
|
||||
vm.SelectedStagedTreeNode = null;
|
||||
vm.SelectedUnstagedChange = null;
|
||||
vm.SelectedUnstagedTreeNode = null;
|
||||
vm.SetDetail(null, false);
|
||||
|
||||
base.OnUnloaded(e);
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
private void ViewAssumeUnchanged(object sender, RoutedEventArgs e) {
|
||||
var repoPage = this.FindAncestorOfType<Repository>();
|
||||
if (repoPage != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue