-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Owner optional. Rename IWindow to IView.
- Loading branch information
1 parent
16a0ebe
commit 71d78da
Showing
95 changed files
with
889 additions
and
717 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
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
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
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
33 changes: 27 additions & 6 deletions
33
samples/Avalonia/Demo.ModalCustomDialog/AddTextCustomDialog.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 |
---|---|---|
@@ -1,35 +1,56 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using System.Threading.Tasks; | ||
using HanumanInstitute.MvvmDialogs; | ||
using HanumanInstitute.MvvmDialogs.Avalonia; | ||
|
||
namespace Demo.ModalCustomDialog; | ||
|
||
public class AddTextCustomDialog : IWindow | ||
public class AddTextCustomDialog : IView | ||
{ | ||
public object RefObj => this; | ||
|
||
private readonly AddTextDialog dialog = new(); | ||
|
||
event EventHandler IWindow.Closed | ||
event EventHandler IView.Loaded | ||
{ | ||
add => dialog.Opened += value; | ||
remove => dialog.Opened -= value; | ||
} | ||
|
||
event EventHandler IView.Closed | ||
{ | ||
add => dialog.Closed += value; | ||
remove => dialog.Closed -= value; | ||
} | ||
|
||
object? IWindow.DataContext | ||
event EventHandler<CancelEventArgs> IView.Closing | ||
{ | ||
add => dialog.Closing += value; | ||
remove => dialog.Closing -= value; | ||
} | ||
|
||
object? IView.DataContext | ||
{ | ||
get => dialog.DataContext; | ||
set => dialog.DataContext = value; | ||
} | ||
|
||
public IWindow? Owner { get; set; } | ||
public IView? Owner { get; set; } | ||
|
||
Task<bool?> IWindow.ShowDialogAsync() => dialog.ShowDialog<bool?>(Owner.AsWrapper()!.Ref); | ||
Task<bool?> IView.ShowDialogAsync() => dialog.ShowDialog<bool?>(Owner.AsWrapper()!.Ref); | ||
|
||
void IWindow.Show() => dialog.Show(); | ||
void IView.Show() => dialog.Show(); | ||
|
||
public void Activate() => dialog.Activate(); | ||
|
||
public void Close() => dialog.Close(); | ||
|
||
public bool IsEnabled | ||
{ | ||
get => dialog.IsEnabled; | ||
set => dialog.IsEnabled = value; | ||
} | ||
|
||
public bool ClosingConfirmed { get; set; } | ||
} |
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
Oops, something went wrong.