如何確定WPF 應用程式中的設計模式狀態
如果您需要一種簡單有效的方法來區分WPF 應用程式中的設計模式和運行時模式WPF 應用程序,請考慮利用全域狀態變數的概念。
使用以下指令檢查設計模式狀態DependencyProperty
bool isInDesignMode = DesignerProperties.GetIsInDesignMode(this);<br>
bool isInDesignMode = DesignerProperties.IsInDesignTool;
bool isInDesignMode = Windows.ApplicationModel.DesignMode.DesignModeEnabled;<enabled><p><br>此方法可用於確定WinRT/Metro/Windows Store 應用程式的設計模式狀態。 </p></enabled>
以上是如何偵測 WPF、Silverlight 和 WinRT 應用程式中的設計模式?的詳細內容。更多資訊請關注PHP中文網其他相關文章!