I think I am missing something obvious. But since the main window of my Application is a UserControl that is being launched by
protected override void OnStartup(object sender, StartupEventArgs e)
{
DisplayRootViewFor<MainWindowViewModel>();
}
in my bootstrapper how do I set the Icon of the window itself and of the application in the toolbar?
XAML based solution: Change your
MainWindowView
base class fromUserControl
toWindow
(both in .xaml and in .xaml.cs), then set yourIcon
property or any other window-specific properties right in xaml.Code based solution:
DisplayRootViewFor<T>
takes an optional settings parameter:The keys should correspond to the window properties you want to set, and the value types have to match.
//default settings for windowmanager.createwindow