Added resource classses and a missing converter.
This commit is contained in:
@@ -1,50 +1,46 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
using Microsoft.UI.Xaml.Data;
|
||||
using Microsoft.UI.Xaml.Input;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using Microsoft.UI.Xaml.Shapes;
|
||||
using Harmonia.Core.Extensions;
|
||||
using Harmonia.WinUI.Caching;
|
||||
using Harmonia.WinUI.Storage;
|
||||
using Harmonia.WinUI.ViewModels;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.UI.Xaml;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Windows.ApplicationModel;
|
||||
using Windows.ApplicationModel.Activation;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
namespace Harmonia.WinUI;
|
||||
|
||||
namespace Harmonia.WinUI
|
||||
public partial class App : Application
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
private Window? _mainWindow;
|
||||
|
||||
public static IServiceProvider ServiceProvider { get; private set; }
|
||||
|
||||
static App()
|
||||
{
|
||||
/// <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();
|
||||
}
|
||||
ServiceCollection services = new();
|
||||
|
||||
/// <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();
|
||||
}
|
||||
services.AddSingleton<MainWindow>();
|
||||
|
||||
private Window? m_window;
|
||||
//services.AddSingleton<MainViewModel>();
|
||||
services.AddSingleton<PlayerViewModel>();
|
||||
//services.AddSingleton<PlayingSongInfoViewModel>();
|
||||
services.AddSingleton<PlaylistViewModel>();
|
||||
|
||||
services.AddSingleton<IAudioBitmapImageCache, AudioBitmapImageCache>();
|
||||
services.AddSingleton<IStorageProvider, WindowsStorageProvider>();
|
||||
|
||||
services.AddHarmonia();
|
||||
|
||||
ServiceProvider = services.BuildServiceProvider();
|
||||
}
|
||||
}
|
||||
|
||||
public App()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override void OnLaunched(LaunchActivatedEventArgs args)
|
||||
{
|
||||
_mainWindow = ServiceProvider.GetRequiredService<MainWindow>();
|
||||
_mainWindow.Activate();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user