mirror of
https://github.com/PacktPublishing/Learn-WinUI-3-Second-Edition.git
synced 2026-06-20 12:23:09 +00:00
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using Microsoft.UI.Xaml;
|
|
using MyMediaCollection.ViewModels;
|
|
|
|
namespace MyMediaCollection
|
|
{
|
|
/// <summary>
|
|
/// Provides application-specific behavior to supplement the default Application class.
|
|
/// </summary>
|
|
public partial class App : Application
|
|
{
|
|
/// <summary>
|
|
/// Initializes the singleton application object. This is the first line of authored code
|
|
/// executed, and as such is the logical equivalent of main() or WinMain().
|
|
/// </summary>
|
|
public App()
|
|
{
|
|
this.InitializeComponent();
|
|
}
|
|
|
|
public static MainViewModel ViewModel { get; } = new MainViewModel();
|
|
|
|
/// <summary>
|
|
/// Invoked when the application is launched.
|
|
/// </summary>
|
|
/// <param name="args">Details about the launch request and process.</param>
|
|
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
|
|
{
|
|
m_window = new MainWindow();
|
|
m_window.Activate();
|
|
}
|
|
|
|
private Window m_window;
|
|
}
|
|
} |