1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using System.Collections.Generic;
- using MsBox.Avalonia;
- using MsBox.Avalonia.Enums;
- using ReactiveUI;
- namespace AvaloniaApplication10.ViewModels
- {
- public class Page1ViewModel : ReactiveObject
- {
- string _message = "Äîáðî ïîæàëîâàòü";
- public string Message
- {
- get => _message;
- set => this.RaiseAndSetIfChanged(ref _message, value);
- }
- // âûçîâ ðàçëè÷íûõ äèàëîãîâûõ îêîí
- public async void changeMessage()
- {
- Message = "Ïðèâåò, ìèð";
- ButtonResult result = await MessageBoxManager.GetMessageBoxStandard("Îêíî ïîêàçà ñîîáùåíèÿ","Ìû íàæàëè íà êíîïêó",ButtonEnum.YesNo).ShowAsync();
- switch(result)
- {
- case ButtonResult.Yes:
- {
- await MessageBoxManager.GetMessageBoxStandard("Îêíî ïîêàçà ñîîáùåíèÿ", "Äà", ButtonEnum.Ok).ShowAsync();
- break;
- }
- case ButtonResult.No:
- {
- await MessageBoxManager.GetMessageBoxStandard("Îêíî ïîêàçà ñîîáùåíèÿ", "íåò", ButtonEnum.Ok).ShowAsync();
- break;
- }
- }
- }
- }
- }
|