Skip to content

Commit 6b9ba59

Browse files
committed
refactor: move context menu creation from ViewModels to Views (PART 10)
Signed-off-by: leo <longshuang@msn.cn>
1 parent c08f158 commit 6b9ba59

10 files changed

+1161
-1155
lines changed

src/App.axaml.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
using Avalonia.Markup.Xaml;
1818
using Avalonia.Media;
1919
using Avalonia.Media.Fonts;
20-
using Avalonia.Platform.Storage;
2120
using Avalonia.Styling;
2221
using Avalonia.Threading;
2322

@@ -344,14 +343,6 @@ public static Avalonia.Controls.Shapes.Path CreateMenuIcon(string key)
344343
return icon;
345344
}
346345

347-
public static IStorageProvider GetStorageProvider()
348-
{
349-
if (Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
350-
return desktop.MainWindow?.StorageProvider;
351-
352-
return null;
353-
}
354-
355346
public static ViewModels.Launcher GetLauncher()
356347
{
357348
return Current is App app ? app._launcher : null;

src/ViewModels/Conflict.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Threading.Tasks;
23

34
namespace SourceGit.ViewModels
45
{
@@ -101,19 +102,19 @@ public Conflict(Repository repo, WorkingCopy wc, Models.Change change)
101102
}
102103
}
103104

104-
public void UseTheirs()
105+
public async Task UseTheirsAsync()
105106
{
106-
_wc.UseTheirs([_change]);
107+
await _wc.UseTheirsAsync([_change]);
107108
}
108109

109-
public void UseMine()
110+
public async Task UseMineAsync()
110111
{
111-
_wc.UseMine([_change]);
112+
await _wc.UseMineAsync([_change]);
112113
}
113114

114-
public async void OpenExternalMergeTool()
115+
public async Task OpenExternalMergeToolAsync()
115116
{
116-
await _wc.UseExternalMergeTool(_change);
117+
await _wc.UseExternalMergeToolAsync(_change);
117118
}
118119

119120
private WorkingCopy _wc = null;

0 commit comments

Comments
 (0)