SampleSmart
1.0.0.0
SampleSmart 사용 방법을 보여 주는 예제 프로젝트입니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
PageSub.xaml.ViewModel.cs
이 파일의 문서화 페이지로 가기
1
using
Dreamine.MVVM.Attributes;
2
using
Dreamine.MVVM.Interfaces.Windows;
3
using
Dreamine.MVVM.ViewModels;
4
using
SampleSmart.Constants
;
5
6
namespace
SampleSmart.Pages.PageSub
7
{
16
public
partial class
PageSubViewModel
: ViewModelBase
17
{
26
private
readonly IWindowStateService
_windowStateService
;
27
36
[DreamineModel]
37
private
PageSubModel
_model
;
38
47
[DreamineEvent]
48
private
PageSubEvent
_event
;
49
58
[DreamineProperty]
59
private
string
_message
=
string
.Empty;
60
69
[DreamineProperty]
70
private
bool
_isWindowSubOpen
;
71
88
public
PageSubViewModel
(IWindowStateService windowStateService)
89
{
90
_model
=
null
!;
91
_event
=
null
!;
92
93
_windowStateService
= windowStateService;
94
95
Message = Model.Message;
96
97
IsWindowSubOpen =
_windowStateService
.IsOpen(
ViewKeys
.
WindowSub
);
98
ApplyWindowSubMessage
(IsWindowSubOpen);
99
100
_windowStateService.StateChanged +=
OnWindowStateChanged
;
101
}
102
111
[DreamineCommand(
"Event.Ok"
)]
112
private
partial
void
Ok
();
113
122
[DreamineCommand(
"Event.Cancel"
)]
123
private
partial
void
Cancel
();
124
149
private
void
OnWindowStateChanged
(
object
? sender, WindowStateChangedEventArgs e)
150
{
151
if
(e.WindowKey !=
ViewKeys
.
WindowSub
)
152
{
153
return
;
154
}
155
156
IsWindowSubOpen = e.IsOpen;
157
ApplyWindowSubMessage
(e.IsOpen);
158
}
159
176
private
void
ApplyWindowSubMessage
(
bool
isOpen)
177
{
178
Message = isOpen
179
?
"WindowSub 창이 열려 있습니다."
180
:
"WindowSub 창이 닫혔습니다."
;
181
}
182
}
183
}
SampleSmart.Constants
Definition
ViewKeys.cs:2
SampleSmart.Pages.PageSub
Definition
CommunicationSampleRuntime.cs:21
SampleSmart.Constants.ViewKeys
Definition
ViewKeys.cs:12
SampleSmart.Constants.ViewKeys.WindowSub
const string WindowSub
Definition
ViewKeys.cs:21
SampleSmart.Pages.PageSub.PageSubEvent
Definition
PageSub.xaml.Event.cs:14
SampleSmart.Pages.PageSub.PageSubModel
Definition
PageSub.xaml.Model.cs:14
SampleSmart.Pages.PageSub.PageSubViewModel._message
string _message
Definition
PageSub.xaml.ViewModel.cs:59
SampleSmart.Pages.PageSub.PageSubViewModel._model
PageSubModel _model
Definition
PageSub.xaml.ViewModel.cs:37
SampleSmart.Pages.PageSub.PageSubViewModel.OnWindowStateChanged
void OnWindowStateChanged(object? sender, WindowStateChangedEventArgs e)
Definition
PageSub.xaml.ViewModel.cs:149
SampleSmart.Pages.PageSub.PageSubViewModel.ApplyWindowSubMessage
void ApplyWindowSubMessage(bool isOpen)
Definition
PageSub.xaml.ViewModel.cs:176
SampleSmart.Pages.PageSub.PageSubViewModel.Ok
partial void Ok()
SampleSmart.Pages.PageSub.PageSubViewModel._isWindowSubOpen
bool _isWindowSubOpen
Definition
PageSub.xaml.ViewModel.cs:70
SampleSmart.Pages.PageSub.PageSubViewModel._windowStateService
readonly IWindowStateService _windowStateService
Definition
PageSub.xaml.ViewModel.cs:26
SampleSmart.Pages.PageSub.PageSubViewModel.PageSubViewModel
PageSubViewModel(IWindowStateService windowStateService)
Definition
PageSub.xaml.ViewModel.cs:88
SampleSmart.Pages.PageSub.PageSubViewModel._event
PageSubEvent _event
Definition
PageSub.xaml.ViewModel.cs:48
SampleSmart.Pages.PageSub.PageSubViewModel.Cancel
partial void Cancel()
Pages
PageSub
PageSub.xaml.ViewModel.cs
다음에 의해 생성됨 :
1.17.0