WindowAwareViewModel 类¶
由 IWindowService 或 IDialogService 在其自身窗口中显示的 ViewModel 的基类。它跟踪 ViewModel 所附加的窗口,根据请求关闭窗口,并创建由 ViewLocatorAttribute 声明的 View。
命名空间: Eremex.AvaloniaUI.Controls.ApplicationServices
程序集: Eremex.Avalonia.Controls.ApplicationServices.dll
NuGet 包: Eremex.Avalonia.Controls.ApplicationServices
声明¶
构造函数¶
| 名称 | 说明 |
|---|---|
| WindowAwareViewModel() | 使用空的窗口标题初始化 WindowAwareViewModel 类的新实例。 |
| WindowAwareViewModel(…) | 使用给定的窗口标题初始化 WindowAwareViewModel 类的新实例。 |
属性¶
| 名称 | 说明 |
|---|---|
| Content { get; set; } | |
| IsVisible { get; } | |
| Title { get; set; } | |
| WindowStyleClasses { get; set; } |
备注¶
派生类重写 AttachCore 和 DetachCore 以响应窗口的打开和关闭,并重写 CanCloseWindow 以否决关闭。
另请参阅¶
* 本页面使用机器翻译技术翻译。