Skip to content

Commit

Permalink
Fix Templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Feb 13, 2025
1 parent 114e101 commit e599efa
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,25 +174,19 @@ private async void NavigateToLogPath_Click(object sender, RoutedEventArgs e)
}
"""";

public static readonly string SetPackagedAppTaskId =
""""
// If you are using UnPackaged app, remove this line and StartupTask from Package.appxmanifest file.
StartupHelper.SetTaskIdForPackagedApp("$safeprojectname$StartOnLoginTask");
"""";

public static readonly string StartupTask =
""""
<Extensions>
<uap5:Extension Category="windows.startupTask">
<uap5:StartupTask TaskId="$safeprojectname$StartOnLoginTask" Enabled="true" DisplayName="ms-resource:AppDisplayName" />
<uap5:StartupTask TaskId="$safeprojectname$StartOnLoginTask" Enabled="false" DisplayName="$safeprojectname$" />
</uap5:Extension>
</Extensions>
"""";

public static readonly string StartupTaskInContextMenu =
""""
<uap5:Extension Category="windows.startupTask">
<uap5:StartupTask TaskId="$safeprojectname$StartOnLoginTask" Enabled="true" DisplayName="ms-resource:AppDisplayName" />
<uap5:StartupTask TaskId="$safeprojectname$StartOnLoginTask" Enabled="false" DisplayName="$safeprojectname$" />
</uap5:Extension>
"""";
}
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ private void AddReplacementsDictionary(Dictionary<string, string> replacementsDi
if (WizardConfig.IsUnPackagedMode)
{
replacementsDictionary.Add("$WindowsPackageType$", "None");
replacementsDictionary.Add("$PackagedAppTaskId$", "");
replacementsDictionary.Add("$UAP5$", "");
replacementsDictionary.Add("$StartupTask$", "");
}
Expand All @@ -436,8 +435,6 @@ private void AddReplacementsDictionary(Dictionary<string, string> replacementsDi

if (WizardConfig.UseGeneralSettingPage && WizardConfig.UseStartupSetting)
{
var content = PredefinedCodes.SetPackagedAppTaskId.Replace("$safeprojectname$", SafeProjectName);
replacementsDictionary.Add("$PackagedAppTaskId$", content);
replacementsDictionary.Add("$UAP5$", Environment.NewLine + " xmlns:uap5=\"http://schemas.microsoft.com/appx/manifest/uap/windows10/5\"");

if (WizardConfig.UseWindow11ContextMenu)
Expand All @@ -453,7 +450,6 @@ private void AddReplacementsDictionary(Dictionary<string, string> replacementsDi
}
else
{
replacementsDictionary.Add("$PackagedAppTaskId$", "");
replacementsDictionary.Add("$UAP5$", "");
replacementsDictionary.Add("$StartupTask$", "");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="DevWinUI_Template.18eb89b1-bd1f-4e22-9196-6ea05b8ca61d" Version="11.3.0" Language="en-US" Publisher="Mahdi Hosseini" />
<Identity Id="DevWinUI_Template.18eb89b1-bd1f-4e22-9196-6ea05b8ca61d" Version="11.4.0" Language="en-US" Publisher="Mahdi Hosseini" />
<DisplayName>DevWinUI Templates for WinUI</DisplayName>
<Description xml:space="preserve">DevWinUI Project Template, help you quickly create a new WinUI 3 App with DevWinUI and MVVM Packages. We prepare your project with the following features: NavigationView, Custom TitleBar, HomeLandingPage and Settings Page (with Theme settings).
We also always use the latest version of WindowsAppSDK.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)

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

2 changes: 1 addition & 1 deletion VSIX/DevWinUI_Template/WinUIApp-NavigationView/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs args)

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

0 comments on commit e599efa

Please sign in to comment.