Skip to content

Commit

Permalink
Improve Template
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Feb 13, 2025
1 parent 6d417be commit f887ee4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,4 @@ private async void NavigateToLogPath_Click(object sender, RoutedEventArgs e)
<uap5:StartupTask TaskId="$safeprojectname$StartOnLoginTask" Enabled="true" DisplayName="ms-resource:AppDisplayName" />
</uap5:Extension>
"""";

public static readonly string InitializeAppMethods =
""""
private $OnLaunchedAsyncKeyword$void InitializeAppMethods()
{
$PackagedAppTaskId$$Windows11ContextMenuInitializer$$ConfigLogger$$UnhandeledException$
}
"""";
}
11 changes: 9 additions & 2 deletions VSIX/DevWinUI_Template/WinUIApp-MVVM-NavigationView/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private static IServiceProvider ConfigureServices()
return services.BuildServiceProvider();
}

protected $OnLaunchedAsyncKeyword$override void OnLaunched(LaunchActivatedEventArgs args)
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
MainWindow = new MainWindow();

Expand All @@ -44,7 +44,14 @@ private static IServiceProvider ConfigureServices()

ThemeService.AutoInitialize(MainWindow).ConfigureTintColor();

MainWindow.Activate();$PackagedAppTaskId$$Windows11ContextMenuMVVMInitializer$$ConfigLogger$$UnhandeledException$
MainWindow.Activate();

InitializeApp();
}

private $OnLaunchedAsyncKeyword$void InitializeApp()
{
$PackagedAppTaskId$$Windows11ContextMenuMVVMInitializer$$ConfigLogger$$UnhandeledException$
}
}

11 changes: 9 additions & 2 deletions VSIX/DevWinUI_Template/WinUIApp-MVVM/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private static IServiceProvider ConfigureServices()
return services.BuildServiceProvider();
}

protected $OnLaunchedAsyncKeyword$override void OnLaunched(LaunchActivatedEventArgs args)
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
MainWindow = new MainWindow();

Expand All @@ -42,7 +42,14 @@ private static IServiceProvider ConfigureServices()

ThemeService.AutoInitialize(MainWindow);

MainWindow.Activate();$Windows11ContextMenuMVVMInitializer$$ConfigLogger$$UnhandeledException$
MainWindow.Activate();

InitializeApp();
}

private $OnLaunchedAsyncKeyword$void InitializeApp()
{
$Windows11ContextMenuMVVMInitializer$$ConfigLogger$$UnhandeledException$
}
}

11 changes: 9 additions & 2 deletions VSIX/DevWinUI_Template/WinUIApp-NavigationView/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public App()
NavService = new JsonNavigationService();
}

protected $OnLaunchedAsyncKeyword$override void OnLaunched(LaunchActivatedEventArgs args)
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
MainWindow = new MainWindow();

Expand All @@ -22,7 +22,14 @@ public App()

ThemeService = new ThemeService(MainWindow);

MainWindow.Activate();$PackagedAppTaskId$$Windows11ContextMenuInitializer$$ConfigLogger$$UnhandeledException$
MainWindow.Activate();

InitializeApp();
}

private $OnLaunchedAsyncKeyword$void InitializeApp()
{
$PackagedAppTaskId$$Windows11ContextMenuInitializer$$ConfigLogger$$UnhandeledException$
}
}

11 changes: 9 additions & 2 deletions VSIX/DevWinUI_Template/WinUIApp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public App()
this.InitializeComponent();
}

protected $OnLaunchedAsyncKeyword$override void OnLaunched(LaunchActivatedEventArgs args)
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
MainWindow = new MainWindow();

Expand All @@ -20,7 +20,14 @@ public App()

ThemeService = new ThemeService(MainWindow);

MainWindow.Activate();$Windows11ContextMenuInitializer$$ConfigLogger$$UnhandeledException$
MainWindow.Activate();

InitializeApp();
}

private $OnLaunchedAsyncKeyword$void InitializeApp()
{
$Windows11ContextMenuInitializer$$ConfigLogger$$UnhandeledException$
}
}

0 comments on commit f887ee4

Please sign in to comment.