Dreamine.MVVM.Wpf 1.0.3
Dreamine.MVVM.Wpf 사용자 인터페이스 기능과 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
WpfDialogService.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.MVVM.Interfaces.Windows;
2using System.Threading.Tasks;
3using System.Windows;
4
5namespace Dreamine.MVVM.Wpf
6{
15 public sealed class WpfDialogService : IDialogService
16 {
41 public void ShowMessage(string message, string title = "")
42 {
43 MessageBox.Show(message, title, MessageBoxButton.OK, MessageBoxImage.Information);
44 }
45
70 public void ShowError(string message, string title = "Error")
71 {
72 MessageBox.Show(message, title, MessageBoxButton.OK, MessageBoxImage.Error);
73 }
74
107 public bool Confirm(string message, string title = "Confirm")
108 {
109 var result = MessageBox.Show(message, title, MessageBoxButton.YesNo, MessageBoxImage.Question);
110 return result == MessageBoxResult.Yes;
111 }
112
145 public Task ShowMessageAsync(string message, string title = "")
146 {
147 ShowMessage(message, title);
148 return Task.CompletedTask;
149 }
150
183 public Task<bool> ConfirmAsync(string message, string title = "Confirm")
184 {
185 return Task.FromResult(Confirm(message, title));
186 }
187 }
188}
void ShowMessage(string message, string title="")
bool Confirm(string message, string title="Confirm")
void ShowError(string message, string title="Error")
Task ShowMessageAsync(string message, string title="")
Task< bool > ConfirmAsync(string message, string title="Confirm")