-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish task and publish 1.5.414.0 version
1.Finish task and publish 1.5.414.0 version 2.Update Windows App SDK version 1.3.230331000(1.3.0.0) 3.Update Mile.Xaml version 2.0.573-preview 4.Add app information dialog 5.Use Windows App Sdk 1.3 new Systembackdrop and AppWindow API(Beta)_ 6.Update WebView2 core clear history data new API
- Loading branch information
1 parent
d087599
commit b01cf61
Showing
45 changed files
with
1,040 additions
and
380 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
GetStoreApp/Extensions/Backdrop/DesktopAcrylicSystemBackdrop.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using GetStoreApp.Services.Root; | ||
using Microsoft.UI.Composition; | ||
using Microsoft.UI.Composition.SystemBackdrops; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Media; | ||
using System; | ||
|
||
namespace GetStoreApp.Extensions.Backdrop | ||
{ | ||
/// <summary> | ||
/// 自定义扩展的亚克力背景色类 | ||
/// </summary> | ||
public class DesktopAcrylicSystemBackdrop : SystemBackdrop | ||
{ | ||
private DesktopAcrylicController _desktopAcrylicController; | ||
|
||
public SystemBackdropConfiguration BackdropConfiguration { get; private set; } | ||
|
||
/// <summary> | ||
/// 在 Window.SystemBackdrop 上设置时触发该方法 | ||
/// </summary> | ||
protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop connectedTarget, XamlRoot xamlRoot) | ||
{ | ||
base.OnTargetConnected(connectedTarget, xamlRoot); | ||
|
||
if (_desktopAcrylicController != null) | ||
{ | ||
throw new ApplicationException(ResourceService.GetLocalized("Resources/SystemBackdropControllerInitializeFailed")); | ||
} | ||
|
||
_desktopAcrylicController = new DesktopAcrylicController(); | ||
_desktopAcrylicController.AddSystemBackdropTarget(connectedTarget); | ||
|
||
SetControllerConfiguration(connectedTarget, xamlRoot); | ||
} | ||
|
||
/// <summary> | ||
/// 从 Window.SystemBackdrop 对象中清除此对象时调用。 | ||
/// </summary> | ||
protected override void OnTargetDisconnected(ICompositionSupportsSystemBackdrop disconnectedTarget) | ||
{ | ||
base.OnTargetDisconnected(disconnectedTarget); | ||
|
||
_desktopAcrylicController.RemoveSystemBackdropTarget(disconnectedTarget); | ||
_desktopAcrylicController = null; | ||
} | ||
|
||
/// <summary> | ||
/// 设置应用于系统背景目标的系统策略 | ||
/// </summary> | ||
private void SetControllerConfiguration(ICompositionSupportsSystemBackdrop connectedTarget, XamlRoot xamlRoot) | ||
{ | ||
BackdropConfiguration = GetDefaultSystemBackdropConfiguration(connectedTarget, xamlRoot); | ||
BackdropConfiguration.IsInputActive = true; | ||
_desktopAcrylicController.SetSystemBackdropConfiguration(BackdropConfiguration); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
using GetStoreApp.Services.Root; | ||
using Microsoft.UI.Composition; | ||
using Microsoft.UI.Composition.SystemBackdrops; | ||
using Microsoft.UI.Xaml; | ||
using Microsoft.UI.Xaml.Media; | ||
using System; | ||
|
||
namespace GetStoreApp.Extensions.Backdrop | ||
{ | ||
/// <summary> | ||
/// 自定义扩展的云母背景色类 | ||
/// </summary> | ||
public class MicaSystemBackdrop : SystemBackdrop | ||
{ | ||
private MicaController _micaController; | ||
|
||
public SystemBackdropConfiguration BackdropConfiguration { get; private set; } | ||
|
||
public MicaKind Kind { get; set; } = MicaKind.Base; | ||
|
||
/// <summary> | ||
/// 在 Window.SystemBackdrop 上设置时触发该方法 | ||
/// </summary> | ||
protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop connectedTarget, XamlRoot xamlRoot) | ||
{ | ||
base.OnTargetConnected(connectedTarget, xamlRoot); | ||
|
||
if (_micaController != null) | ||
{ | ||
throw new ApplicationException(ResourceService.GetLocalized("Resources/SystemBackdropControllerInitializeFailed")); | ||
} | ||
|
||
_micaController = new MicaController() { Kind = Kind }; | ||
_micaController.AddSystemBackdropTarget(connectedTarget); | ||
|
||
SetControllerConfiguration(connectedTarget, xamlRoot); | ||
} | ||
|
||
/// <summary> | ||
/// 从 Window.SystemBackdrop 对象中清除此对象时调用。 | ||
/// </summary> | ||
protected override void OnTargetDisconnected(ICompositionSupportsSystemBackdrop disconnectedTarget) | ||
{ | ||
base.OnTargetDisconnected(disconnectedTarget); | ||
|
||
_micaController.RemoveSystemBackdropTarget(disconnectedTarget); | ||
_micaController = null; | ||
} | ||
|
||
/// <summary> | ||
/// 设置应用于系统背景目标的系统策略 | ||
/// </summary> | ||
private void SetControllerConfiguration(ICompositionSupportsSystemBackdrop connectedTarget, XamlRoot xamlRoot) | ||
{ | ||
BackdropConfiguration = GetDefaultSystemBackdropConfiguration(connectedTarget, xamlRoot); | ||
BackdropConfiguration.IsInputActive = true; | ||
_micaController.SetSystemBackdropConfiguration(BackdropConfiguration); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.