Reputation: 223
I've been mainly working with windows forms, but would like to use WPF instead. Generally I like to manage my applications with a Manager.cs file. I will set the manager to be the entry point and it will load for example my main window.
From what I've read the Main() entry point is automatically generated when WPF is run. I've tried changing the XAML file to run my Manager.cs file, but it complains when I do so.
I'm a complete noob with WPF, anyone got any suggestions for how to keep everything encapsulated in a Manager.cs file and have that run at startup?
Upvotes: 1
Views: 155
Reputation: 64537
Although I advise not bothering, you should just be able to change the App.xaml file name to Manager.xaml (which in turn created Manager.xaml.cs), and then in the new Manager.xaml.cs, change App
to Manager
on the partial class definition.
The other half of the partial class is the auto-generated stuff.
You can then access Manager.Current
as you would have previously done App.Current
.
Upvotes: 1