Skip to content

Commit

Permalink
Fix VSIX Crash
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Dec 1, 2024
1 parent 04d182e commit 63cb8d0
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 19 deletions.
24 changes: 14 additions & 10 deletions VSIX/DevWinUI_Template/DevWinUI_Template/DevWinUI_Template.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@
<Compile Include="Common\VSDocumentHelper.cs" />
<Compile Include="Common\WidthAdjustConverter.cs" />
<Compile Include="Common\WizardConfig.cs" />
<Compile Include="Controls\SettingsControl.cs" />
<Compile Include="Controls\SettingsControlWithExpander.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="DevWinUI_TemplatePackage.cs" />
<Compile Include="TemplateWizard\SharedWizard.cs" />
Expand All @@ -77,6 +75,8 @@
<Compile Include="TemplateWizard\WinUIAppMVVMWizard.cs" />
<Compile Include="TemplateWizard\WinUIAppNavigationWizard.cs" />
<Compile Include="TemplateWizard\WinUIAppWizard.cs" />
<Compile Include="Theme\Controls\SettingsControl.cs" />
<Compile Include="Theme\Controls\SettingsControlWithExpander.cs" />
<Compile Include="Views\MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -127,18 +127,18 @@
<PackageReference Include="NuGet.Protocol" Version="6.12.1" />
<PackageReference Include="Microsoft.VisualStudio.SDK" ExcludeAssets="runtime">
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<Version>17.4.33103.184</Version>
<Version>17.3.32804.24</Version>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.TemplateWizardInterface">
<Version>17.10.40170</Version>
<Version>17.5.33428.366</Version>
</PackageReference>
<PackageReference Include="NuGet.VisualStudio" GeneratePathProperty="true">
<Version>17.12.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.VSSDK.BuildTools">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<Version>17.10.2185</Version>
<Version>17.9.3174</Version>
</PackageReference>
<PackageReference Include="WPF-UI">
<Version>4.0.0-rc.2</Version>
Expand All @@ -162,7 +162,15 @@
</Content>-->
</ItemGroup>
<ItemGroup>
<Page Include="Controls\SettingsControl.xaml">
<Page Include="Theme\Controls\SettingsControl.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Theme\Generic.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Theme\TextBlockStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
Expand All @@ -186,10 +194,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\TextBlockStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Pages\DashboardPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
81 changes: 81 additions & 0 deletions VSIX/DevWinUI_Template/DevWinUI_Template/Theme/Generic.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/Variables.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/Typography.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/StaticColors.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/Accent.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/Palette.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/DefaultContextMenu.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/DefaultFocusVisualStyle.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/DefaultTextBoxScrollViewerStyle.xaml" />

<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/AccessText/AccessText.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Anchor/Anchor.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/AutoSuggestBox/AutoSuggestBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Badge/Badge.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/BreadcrumbBar/BreadcrumbBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Button/Button.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Card/Card.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/CardAction/CardAction.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/CardColor/CardColor.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/CardControl/CardControl.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/CardExpander/CardExpander.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/CheckBox/CheckBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/CheckBox/CheckBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ComboBox/ComboBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ContentDialog/ContentDialog.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ContextMenu/ContextMenu.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ContextMenu/ContextMenuLoader.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/DropDownButton/DropDownButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/DynamicScrollBar/DynamicScrollBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/DynamicScrollViewer/DynamicScrollViewer.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Expander/Expander.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/FluentWindow/FluentWindow.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Flyout/Flyout.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Frame/Frame.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/GridView/GridViewColumnHeader.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/HyperlinkButton/HyperlinkButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Image/Image.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/InfoBar/InfoBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/InfoBadge/InfoBadge.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ItemsControl/ItemsControl.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Label/Label.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ListBox/ListBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ListBox/ListBoxItem.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ListView/ListView.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ListView/ListViewItem.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Menu/Menu.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Menu/MenuItem.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Menu/MenuLoader.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/NavigationView/NavigationView.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/NavigationView/NavigationViewBreadcrumbItem.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/NavigationView/NavigationViewContentPresenter.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/NavigationView/NavigationViewItemHeader.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/NavigationView/NavigationViewItemSeparator.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Page/Page.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/PasswordBox/PasswordBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/RadioButton/RadioButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ScrollBar/ScrollBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ScrollViewer/ScrollViewer.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Separator/Separator.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Slider/Slider.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/SplitButton/SplitButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/TextBlock/TextBlock.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/TextBox/TextBox.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ThumbRate/ThumbRate.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/TitleBar/TitleBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ToggleButton/ToggleButton.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ToggleSwitch/ToggleSwitch.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ToolBar/ToolBar.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/ToolTip/ToolTip.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/VirtualizingGridView/VirtualizingGridView.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/VirtualizingItemsControl/VirtualizingItemsControl.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/VirtualizingWrapPanel/VirtualizingWrapPanel.xaml" />
<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Controls/Window/Window.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
17 changes: 13 additions & 4 deletions VSIX/DevWinUI_Template/DevWinUI_Template/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>

</ResourceDictionary>
</ui:FluentWindow.Resources>

Expand All @@ -299,13 +298,23 @@
Margin="10,0"
Click="btnCancel_Click"
Content="Cancel [Esc]"
IsCancel="True" />
Cursor="Hand"
IsCancel="True">
<ui:Button.Icon>
<ui:SymbolIcon Symbol="Dismiss24" />
</ui:Button.Icon>
</ui:Button>
<ui:Button MinWidth="200"
Appearance="Primary"
Click="btnCreate_Click"
Content="Create Project [Enter]"
Cursor="Hand"
Foreground="WhiteSmoke"
IsDefault="True" />
IsDefault="True">
<ui:Button.Icon>
<ui:SymbolIcon Symbol="New24" />
</ui:Button.Icon>
</ui:Button>
</StackPanel>
<Separator />
</StackPanel>
Expand Down Expand Up @@ -339,7 +348,7 @@
NavigationCacheMode="Enabled"
TargetPageType="{x:Type pages:PagesPage}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Document24" />
<ui:SymbolIcon Symbol="TabDesktopNewPage20" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="XAML Resources"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public MainWindow()
});
Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary
{
Source = new System.Uri("pack://application:,,,/Wpf.Ui;component/Resources/Wpf.Ui.xaml", UriKind.RelativeOrAbsolute)
Source = new System.Uri("/DevWinUI_Template;component/Theme/Generic.xaml", UriKind.RelativeOrAbsolute)
});
Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary
{
Source = new System.Uri("/DevWinUI_Template;component/Views/TextBlockStyle.xaml", UriKind.RelativeOrAbsolute)
Source = new System.Uri("/DevWinUI_Template;component/Theme/TextBlockStyle.xaml", UriKind.RelativeOrAbsolute)
});
Application.Current.Resources.MergedDictionaries.Add(new ResourceDictionary
{
Source = new System.Uri("/DevWinUI_Template;component/Controls/SettingsControl.xaml", UriKind.RelativeOrAbsolute)
Source = new System.Uri("/DevWinUI_Template;component/Theme/Controls/SettingsControl.xaml", UriKind.RelativeOrAbsolute)
});
InitializeComponent();
Loaded += MainWindowWizard_Loaded;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
Description="Will create a landing page for your application's home screen. "
Toggled="tgHomePage_Toggled">
<local:SettingsControl.Icon>
<ui:SymbolIcon Symbol="Home24" />
<ui:SymbolIcon Symbol="ChannelAdd24" />
</local:SettingsControl.Icon>
</local:SettingsControl>
<local:SettingsControl x:Name="tgSettingsPage"
Title="Add SettingsPage"
Description="Will create a settings page with a BreadCrumbBar for your application"
Toggled="tgSettingsPage_Toggled">
<local:SettingsControl.Icon>
<ui:SymbolIcon Symbol="Settings24" />
<ui:SymbolIcon Symbol="CubeAdd20" />
</local:SettingsControl.Icon>
</local:SettingsControl>
<local:SettingsControl x:Name="tgGeneralSettingPage"
Expand Down

0 comments on commit 63cb8d0

Please sign in to comment.