Dreamine.Hybrid.Wpf 1.0.3
`AddDreamineHybridWpf()` 내부에서 `AddWpfBlazorWebView()` 호출 및
로딩중...
검색중...
일치하는것 없음
DesignTimeGuard.cs
이 파일의 문서화 페이지로 가기
1using System;
2using System.ComponentModel;
3using System.Windows;
4
6{
15 public static class DesignTimeGuard
16 {
25 private static readonly bool _isInDesignMode = DetectDesignMode();
26
35 public static bool IsInDesignMode => _isInDesignMode;
36
53 private static bool DetectDesignMode()
54 {
55 try
56 {
57 if (Application.Current?.Dispatcher is { } dispatcher &&
58 !dispatcher.CheckAccess())
59 {
60 return false;
61 }
62
63 return DesignerProperties.GetIsInDesignMode(new DependencyObject());
64 }
65 catch (InvalidOperationException)
66 {
67 return false;
68 }
69 }
70 }
71}