简体   繁体   English

使用caliburn.micro wpf c#更改视图名称

[英]Change name of view using caliburn.micro wpf c#

in the header of my view the text is : BImporter.ViewModels.MainViewModel 在我的视图的标题中,文本为:BImporter.ViewModels.MainViewModel

how i can change it in (for example : MAIN) ? 我如何更改它(例如:MAIN)? ?

You can derive your view model from Screen or one of the conductor types and set the DisplayName property. 您可以从Screen或导体类型之一导出视图模型,并设置DisplayName属性。

public class MyViewModel : Screen
{
    protected override void OnInitialize()
    {
        this.DisplayName = "My Name";
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM