using Microsoft.UI.Xaml; using MyMediaCollection.ViewModels; namespace MyMediaCollection { /// /// Provides application-specific behavior to supplement the default Application class. /// public partial class App : Application { /// /// 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(). /// public App() { this.InitializeComponent(); } public static MainViewModel ViewModel { get; } = new MainViewModel(); /// /// Invoked when the application is launched. /// /// Details about the launch request and process. protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) { m_window = new MainWindow(); m_window.Activate(); } private Window m_window; } }