Skip to content

Commit 218ff55

Browse files
committed
更新TeachingTip
1 parent 2e63300 commit 218ff55

9 files changed

+23
-36
lines changed

WinUI3Utilities.Analyzer/DependencyPropertyAnalyzer.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Immutable;
2+
using System.Diagnostics;
23
using System.Linq;
34
using Microsoft.CodeAnalysis;
45
using Microsoft.CodeAnalysis.CSharp;

WinUI3Utilities.Analyzer/WinUI3Utilities.Analyzer.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<ItemGroup>
1212
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" PrivateAssets="all" />
13-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
13+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
1414
<PackageReference Include="PolySharp" Version="1.14.1">
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

WinUI3Utilities.Samples/WinUI3Utilities.Samples.csproj

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<LangVersion>preview</LangVersion>
1515
<DefaultLanguage>zh-cn</DefaultLanguage>
1616
<EnableDefaultPriItems>false</EnableDefaultPriItems>
17-
<WindowsSdkPackageVersion>10.0.22621.38</WindowsSdkPackageVersion>
1817
</PropertyGroup>
1918

2019
<ItemGroup>
@@ -28,8 +27,8 @@
2827
</ItemGroup>
2928

3029
<ItemGroup>
31-
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
32-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240829007" />
30+
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.2" />
31+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240923002" />
3332
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" />
3433
<!--<PackageReference Include="WinUI3Utilities" Version="1.1.7.8" />-->
3534
<Manifest Include="$(ApplicationManifest)" />

WinUI3Utilities.SourceGenerator/AppContextGenerator.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,7 @@ partial class {{typeSymbol.ToDisplayString(SymbolDisplayFormat.MinimallyQualifie
7979
public static void Initialize{{methodName}}()
8080
{
8181
var settings = {{nsStorage}}.ApplicationData.GetDefault().LocalSettings;
82-
if (!settings.Containers.ContainsKey({{specificType}}.{{methodName}}ContainerKey))
83-
{
84-
_ = settings.CreateContainer({{specificType}}.{{methodName}}ContainerKey, {{nsStorage}}.ApplicationDataCreateDisposition.{{createDispositionValue}});
85-
}
86-
87-
_container{{methodName}} = settings.Containers[{{specificType}}.{{methodName}}ContainerKey];
82+
_container{{methodName}} = settings.CreateContainer({{specificType}}.{{methodName}}ContainerKey, {{nsStorage}}.ApplicationDataCreateDisposition.{{createDispositionValue}});
8883
}
8984
""").AppendLine();
9085
_ = loadMethods.AppendLine(

WinUI3Utilities.SourceGenerator/WinUI3Utilities.SourceGenerator.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" PrivateAssets="all" />
16-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
16+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all" />
1717
<PackageReference Include="PolySharp" Version="1.14.1">
1818
<PrivateAssets>all</PrivateAssets>
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2020
</PackageReference>
21-
<PackageReference Include="System.Text.Json" Version="8.0.4" GeneratePathProperty="true" PrivateAssets="all" />
21+
<PackageReference Include="System.Text.Json" Version="8.0.5" GeneratePathProperty="true" PrivateAssets="all" />
2222
</ItemGroup>
2323

2424
<!-- 以下部分是给WinUI3Utilities的项目引用使用的 -->

WinUI3Utilities/DefaultBrushBackdrop.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace WinUI3Utilities;
88
/// <summary>
99
/// Helper class for creating composition-brush based backdrops.
1010
/// </summary>
11-
public class DefaultBrushBackdrop(bool isDarkMode) : SystemBackdrop
11+
public partial class DefaultBrushBackdrop(bool isDarkMode) : SystemBackdrop
1212
{
1313
/// <summary>
1414
/// Is dark mode.

WinUI3Utilities/TeachingTipHelper.cs

+3-11
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ namespace WinUI3Utilities;
1313
public static class TeachingTipHelper
1414
{
1515
/// <summary>
16-
/// Create a <see cref="TeachingTip"/> with <paramref name="frameworkElement"/> and <paramref name="target"/>
16+
/// Create a <see cref="TeachingTip"/> with <paramref name="frameworkElement"/> and <paramref name="target"/>.
17+
/// Will be removed from <see cref="FrameworkElement.Resources"/> when <see cref="TeachingTip.Closed"/>
1718
/// </summary>
1819
/// <param name="frameworkElement"></param>
1920
/// <param name="target"></param>
@@ -165,16 +166,7 @@ private static async void Hide(this TeachingTip teachingTip, int milliseconds)
165166
? null
166167
: new FontIconSource
167168
{
168-
Glyph = severity switch
169-
{
170-
TeachingTipSeverity.Ok => "\xE10B", // Accept
171-
TeachingTipSeverity.Information => "\xE946", // Info
172-
TeachingTipSeverity.Important => "\xE171", // Important
173-
TeachingTipSeverity.Warning => "\xE7BA", // Warning
174-
TeachingTipSeverity.Error => "\xEA39", // ErrorBadge
175-
TeachingTipSeverity.Processing => "\xE9F5", // Processing
176-
_ => ThrowHelper.ArgumentOutOfRange<TeachingTipSeverity, string>(severity)
177-
}
169+
Glyph = ((char)severity).ToString()
178170
};
179171
}
180172
}

WinUI3Utilities/TeachingTipSeverity.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,40 @@ namespace WinUI3Utilities;
55
/// <summary>
66
/// Snack bar severity on <see cref="TeachingTip.IconSource"/> (Segoe Fluent Icons font)
77
/// </summary>
8-
public enum TeachingTipSeverity
8+
public enum TeachingTipSeverity : ushort
99
{
1010
/// <summary>
1111
/// Accept (E10B)
1212
/// </summary>
13-
Ok,
13+
Ok = 0xE10B,
1414

1515
/// <summary>
1616
/// Info (E946)
1717
/// </summary>
18-
Information,
18+
Information = 0xE946,
1919

2020
/// <summary>
2121
/// Important (E171)
2222
/// </summary>
23-
Important,
23+
Important = 0xE171,
2424

2525
/// <summary>
2626
/// Warning (E7BA)
2727
/// </summary>
28-
Warning,
28+
Warning = 0xE7BA,
2929

3030
/// <summary>
3131
/// ErrorBadge (EA39)
3232
/// </summary>
33-
Error,
33+
Error = 0xEA39,
3434

3535
/// <summary>
3636
/// Processing (E9F5)
3737
/// </summary>
38-
Processing,
38+
Processing = 0xE9F5,
3939

4040
/// <summary>
4141
/// <see langword="null"/>
4242
/// </summary>
43-
None
43+
None = 0
4444
}

WinUI3Utilities/WinUI3Utilities.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@
1818
<Title>$(AssemblyName)</Title>
1919
<RepositoryUrl>[email protected]:Poker-sang/WinUI3Utilities.git</RepositoryUrl>
2020
<PackageProjectUrl>https://github.com/Poker-sang/WinUI3Utilities</PackageProjectUrl>
21-
<AssemblyVersion>1.1.7.9</AssemblyVersion>
21+
<AssemblyVersion>1.1.7.10</AssemblyVersion>
2222
<FileVersion>$(AssemblyVersion)</FileVersion>
2323
<VersionPrefix>$(AssemblyVersion)</VersionPrefix>
2424
<Version>$(AssemblyVersion)</Version>
2525
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
2626
<IsAotCompatible>true</IsAotCompatible>
2727
</PropertyGroup>
2828
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
29-
<NoWarn>IDE0060</NoWarn>
29+
<NoWarn>$(NoWarn);IDE0060</NoWarn>
3030
</PropertyGroup>
3131

3232
<ItemGroup>
33-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240802000" />
33+
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240923002" />
3434
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.3233" />
35-
<PackageReference Include="System.Text.Json" Version="8.0.4" GeneratePathProperty="true" PrivateAssets="all" ReferenceOutputAssembly="false" />
35+
<PackageReference Include="System.Text.Json" Version="8.0.5" GeneratePathProperty="true" PrivateAssets="all" ReferenceOutputAssembly="false" />
3636
</ItemGroup>
3737

3838
<ItemGroup>

0 commit comments

Comments
 (0)