Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"groupIdentity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.ContentDialog",
"name": "WinUI Content Dialog (Item)",
"shortName": ["winui-dialog", "winui3-dialog"],
"sourceName": "ContentDialog",
"defaultName": "ContentDialog",
"description": "Adds a WinUI 3 ContentDialog with markup and code-behind.",
"preferNameDirectory": false,
Expand All @@ -26,7 +25,8 @@
"type": "derived",
"valueSource": "name",
"valueTransform": "safe_name",
"replaces": "$safeitemname$"
"replaces": "$safeitemname$",
"fileRename": "ContentDialog"
},
"itemName": {
"type": "derived",
Expand All @@ -39,30 +39,6 @@
"valueSource": "name",
"valueTransform": "identity",
"replaces": "$fileinputname$"
},
"contentDialogType": {
"type": "generated",
"generator": "constant",
"parameters": {
"value": "ContentDialog"
},
"replaces": "__WINUI_CONTENT_DIALOG__"
},
"contentDialogButtonClickEventArgsType": {
"type": "generated",
"generator": "constant",
"parameters": {
"value": "ContentDialogButtonClickEventArgs"
},
"replaces": "__WINUI_CONTENT_DIALOG_BUTTON_CLICK_EVENT_ARGS__"
},
"defaultContentDialogStyleResourceKey": {
"type": "generated",
"generator": "constant",
"parameters": {
"value": "DefaultContentDialogStyle"
},
"replaces": "__WINUI_DEFAULT_CONTENT_DIALOG_STYLE__"
}
},
"constraints": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<__WINUI_CONTENT_DIALOG__
<ContentDialog
x:Class="$rootnamespace$.$safeitemname$"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:$rootnamespace$"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Style="{StaticResource __WINUI_DEFAULT_CONTENT_DIALOG_STYLE__}"
Title="Title"
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
PrimaryButtonText="Button1"
SecondaryButtonClick="ContentDialog_SecondaryButtonClick"
SecondaryButtonText="Button2"
CloseButtonText="Close"
DefaultButton="Primary"
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
SecondaryButtonClick="ContentDialog_SecondaryButtonClick"
mc:Ignorable="d">

<Grid>

</Grid>
</__WINUI_CONTENT_DIALOG__>
</ContentDialog>
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@

namespace $rootnamespace$;

public sealed partial class $safeitemname$ : __WINUI_CONTENT_DIALOG__
public sealed partial class $safeitemname$ : ContentDialog
{
public $safeitemname$()
{
InitializeComponent();
}

private void ContentDialog_PrimaryButtonClick(__WINUI_CONTENT_DIALOG__ sender, __WINUI_CONTENT_DIALOG_BUTTON_CLICK_EVENT_ARGS__ args)
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}

private void ContentDialog_SecondaryButtonClick(__WINUI_CONTENT_DIALOG__ sender, __WINUI_CONTENT_DIALOG_BUTTON_CLICK_EVENT_ARGS__ args)
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<VSTemplate Version="3.0.0" Type="Item" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" xmlns:sdk="http://schemas.microsoft.com/developer/vstemplate-sdkextension/2010">
<TemplateData>
<DefaultName>ContentDialog.xaml</DefaultName>
<Name ID="1021" Package="FIXME-PACKAGEGUID" />
<Description ID="1023" Package="FIXME-PACKAGEGUID" />
<Name ID="1065" Package="FIXME-PACKAGEGUID" />
<Description ID="1067" Package="FIXME-PACKAGEGUID" />
<Icon>WinUI.Neutral.Cs.ContentDialog.ico</Icon>
<ProjectType>CSharp</ProjectType>
<TemplateID>WinUI.Cs.Neutral.ContentDialog</TemplateID>
Expand Down
9 changes: 9 additions & 0 deletions dev/Templates/VSIX/Extension/Cs/Common/VSPackage.resx
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,13 @@
<data name="1064" xml:space="preserve">
<value>A project template for creating a WinUI app structured with the MVVM pattern using the CommunityToolkit.Mvvm package.</value>
</data>
<data name="1065" xml:space="preserve">
<value>Content Dialog</value>
</data>
<data name="1066" xml:space="preserve">
<value>[Experimental] Content Dialog</value>
</data>
<data name="1067" xml:space="preserve">
<value>A dialog box that displays content over the app UI to show information or gather input (WinUI).</value>
</data>
</root>
9 changes: 8 additions & 1 deletion dev/Templates/VSIX/Extension/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,14 @@
<PropertyGroup>
<VsixIdentity>$(_OriginalVsixId)</VsixIdentity>
<ExperimentalVsixIdentity>$(_OriginalVsixId).Experimental</ExperimentalVsixIdentity>
<ExperimentalVsixDisplayName>Experimental $(_OriginalVsixName)</ExperimentalVsixDisplayName>
<!--
The VSIX manifest DisplayName has a 50-character maximum. Prepending
"Experimental " (13 chars) to a full name like
"Windows App SDK C# VS Templates (LocalDev)" (42) overflows it, so strip
the trailing deployment parenthetical (e.g. " (LocalDev)") - the
deployment is already encoded in the .Experimental Identity/suffix.
-->
<ExperimentalVsixDisplayName>Experimental $([System.Text.RegularExpressions.Regex]::Replace('$(_OriginalVsixName)', ' \(.*\)', ''))</ExperimentalVsixDisplayName>
<ExperimentalVsixTags>$(_OriginalVsixTags)</ExperimentalVsixTags>

<_OriginalVsixId></_OriginalVsixId>
Expand Down
Loading