using Avalonia;
using Avalonia.Controls;

using InkForge.Desktop.ViewModels;

using Microsoft.Extensions.DependencyInjection;

namespace InkForge.Desktop.Views;

public partial class MainWindow : Window
{
	public MainWindow()
	{
		InitializeComponent();
		DataContext = CreateViewModel();
	}

	private static MainViewModel CreateViewModel()
	{
		return ActivatorUtilities.CreateInstance<MainViewModel>(
			Application.Current!.GetValue(App.ServiceProviderProperty)
		);
	}
}
