Unimatrix_001
asked on
Capturing the App_Startup event
Hi,
I've got a generated WPF program and in the app.g.cs file I've got the first block of code and in App.cs I've got the second block of code. How can I capture the startup event in app.cs - I can't really modify app.g.cs because it is auto-generated.
Thanks,
Uni
I've got a generated WPF program and in the app.g.cs file I've got the first block of code and in App.cs I've got the second block of code. How can I capture the startup event in app.cs - I can't really modify app.g.cs because it is auto-generated.
Thanks,
Uni
/************************************************************************************************
namespace MyApp{
/// <summary>
/// App
/// </summary>
public partial class App : System.Windows.Application {
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static void Main() {
MyApp.App app = new MyApp.App();
app.Run();
}
}
}
************************************************************************************************/
/************************************************************************************************
namespace MyApp
{
public partial class App : Application
{
void App_Startup(object sender, StartupEventArgs e)
{
//Stuff here...
}
}
}
************************************************************************************************/
ASKER
Hi Juan,
I'm aware of how partial classes work, but I don't understand the relevance to the problem?
Thanks,
Uni
I'm aware of how partial classes work, but I don't understand the relevance to the problem?
Thanks,
Uni
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As those classes are declared partial, you can decalre a public class of the same name to complement it.
Have a look at this link for more information: http://msdn.microsoft.com/en-us/library/wa80x488.aspx
I hope this helps