SampleSmart 1.0.0.0
SampleSmart 사용 방법을 보여 주는 예제 프로젝트입니다.
로딩중...
검색중...
일치하는것 없음
PopupMonitor.xaml.ViewModel.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.MVVM.Attributes;
2using Dreamine.MVVM.Interfaces.Windows;
3using Dreamine.MVVM.ViewModels;
5using System.Text;
6
8{
17 public partial class PopupMonitorViewModel : ViewModelBase
18 {
27 private readonly IWindowStateService _windowStateService;
28
37 [DreamineModel]
39
48 [DreamineEvent]
50
59 [DreamineProperty]
60 private string _windowStateSummary = string.Empty;
61
78 public PopupMonitorViewModel(IWindowStateService windowStateService)
79 {
80 _model = null!;
81 _event = null!;
82
83 _windowStateService = windowStateService;
84 _windowStateService.StateChanged += OnWindowStateChanged;
85
87 }
88
97 [DreamineCommand("Event.Refresh")]
98 private partial void Refresh();
99
124 private void OnWindowStateChanged(object? sender, WindowStateChangedEventArgs e)
125 {
127 }
128
137 private void RefreshSummary()
138 {
139 StringBuilder builder = new();
140
145
146 WindowStateSummary = builder.ToString();
147 }
148
173 private void AppendState(StringBuilder builder, string windowKey)
174 {
175 string state = _windowStateService.IsOpen(windowKey)
176 ? "OPEN"
177 : "CLOSED";
178
179 builder.AppendLine($"{windowKey} : {state}");
180 }
181 }
182}
void AppendState(StringBuilder builder, string windowKey)
PopupMonitorViewModel(IWindowStateService windowStateService)
void OnWindowStateChanged(object? sender, WindowStateChangedEventArgs e)