How could I close a Interactive Dialog when clicking outside #1272
-
It seem that there's no the feature to close when lost focus.
|
Beta Was this translation helpful? Give feedback.
Answered by
NaBian
Nov 8, 2022
Replies: 2 comments
-
@dungtran2265 public class HowToUseDialogViewModel : IDialogResultable<string>
{
public HowToUseDialogViewModel()
{
CloseCommand = new()
{
ExecuteAction = new Action<object>(Close)
};
}
public Action CloseAction { get; set; }
private string _Result;
public string Result
{
get { return _Result; }
set
{
_Result = value;
this.RaisePropertyChanged(nameof(Result));
}
}
private string _Message;
public string Message
{
get { return _Message; }
set
{
_Message = value;
this.RaisePropertyChanged(nameof(Message));
}
}
public DelegateCommand CloseCommand { get; set; }
private async void Close(object parameter)
{
try
{
CloseAction?.Invoke();
}
catch (Exception)
{
}
}
} Noted
Hope it works. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
NaBian
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ca5c292