Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Window title is overwritten when using Caliburn's conductor<object> in view model

New to Caliburn and WPF MVVM, so I may be overlooking something pretty simple and I couldn't find anything searching the web.

Set up a simple wpf project with Caliburn.Micro. Set window title in ShellView.xaml. Works fine. Main MetroWindow displays the title as expcted.

Works fine:

[Export(typeof (IShell))]
public class ShellViewModel : PropertyChangedBased, IShell
{}

But change to:

[Export(typeof (IShell))]
public class ShellViewModel : Conductor<object>
{}

and Window title is the fully qualified name of this ViewModel. ANy help would be appreciated. Thanks.

like image 972
Dan G. Avatar asked Apr 14 '15 23:04

Dan G.


1 Answers

You can use it like this:

[Export(typeof (IShell))]
public class ShellViewModel : Conductor<IScreen>
{
    public ShellViewModel()
    {
        DisplayName = "Your window title";
    }
}

In my repository you can find some applications in WPF using Caliburn.Micro, for example:

  • DanceFloor - this one uses Conductor
  • Library-Manager
like image 176
Wojciech Kulik Avatar answered Oct 25 '22 20:10

Wojciech Kulik