Skip to content

Commit 797ccf8

Browse files
committed
Update VSIX
1 parent 64bca79 commit 797ccf8

12 files changed

Lines changed: 49 additions & 31 deletions

File tree

VSIX/DevWinUI_Template/WinUIApp-MVVM-NavigationView/Common/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
public static partial class Constants
44
{
5-
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetAppDataFolderPath(), ProcessInfoHelper.ProductNameAndVersion);$SerilogDirectoryPath$$SerilogFilePath$$AppConfigFilePath$
5+
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetAppDataFolderPath(), ProcessInfoHelper.ProductName);$SerilogDirectoryPath$$SerilogFilePath$$AppConfigFilePath$
66
}

VSIX/DevWinUI_Template/WinUIApp-MVVM-NavigationView/MainWindow.xaml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@
1717
IsBackButtonVisible="True"
1818
IsPaneToggleButtonVisible="True"
1919
Subtitle="{x:Bind dev:ProcessInfoHelper.VersionWithPrefix}">
20-
<AutoSuggestBox MinWidth="320"
21-
VerticalAlignment="Center"
22-
PlaceholderText="Search"
23-
QueryIcon="Find"
24-
QuerySubmitted="OnQuerySubmitted"
25-
TextChanged="OnTextChanged" />
20+
<TitleBar.Resources>
21+
<!--
22+
TitleBar.Content uses Center alignment by default. Override to
23+
Stretch so the AutoSuggestBox grows with the title bar.
24+
-->
25+
<HorizontalAlignment x:Key="TitleBarContentHorizontalAlignment">Stretch</HorizontalAlignment>
26+
</TitleBar.Resources>
2627
<TitleBar.IconSource>
2728
<ImageIconSource ImageSource="ms-appx:///Assets/AppIcon.png" />
2829
</TitleBar.IconSource>
@@ -31,11 +32,17 @@
3132
Height="32"
3233
Margin="0,0,4,0"
3334
Click="ThemeButton_Click"
34-
Content="{dev:FontIcon GlyphCode=E793,
35-
FontSize=16}"
35+
Content="{dev:FontIcon GlyphCode=E793, FontSize=16}"
3636
Style="{ThemeResource SubtleButtonStyle}"
3737
ToolTipService.ToolTip="Toggle Theme" />
3838
</TitleBar.RightHeader>
39+
<AutoSuggestBox MaxWidth="580"
40+
VerticalAlignment="Center"
41+
HorizontalAlignment="Stretch"
42+
PlaceholderText="Search"
43+
QueryIcon="Find"
44+
QuerySubmitted="OnQuerySubmitted"
45+
TextChanged="OnTextChanged" />
3946
</TitleBar>
4047
<NavigationView x:Name="NavView"
4148
Grid.Row="1"

VSIX/DevWinUI_Template/WinUIApp-MVVM/Common/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
public static partial class Constants
44
{
5-
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetAppDataFolderPath(), ProcessInfoHelper.ProductNameAndVersion);$SerilogDirectoryPath$$SerilogFilePath$$AppConfigFilePath$
5+
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetAppDataFolderPath(), ProcessInfoHelper.ProductName);$SerilogDirectoryPath$$SerilogFilePath$$AppConfigFilePath$
66
}

VSIX/DevWinUI_Template/WinUIApp-NavigationView/Common/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
public static partial class Constants
44
{
5-
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetAppDataFolderPath(), ProcessInfoHelper.ProductNameAndVersion);$SerilogDirectoryPath$$SerilogFilePath$$AppConfigFilePath$
5+
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetAppDataFolderPath(), ProcessInfoHelper.ProductName);$SerilogDirectoryPath$$SerilogFilePath$$AppConfigFilePath$
66
}

VSIX/DevWinUI_Template/WinUIApp/Common/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
public static partial class Constants
44
{
5-
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetAppDataFolderPath(), ProcessInfoHelper.ProductNameAndVersion);$SerilogDirectoryPath$$SerilogFilePath$$AppConfigFilePath$
5+
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetAppDataFolderPath(), ProcessInfoHelper.ProductName);$SerilogDirectoryPath$$SerilogFilePath$$AppConfigFilePath$
66
}

dev/DevWinUI.Gallery/Common/AppConfig.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ namespace DevWinUIGallery.Common;
66
[GenerateAutoSaveOnChange]
77
public partial class AppConfig : NotifiyingJsonSettings, IVersionable
88
{
9-
[EnforcedVersion("8.5.0.0")]
10-
public Version Version { get; set; } = new Version(8, 5, 0, 0);
9+
[EnforcedVersion("10.0.0.0")]
10+
public Version Version { get; set; } = new Version(10, 0, 0, 0);
1111

1212
private string fileName { get; set; } = Constants.AppConfigPath;
1313
private bool useDeveloperMode { get; set; } = true;

dev/DevWinUI.Gallery/Common/AppHelper.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Diagnostics.CodeAnalysis;
2-
using System.Runtime.InteropServices;
32
using Nucs.JsonSettings;
43
using Nucs.JsonSettings.Fluent;
54
using Nucs.JsonSettings.Modulation;
@@ -36,9 +35,5 @@ public static (string UniqueId, string SectionId) GetUniqueIdAndSectionId(object
3635

3736
return (uniqueId, sectionId);
3837
}
39-
40-
[LibraryImport("user32.dll", EntryPoint = "PostMessageW", SetLastError = true)]
41-
[return: MarshalAs(UnmanagedType.Bool)]
42-
public static partial bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
4338
}
4439

dev/DevWinUI.Gallery/Common/Constants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public static class Constants
44
{
5-
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetAppDataFolderPath(), ProcessInfoHelper.ProductNameAndVersion);
5+
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetAppDataFolderPath(), ProcessInfoHelper.ProductName);
66
public static readonly string AppConfigPath = Path.Combine(RootDirectoryPath, "AppConfig.json");
77
public static readonly string LogDirectoryPath = Path.Combine(RootDirectoryPath, "Log");
88
public static readonly string LogFilePath = Path.Combine(LogDirectoryPath, "Log.txt");

dev/DevWinUI.Gallery/Views/MainWindow.xaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@
1313
<RowDefinition />
1414
</Grid.RowDefinitions>
1515
<TitleBar x:Name="AppTitleBar" Title="{x:Bind dev:ProcessInfoHelper.ProductNameDisplay}" IsBackButtonVisible="True" IsPaneToggleButtonVisible="True" Subtitle="{x:Bind dev:ProcessInfoHelper.VersionWithPrefixDev}">
16-
17-
<!-- Temporary Fix TitleBar Icon -->
18-
<TitleBar.LeftHeader>
19-
<ImageIcon Width="16" Height="16" Margin="2,0,14,0" PointerPressed="OnIconPointerPressed" Source="ms-appx:///Assets/AppIcon.png" />
20-
</TitleBar.LeftHeader>
21-
<AutoSuggestBox x:Name="HeaderAutoSuggestBox" MinWidth="320" VerticalAlignment="Center" PlaceholderText="Search" QueryIcon="Find" QuerySubmitted="OnQuerySubmitted" TextChanged="OnTextChanged">
16+
<TitleBar.Resources>
17+
<!--
18+
TitleBar.Content uses Center alignment by default. Override to
19+
Stretch so the AutoSuggestBox grows with the title bar.
20+
-->
21+
<HorizontalAlignment x:Key="TitleBarContentHorizontalAlignment">Stretch</HorizontalAlignment>
22+
</TitleBar.Resources>
23+
<TitleBar.IconSource>
24+
<ImageIconSource ImageSource="ms-appx:///Assets/AppIcon.png" />
25+
</TitleBar.IconSource>
26+
<AutoSuggestBox x:Name="HeaderAutoSuggestBox" MaxWidth="580" HorizontalAlignment="Stretch" VerticalAlignment="Center" PlaceholderText="Search" QueryIcon="Find" QuerySubmitted="OnQuerySubmitted" TextChanged="OnTextChanged">
2227
<AutoSuggestBox.KeyboardAccelerators>
2328
<KeyboardAccelerator Key="F" Invoked="KeyboardAccelerator_Invoked" Modifiers="Control" />
2429
</AutoSuggestBox.KeyboardAccelerators>

dev/DevWinUI.Gallery/Views/MainWindow.xaml.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ private void KeyboardAccelerator_Invoked(Microsoft.UI.Xaml.Input.KeyboardAcceler
6161
HeaderAutoSuggestBox.Focus(FocusState.Programmatic);
6262
}
6363

64-
private void OnIconPointerPressed(object sender, PointerRoutedEventArgs e)
65-
{
66-
AppHelper.PostMessage(App.Hwnd, (uint)NativeValues.WindowMessage.WM_SYSCOMMAND, 0xF090, IntPtr.Zero);
67-
}
68-
6964
public void AddTrayIcon(string toolTip)
7065
{
7166
uint iconId = 123;

0 commit comments

Comments
 (0)