I have a WPF class library (with a user control within it being my launch page (similar to MainWindow).
Code Snippet for User control is as follows:
<UserControl x:Class="ABC" ...... >
<Grid>
<Label>Hello World</Label>
</Grid>
</UserControl>
I created another WPF app (labelled Launcher) which would essentially call the this class library.
That project doesnt have any MainWindow (removed it) and am launching the User Control from App.xaml
<Application
x:Class="Launcher.App"
......
StartupUri="pack://application:,,,/Project;component/View/HelloWorld.xaml">
The app doesnt start in full screen ever and always need to maxime it on launching.
I know the answer should be in lines of removing the StartupUri from App.xaml and putting the App.xaml.cs
private void Application_Startup(object sender, StartupEventArgs e)
{
//What to put here
}
Since there is no MainWindow hence there is I cant do this:
MainWindow wnd = new MainWindow();
wnd.Title = "Something else";
//Set StartupMode = "Maximized"
wnd.Show();