-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from Freeesia/feature/partial
自動生成される`PresentationService` を部分クラスに変更
- Loading branch information
Showing
8 changed files
with
60 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
Sample/SampleBrowser/SampleBrowser.ViewModel/PresentationService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Kamishibai; | ||
|
||
namespace SampleBrowser.ViewModel; | ||
|
||
partial interface IPresentationService | ||
{ | ||
Task<IWindow> OpenSingletonWindowWithArgumentsWindowAsync(string windowName, object? owner = null, OpenWindowOptions? options = null); | ||
} | ||
|
||
|
||
partial class PresentationService | ||
{ | ||
private IWindow? singletonWindow; | ||
|
||
public async Task<IWindow> OpenSingletonWindowWithArgumentsWindowAsync(string windowName, object? owner = null, OpenWindowOptions? options = null) | ||
{ | ||
if (this.singletonWindow is null || this.singletonWindow.IsClosed) | ||
{ | ||
return this.singletonWindow = await OpenWindowWithArgumentsWindowAsync(windowName, owner, options); | ||
} | ||
this.singletonWindow.Activate(); | ||
return this.singletonWindow; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters