而不是在我的MainWindow的中心託管我的模態對話框,我想將它託管在我的MainWindow內的一個ContentControls中。希望有人能告訴我如何去做這件事。謝謝。在ContentControl中承載一個模態對話框
0
A
回答
0
1
我有一個自定義FrameworkElement
,讓您在顯示主要內容模式的內容github一個例子。
控制可以像這樣使用:
<c:ModalContentPresenter IsModal="{Binding DialogIsVisible}">
<TabControl Margin="5">
<Button Margin="55"
Padding="10"
Command="{Binding ShowModalContentCommand}">
This is the primary Content
</Button>
</TabItem>
</TabControl>
<c:ModalContentPresenter.ModalContent>
<Button Margin="75"
Padding="50"
Command="{Binding HideModalContentCommand}">
This is the modal content
</Button>
</c:ModalContentPresenter.ModalContent>
</c:ModalContentPresenter>
特點:
- 顯示任意內容。
- 在顯示模態內容時不禁用主內容。
- 在顯示模態內容時,禁止鼠標和鍵盤訪問主內容。
- 只對它所覆蓋的內容有效,而不是整個應用程序。
- 可通過綁定到
IsModal
屬性以MVVM友好的方式使用。
相關問題
- 1. 從另一個模態對話框引導模態對話框
- 2. 在另一個模態JFace對話框上打開模態JFace對話框
- 3. 動態負載模式,對話框在一個頁面
- 4. 模態對話框
- 5. 模態對話框
- 6. 模態對話框存在:
- 7. AsyncFileUpload在模態對話框
- 8. 多個Jquery模態對話框在一個頁面中?
- 9. 對齊模態對話框
- 10. 在GWT中創建一個模態對話框
- 11. 在javascript中檢測模態對話框
- 12. 在模態對話框中顯示CustomValidator
- 13. 在javascript中確認模態對話框
- 14. 在javascript中檢測模態對話框
- 15. 如何在無模式對話框中模擬模態對話框UI行爲?
- 16. 在對話框加載之前顯示引導模態對話框背景?
- 17. Spring MVC控制器在模態對話框中加載表格
- 18. 如何在模態對話框中加載jqGrid jquery
- 19. SWT模態對話框非模態
- 20. 模態對話框變爲非模態
- 21. 如何將模型錯誤加載到模態對話框中
- 22. MFC中模態對話框與非模態對話框之間的區別
- 23. 如何在非模態對話框上正確實現模態對話框?
- 24. 在WinForms中,有沒有人看到從另一個模態對話框調用一個模態對話框會導致模態被撤消?
- 25. 的onClick模態對話框
- 26. 模態對話框。 - 混亂
- 27. jQuery多模態對話框
- 28. 單例模態對話框
- 29. 非模態JFace對話框?
- 30. jquery模態對話框onclick?
你是說「模態對話框」是什麼意思?舉個例子。 – Seekeer 2012-02-07 08:12:13