Dreamine.UI.Wpf.Controls 1.0.1
Dreamine.UI.Wpf.Controls 사용자 인터페이스 기능과 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher 클래스 참조

더 자세히 ...

Public 멤버 함수

 ViewSwitcher (IReadOnlyDictionary< string, Window > popupWindows, Dictionary< string, FrameworkElement > views, bool useSingletonView)
bool IsPopupName (string viewName)
void Switch (string viewName, bool popupChange)

정적 Public 멤버 함수

static void RegisterViewModel (string viewName, object vm)
static void NotifyShown (string viewName)
static void NotifyHidden (string viewName)

속성

static string CurrentPopupName [get]

Private 속성

readonly IReadOnlyDictionary< string, Window > _popupWindows
readonly Dictionary< string, FrameworkElement > _views
readonly bool _useSingleton

정적 Private 속성

static string _popupName = null!
static readonly Dictionary< string, object > _viewModelRegistry = new()

상세한 설명

등록된 싱글턴 View와 팝업 창을 이름으로 전환하고 ViewModel 수명 주기를 알립니다.

ViewSwitcher.cs 파일의 19 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ ViewSwitcher()

Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher.ViewSwitcher ( IReadOnlyDictionary< string, Window > popupWindows,
Dictionary< string, FrameworkElement > views,
bool useSingletonView )
inline

팝업과 View 저장소 및 싱글턴 모드 설정으로 전환기를 만듭니다.

매개변수
popupWindows이름별 팝업 창 저장소입니다.
views이름별 일반 View 저장소입니다.
useSingletonView싱글턴 View 모드 사용 여부입니다.
예외
ArgumentNullExceptionpopupWindows 또는 views 가 null이면 발생합니다.

ViewSwitcher.cs 파일의 89 번째 라인에서 정의되었습니다.

93 {
94 _popupWindows = popupWindows ?? throw new ArgumentNullException(nameof(popupWindows));
95 _views = views ?? throw new ArgumentNullException(nameof(views));
96 _useSingleton = useSingletonView;
97 }

다음을 참조함 : _popupWindows, _useSingleton, _views.

멤버 함수 문서화

◆ IsPopupName()

bool Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher.IsPopupName ( string viewName)
inline

지정한 이름이 팝업 창으로 등록되어 있는지 확인합니다.

매개변수
viewName확인할 View 이름입니다.
반환값
팝업 이름으로 등록되어 있으면 true입니다.

ViewSwitcher.cs 파일의 123 번째 라인에서 정의되었습니다.

124 {
125 if (string.IsNullOrWhiteSpace(viewName)) return false;
126 return _popupWindows.ContainsKey(viewName);
127 }

다음을 참조함 : _popupWindows.

다음에 의해서 참조됨 : Switch().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ NotifyHidden()

void Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher.NotifyHidden ( string viewName)
inlinestatic

등록된 ViewModel에 숨김 및 비활성화 수명 주기 알림을 전달합니다.

매개변수
viewName알림을 받을 View 이름입니다.
예외
ArgumentNullExceptionviewName 이 null이면 발생합니다.

ViewSwitcher.cs 파일의 331 번째 라인에서 정의되었습니다.

332 {
333 if (!_viewModelRegistry.TryGetValue(viewName, out var vm)) return;
334 if (vm is IVisibilityAware vis) vis.OnHidden();
335 if (vm is IActivatable act) act.Deactivate();
336 }

다음을 참조함 : _viewModelRegistry.

다음에 의해서 참조됨 : Dreamine.UI.Wpf.Controls.ViewRegion.PopupWindowManager.CreatePopup(), Switch().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ NotifyShown()

void Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher.NotifyShown ( string viewName)
inlinestatic

등록된 ViewModel에 활성화 및 표시됨 수명 주기 알림을 전달합니다.

매개변수
viewName알림을 받을 View 이름입니다.
예외
ArgumentNullExceptionviewName 이 null이면 발생합니다.

ViewSwitcher.cs 파일의 300 번째 라인에서 정의되었습니다.

301 {
302 if (!_viewModelRegistry.TryGetValue(viewName, out var vm)) return;
303 if (vm is IActivatable act) act.Activate();
304 if (vm is IVisibilityAware vis) vis.OnShown();
305 }

다음을 참조함 : _viewModelRegistry.

다음에 의해서 참조됨 : Dreamine.UI.Wpf.Controls.ViewRegion.PopupWindowManager.CreatePopup(), Switch().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ RegisterViewModel()

void Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher.RegisterViewModel ( string viewName,
object vm )
inlinestatic

View 이름에 ViewModel 인스턴스를 등록하거나 교체합니다.

매개변수
viewNameView 이름입니다.
vm연결할 ViewModel입니다.
예외
ArgumentNullExceptionviewName 이 null이면 발생합니다.

ViewSwitcher.cs 파일의 273 번째 라인에서 정의되었습니다.

274 => _viewModelRegistry[viewName] = vm;

다음을 참조함 : _viewModelRegistry.

◆ Switch()

void Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher.Switch ( string viewName,
bool popupChange )
inline

등록 이름에 해당하는 팝업을 표시·활성화하거나 일반 View의 가시성을 전환합니다.

매개변수
viewName대상 View 또는 팝업 이름입니다.
popupChange기존 팝업을 유지하려면 true이고, 일반 View 전환 전에 숨기려면 false입니다.

싱글턴 모드가 아니면 아무 작업도 수행하지 않습니다.

예외
InvalidOperationException표시하거나 활성화할 창의 상태가 작업을 허용하지 않으면 WPF에서 발생할 수 있습니다.

ViewSwitcher.cs 파일의 189 번째 라인에서 정의되었습니다.

190 {
191 if (!_useSingleton) return;
192
193 // Popup target
194 if (IsPopupName(viewName))
195 {
196 var popup = _popupWindows[viewName];
197
198 //var vm = DMContainer.Resolve(vmType);
199 if (!popup.IsVisible)
200 {
201 NotifyShown(viewName);
202 _popupName = viewName;
203 popup.Show();
204 }
205 popup.Activate();
206 return;
207 }
208
209 // View target
210 if (!popupChange)
211 {
212 // CloseAsync popups only when caller indicates a non-popup-change flow.
213 foreach (var dlg in _popupWindows.Values)
214 {
215 if (dlg.IsVisible)
216 {
217 NotifyHidden(_popupName);
218 dlg.Hide();
219 }
220 }
221 }
222
223 foreach (var kv in _views)
224 {
225 kv.Value.Visibility = kv.Key == viewName
226 ? Visibility.Visible
227 : Visibility.Hidden;
228 }
229 }

다음을 참조함 : _popupName, _popupWindows, _useSingleton, _views, IsPopupName(), NotifyHidden(), NotifyShown().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ _popupName

string Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher._popupName = null!
staticprivate

마지막으로 표시한 팝업 이름입니다.

ViewSwitcher.cs 파일의 137 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Switch().

◆ _popupWindows

readonly IReadOnlyDictionary<string, Window> Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher._popupWindows
private

이름별 팝업 창 저장소입니다.

ViewSwitcher.cs 파일의 29 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : IsPopupName(), Switch(), ViewSwitcher().

◆ _useSingleton

readonly bool Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher._useSingleton
private

싱글턴 View 전환을 사용할지 나타냅니다.

ViewSwitcher.cs 파일의 47 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Switch(), ViewSwitcher().

◆ _viewModelRegistry

readonly Dictionary<string, object> Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher._viewModelRegistry = new()
staticprivate

View 이름별 ViewModel 저장소입니다.

ViewSwitcher.cs 파일의 239 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : NotifyHidden(), NotifyShown(), RegisterViewModel().

◆ _views

readonly Dictionary<string, FrameworkElement> Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher._views
private

이름별 일반 View 저장소입니다.

ViewSwitcher.cs 파일의 38 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Switch(), ViewSwitcher().

속성 문서화

◆ CurrentPopupName

string Dreamine.UI.Wpf.Controls.ViewRegion.ViewSwitcher.CurrentPopupName
staticget

마지막으로 표시한 팝업 이름을 가져옵니다.

ViewSwitcher.cs 파일의 147 번째 라인에서 정의되었습니다.


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: