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

더 자세히 ...

Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService에 대한 상속 다이어그램 :
Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService에 대한 협력 다이어그램:

Public 멤버 함수

bool? ShowBlink (Window? owner, BlinkPopupOptions options)
bool? ShowBlink (Window? owner, BlinkPopupOptions options, out Window windowRef)
void CloseAll ()
void Close (Window window)
void CloseOwnedBy (Window owner)
Window? GetActive ()
bool TryGetOptions (Window window, out BlinkPopupOptions? options)
bool TryGetOwnerOptions (Window window, out BlinkPopupOptions? ownerOptions)
void RegisterWindow (Window window, BlinkPopupOptions options)
async Task< bool?> ShowBlinkAsync (Window? owner, BlinkPopupOptions options, TimeSpan? autoCloseAfter=null, CancellationToken cancellationToken=default)

Private 속성

readonly List< Window > _opened = new()
readonly Dictionary< Window, BlinkPopupOptions > _optionsByWindow = new()

상세한 설명

점멸 팝업 창을 표시·추적·종료하고 동기 및 비동기 결과를 제공합니다.

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

멤버 함수 문서화

◆ Close()

void Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService.Close ( Window window)
inline

지정한 창이 추적 중이고 로드되어 있으면 닫습니다.

매개변수
window닫을 창입니다. null은 무시됩니다.

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

213 {
214 if (window == null) return;
215 if (_opened.Contains(window) && window.IsLoaded)
216 window.Close();
217 }

다음을 참조함 : _opened.

◆ CloseAll()

void Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService.CloseAll ( )
inline

추적 중이며 로드된 모든 팝업 창을 닫고 내부 추적 상태를 비웁니다.

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

188 {
189 foreach (var w in _opened.ToList())
190 if (w.IsLoaded) w.Close();
191
192 _opened.Clear();
193 _optionsByWindow.Clear();
194 }

다음을 참조함 : _opened, _optionsByWindow.

◆ CloseOwnedBy()

void Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService.CloseOwnedBy ( Window owner)
inline

지정한 소유 창에 속한 모든 로드된 팝업을 닫습니다.

매개변수
owner자식 팝업을 닫을 소유 창입니다. null은 무시됩니다.

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

236 {
237 if (owner == null) return;
238 var targets = _opened.Where(w => Equals(w.Owner, owner)).ToList();
239 foreach (var w in targets)
240 if (w.IsLoaded) w.Close();
241 }

다음을 참조함 : _opened.

◆ GetActive()

Window? Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService.GetActive ( )
inline

활성 추적 창을 우선하고 없으면 마지막 표시 창을 반환합니다.

반환값
활성 또는 표시 팝업이며 없으면 null입니다.

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

260 => _opened.LastOrDefault(w => w.IsVisible && w.IsActive)
261 ?? _opened.LastOrDefault(w => w.IsVisible);

다음을 참조함 : _opened.

다음에 의해서 참조됨 : ShowBlink(), ShowBlinkAsync().

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

◆ RegisterWindow()

void Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService.RegisterWindow ( Window window,
BlinkPopupOptions options )
inline

외부에서 만든 팝업 창과 옵션을 추적 대상으로 등록하고 닫힘 시 자동 제거합니다.

매개변수
window등록할 팝업 창입니다.
options창에 연결할 팝업 옵션입니다.
예외
ArgumentNullExceptionwindownull일 때 발생합니다.

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

380 {
381 if (window is null)
382 throw new ArgumentNullException(nameof(window));
383
384 // 중복 등록 방지
385 if (_opened.Contains(window))
386 return;
387
388 _opened.Add(window);
389 _optionsByWindow[window] = options;
390
391 window.Closed += (_, __) =>
392 {
393 _opened.Remove(window);
394 _optionsByWindow.Remove(window);
395 };
396 }

다음을 참조함 : _opened, _optionsByWindow.

◆ ShowBlink() [1/2]

bool? Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService.ShowBlink ( Window? owner,
BlinkPopupOptions options )
inline

점멸 팝업을 표시하고 모달이면 결과를 반환합니다.

매개변수
owner선택적 소유 창입니다.
options팝업 표시 옵션입니다.
반환값
모달 결과이며 비모달이면 null입니다.
예외
ArgumentNullExceptionoptionsnull일 때 팝업 생성 중 발생할 수 있습니다.

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

80 => ShowBlink(owner, options, out _);

◆ ShowBlink() [2/2]

bool? Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService.ShowBlink ( Window? owner,
BlinkPopupOptions options,
out Window windowRef )
inline

점멸 팝업을 표시하고 생성된 창 참조와 모달 결과를 반환합니다.

매개변수
owner선택적 소유 창입니다.
options팝업 표시 옵션입니다.
windowRef생성된 팝업 창입니다.
반환값
모달 결과이며 비모달이면 null입니다.
예외
ArgumentNullExceptionoptionsnull일 때 팝업 생성 중 발생할 수 있습니다.

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

131 {
132 var win = new DreamineBlinkPopupWindow(options);
133
134 // Owner 설정
135 if (owner != null)
136 {
137 win.Owner = owner;
138 win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
139 }
140 else
141 {
142 var active = GetActive() ?? Application.Current?.MainWindow;
143 if (active != null)
144 {
145 win.Owner = active;
146 win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
147 }
148 else
149 {
150 win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
151 }
152 }
153
154 // 추적: 창 + 옵션
155 _opened.Add(win);
156 _optionsByWindow[win] = options;
157
158 // 정리: 창 닫힐 때 제거
159 win.Closed += (_, __) =>
160 {
161 _opened.Remove(win);
162 _optionsByWindow.Remove(win);
163 };
164
165 windowRef = win;
166
167 // 표시
168 if (options.IsModal)
169 {
170 return win.ShowDialog();
171 }
172 else
173 {
174 win.Show();
175 return null;
176 }
177 }

다음을 참조함 : _opened, _optionsByWindow, GetActive().

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

◆ ShowBlinkAsync()

async Task< bool?> Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService.ShowBlinkAsync ( Window? owner,
BlinkPopupOptions options,
TimeSpan? autoCloseAfter = null,
CancellationToken cancellationToken = default )
inline

UI 디스패처에서 팝업을 비동기로 표시하고 닫힘, 자동 종료 또는 취소 후 결과를 반환합니다.

매개변수
owner선택적 소유 창입니다.
options팝업 표시 옵션입니다.
autoCloseAfter선택적 자동 종료 지연 시간입니다.
cancellationToken창 닫기를 요청할 취소 토큰입니다.
반환값
확인·취소 결과이며 결과 없이 닫히면 null입니다.
예외
NullReferenceExceptionoptions 또는 현재 WPF 애플리케이션이 없을 때 발생할 수 있습니다.
InvalidOperationException사용할 UI 디스패처가 없을 때 발생합니다.

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

469 {
470 // 모든 UI 조작은 UI 스레드에서
471 var dispatcher = (owner ?? Application.Current?.MainWindow)?.Dispatcher
472 ?? Application.Current!.Dispatcher;
473
474 if (dispatcher == null)
475 throw new InvalidOperationException("Dispatcher not available.");
476
477 var tcs = new TaskCompletionSource<bool?>(TaskCreationOptions.RunContinuationsAsynchronously);
478 Window? win = null;
479 bool wasOwnerEnabled = false;
480
481 await dispatcher.InvokeAsync(() =>
482 {
483 win = new DreamineBlinkPopupWindow(options);
484
485 // Owner 결정
486 if (owner != null)
487 {
488 win.Owner = owner;
489 win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
490 }
491 else
492 {
493 var active = GetActive() ?? Application.Current?.MainWindow;
494 if (active != null)
495 {
496 win.Owner = active;
497 win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
498 }
499 else
500 {
501 win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
502 }
503 }
504
505 // 등록
506 _opened.Add(win);
507 _optionsByWindow[win] = options;
508
509 // 닫힘 시 정리 + 결과 완료
510 win.Closed += (_, __) =>
511 {
512 _opened.Remove(win);
513 _optionsByWindow.Remove(win);
514
515 // 모달 효과 복원
516 if (options.IsModal && win.Owner != null && wasOwnerEnabled)
517 win.Owner.IsEnabled = true;
518
519 // Show()로 열린 경우 DialogResult는 항상 null → PopupResult 사용
520 var result = (win as DreamineBlinkPopupWindow)?.PopupResult
521 ?? (win as Window)?.DialogResult;
522 _ = tcs.TrySetResult(result);
523 };
524
525 // 모달 효과: Owner 잠시 비활성화
526 if (options.IsModal && win.Owner != null)
527 {
528 wasOwnerEnabled = win.Owner.IsEnabled;
529 win.Owner.IsEnabled = false;
530 }
531
532 // 표시(비동기 모달 시뮬레이션: ShowDialog 대신 Show 사용)
533 win.Show();
534
535 // 자동 종료 타이머
536 if (autoCloseAfter is TimeSpan delay && delay > TimeSpan.Zero)
537 {
538 var timer = new DispatcherTimer { Interval = delay };
539 timer.Tick += (s, e) =>
540 {
541 timer.Stop();
542 if (win.IsLoaded) win.Close();
543 };
544 timer.Start();
545 }
546 });
547
548 // 취소 토큰 연동: 취소 시 UI 스레드에서 닫기
549 using (cancellationToken.Register(() =>
550 {
551 if (win != null)
552 {
553 _ = dispatcher.InvokeAsync(() =>
554 {
555 if (win.IsLoaded) win.Close();
556 });
557 }
558 }))
559 {
560 return await tcs.Task.ConfigureAwait(false);
561 }
562 }

다음을 참조함 : _opened, _optionsByWindow, GetActive().

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

◆ TryGetOptions()

bool Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService.TryGetOptions ( Window window,
out BlinkPopupOptions? options )
inline

지정한 추적 창에 연결된 팝업 옵션을 가져오려고 시도합니다.

매개변수
window조회할 창입니다.
options성공 시 연결된 옵션입니다.
반환값
옵션을 찾았으면 true입니다.
예외
ArgumentNullExceptionwindownull일 때 발생합니다.

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

304 {
305 return _optionsByWindow.TryGetValue(window, out options);
306 }

다음을 참조함 : _optionsByWindow.

◆ TryGetOwnerOptions()

bool Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService.TryGetOwnerOptions ( Window window,
out BlinkPopupOptions? ownerOptions )
inline

지정한 창의 소유 창에 연결된 팝업 옵션을 가져오려고 시도합니다.

매개변수
window소유 창을 검사할 창입니다.
ownerOptions성공 시 소유 창의 옵션입니다.
반환값
소유 창과 옵션을 찾았으면 true입니다.

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

341 {
342 ownerOptions = null;
343 if (window?.Owner == null) return false;
344 return _optionsByWindow.TryGetValue(window.Owner, out ownerOptions);
345 }

다음을 참조함 : _optionsByWindow.

멤버 데이터 문서화

◆ _opened

readonly List<Window> Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService._opened = new()
private

현재 서비스가 추적하는 열린 창 목록입니다.

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

다음에 의해서 참조됨 : Close(), CloseAll(), CloseOwnedBy(), GetActive(), RegisterWindow(), ShowBlink(), ShowBlinkAsync().

◆ _optionsByWindow

readonly Dictionary<Window, BlinkPopupOptions> Dreamine.UI.Wpf.Equipment.Popup.DreaminePopupService._optionsByWindow = new()
private

각 추적 창에 사용된 팝업 옵션을 보관합니다.

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

다음에 의해서 참조됨 : CloseAll(), RegisterWindow(), ShowBlink(), ShowBlinkAsync(), TryGetOptions(), TryGetOwnerOptions().


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