You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
937 B
C#

using CommunityToolkit.Mvvm.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using MvvmCommunityApp.interfaces;
using MvvmCommunityApp.services;
using MvvmCommunityApp.viewmodels;
using System.Windows;
namespace MvvmCommunityApp
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
// setup mvvm ioc
Ioc.Default.ConfigureServices(
new ServiceCollection()
.AddTransient<IocPageViewModel>()
.AddSingleton<IDemoService, DemoService>()
.BuildServiceProvider());
// load the main / entry page
MainWindow wnd = new MainWindow();
wnd.Title = "Something else";
wnd.Show();
}
}
}