This commit is contained in:
Lightczx
2024-06-25 17:24:36 +08:00
parent 077243fa38
commit 0433ecbce8
152 changed files with 402 additions and 454 deletions

View File

@@ -16,6 +16,8 @@ using Snap.Hutao.Service.Navigation;
using Snap.Hutao.UI.Input.HotKey;
using Snap.Hutao.UI.Shell;
using Snap.Hutao.UI.Xaml;
using Snap.Hutao.UI.Xaml.View.Page;
using Snap.Hutao.UI.Xaml.View.Window;
using Snap.Hutao.ViewModel.Guide;
using System.Diagnostics;
@@ -164,7 +166,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
case MainWindow:
await serviceProvider
.GetRequiredService<INavigationService>()
.NavigateAsync<View.Page.LaunchGamePage>(INavigationAwaiter.Default, true)
.NavigateAsync<LaunchGamePage>(INavigationAwaiter.Default, true)
.ConfigureAwait(false);
return;
@@ -210,7 +212,7 @@ internal sealed partial class AppActivation : IAppActivation, IAppActivationActi
// ViewModel requires the Metadata Service to be initialized.
serviceProvider
.GetRequiredService<INavigationService>()
.Navigate<View.Page.AchievementPage>(navigationAwaiter, true);
.Navigate<AchievementPage>(navigationAwaiter, true);
#pragma warning restore CA1849
break;
}

View File

@@ -42,6 +42,8 @@ public static partial class Program
[STAThread]
private static void Main(string[] args)
{
// WebView2
Environment.SetEnvironmentVariable("WEBVIEW2_DEFAULT_BACKGROUND_COLOR", "00000000");
System.Diagnostics.Debug.WriteLine($"[Arguments]:[{args.ToString(',')}]");
XamlCheckProcessRequirements();

View File

@@ -2,7 +2,7 @@
// Licensed under the MIT license.
using Snap.Hutao.Factory.ContentDialog;
using Snap.Hutao.View.Dialog;
using Snap.Hutao.UI.Xaml.View.Dialog;
using System.Collections.Specialized;
using System.Web;

View File

@@ -6,7 +6,7 @@ using Snap.Hutao.Core.ExceptionService;
using Snap.Hutao.Factory.ContentDialog;
using Snap.Hutao.Model.Entity;
using Snap.Hutao.Model.Entity.Primitive;
using Snap.Hutao.View.Dialog;
using Snap.Hutao.UI.Xaml.View.Dialog;
using System.Collections.ObjectModel;
namespace Snap.Hutao.Service.Game.Account;

View File

@@ -9,7 +9,7 @@ using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.Service.Game.Configuration;
using Snap.Hutao.Service.Game.Package;
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.View.Dialog;
using Snap.Hutao.UI.Xaml.View.Dialog;
using Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect;
using Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect.ChannelSDK;
using Snap.Hutao.Web.Hoyolab.HoyoPlay.Connect.DeprecatedFile;

View File

@@ -0,0 +1,15 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Win32.Foundation;
namespace Snap.Hutao.Service.Game.Unlocker.Island;
internal struct IslandEnvironmentView
{
public nuint Address;
public int Value;
public IslandState State;
public WIN32_ERROR LastError;
public int Reserved;
}

View File

@@ -40,8 +40,8 @@ internal sealed class IslandGameFpsUnlocker : GameFpsUnlocker
context.Logger.LogInformation("context.GameProcess.HasExited: {Value}", context.GameProcess.HasExited);
if (!context.GameProcess.HasExited && context.FpsAddress != 0U)
{
IslandState state = UpdateIslandEnvironment(handle, context, launchOptions);
context.Logger.LogDebug("Island Environment State: {State}", state);
IslandEnvironmentView view = UpdateIslandEnvironment(handle, context, launchOptions);
context.Logger.LogDebug("Island Environment|{State}|{Error}", view.State, view.LastError);
context.Report();
}
else
@@ -91,12 +91,12 @@ internal sealed class IslandGameFpsUnlocker : GameFpsUnlocker
}
}
private unsafe IslandState UpdateIslandEnvironment(nint handle, GameFpsUnlockerContext context, LaunchOptions launchOptions)
private unsafe IslandEnvironmentView UpdateIslandEnvironment(nint handle, GameFpsUnlockerContext context, LaunchOptions launchOptions)
{
IslandEnvironment* pIslandEnvironment = (IslandEnvironment*)handle;
pIslandEnvironment->Address = context.FpsAddress;
pIslandEnvironment->Value = launchOptions.TargetFps;
return pIslandEnvironment->State;
return *(IslandEnvironmentView*)&pIslandEnvironment;
}
}

View File

@@ -6,8 +6,7 @@ using Snap.Hutao.Core.Logging;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Service.Notification;
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.View.Helper;
using Snap.Hutao.View.Page;
using Snap.Hutao.UI.Xaml.View.Page;
using Windows.Foundation;
namespace Snap.Hutao.Service.Navigation;
@@ -200,7 +199,7 @@ internal sealed class NavigationService : INavigationService, INavigationInitial
else
{
NavigationViewItem? target = EnumerateMenuItems(NavigationView.MenuItems)
.SingleOrDefault(menuItem => NavHelper.GetNavigateTo(menuItem) == pageType);
.SingleOrDefault(menuItem => NavigationViewItemHelper.GetNavigateTo(menuItem) == pageType);
NavigationView.SelectedItem = target;
}
@@ -214,12 +213,12 @@ internal sealed class NavigationService : INavigationService, INavigationInitial
selected = NavigationView?.SelectedItem as NavigationViewItem;
Type? targetType = args.IsSettingsInvoked
? typeof(SettingPage)
: NavHelper.GetNavigateTo(selected);
: NavigationViewItemHelper.GetNavigateTo(selected);
// ignore item that doesn't have nav type specified
if (targetType is not null)
{
INavigationAwaiter navigationAwaiter = new NavigationExtra(NavHelper.GetExtraData(selected));
INavigationAwaiter navigationAwaiter = new NavigationExtra(NavigationViewItemHelper.GetExtraData(selected));
Navigate(targetType, navigationAwaiter, false);
}
}

View File

@@ -145,6 +145,7 @@
<None Remove="Resource\WelcomeView_Background.png" />
<None Remove="Service\Game\Automation\ScreenCapture\GameScreenCaptureDebugPreviewWindow.xaml" />
<None Remove="stylecop.json" />
<None Remove="UI\Xaml\View\Window\WebView2Window.xaml" />
<None Remove="View\Card\AchievementCard.xaml" />
<None Remove="View\Card\CardBlock.xaml" />
<None Remove="View\Card\DailyNoteCard.xaml" />
@@ -165,29 +166,29 @@
<None Remove="View\Control\StatisticsCard.xaml" />
<None Remove="View\Control\StatisticsSegmented.xaml" />
<None Remove="View\Control\WebViewer.xaml" />
<None Remove="View\Dialog\AchievementArchiveCreateDialog.xaml" />
<None Remove="View\Dialog\AchievementImportDialog.xaml" />
<None Remove="View\Dialog\CultivateProjectDialog.xaml" />
<None Remove="View\Dialog\CultivatePromotionDeltaBatchDialog.xaml" />
<None Remove="View\Dialog\CultivatePromotionDeltaDialog.xaml" />
<None Remove="View\Dialog\DailyNoteNotificationDialog.xaml" />
<None Remove="View\Dialog\DailyNoteWebhookDialog.xaml" />
<None Remove="View\Dialog\GachaLogImportDialog.xaml" />
<None Remove="View\Dialog\GachaLogRefreshProgressDialog.xaml" />
<None Remove="View\Dialog\GachaLogUrlDialog.xaml" />
<None Remove="View\Dialog\GeetestCustomUrlDialog.xaml" />
<None Remove="View\Dialog\HutaoPassportLoginDialog.xaml" />
<None Remove="View\Dialog\HutaoPassportRegisterDialog.xaml" />
<None Remove="View\Dialog\HutaoPassportResetPasswordDialog.xaml" />
<None Remove="View\Dialog\HutaoPassportUnregisterDialog.xaml" />
<None Remove="View\Dialog\LaunchGameAccountNameDialog.xaml" />
<None Remove="View\Dialog\LaunchGameConfigurationFixDialog.xaml" />
<None Remove="View\Dialog\LaunchGamePackageConvertDialog.xaml" />
<None Remove="View\Dialog\ReconfirmDialog.xaml" />
<None Remove="View\Dialog\SpiralAbyssUploadRecordHomaNotLoginDialog.xaml" />
<None Remove="View\Dialog\UpdatePackageDownloadConfirmDialog.xaml" />
<None Remove="View\Dialog\UserDialog.xaml" />
<None Remove="View\Dialog\UserQRCodeDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\AchievementArchiveCreateDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\AchievementImportDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\CultivateProjectDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\CultivatePromotionDeltaBatchDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\CultivatePromotionDeltaDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\DailyNoteNotificationDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\DailyNoteWebhookDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\GachaLogImportDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\GachaLogRefreshProgressDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\GachaLogUrlDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\GeetestCustomUrlDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\HutaoPassportLoginDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\HutaoPassportRegisterDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\HutaoPassportResetPasswordDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\HutaoPassportUnregisterDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\LaunchGameAccountNameDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\LaunchGameConfigurationFixDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\LaunchGamePackageConvertDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\ReconfirmDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\SpiralAbyssUploadRecordHomaNotLoginDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\UpdatePackageDownloadConfirmDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\UserDialog.xaml" />
<None Remove="UI\Xaml\View\Dialog\UserQRCodeDialog.xaml" />
<None Remove="View\Guide\GuideView.xaml" />
<None Remove="View\InfoBarView.xaml" />
<None Remove="View\MainView.xaml" />
@@ -386,66 +387,11 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\SpiralAbyssUploadRecordHomaNotLoginDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\UpdatePackageDownloadConfirmDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\LaunchGameConfigurationFixDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Page\FeedbackPage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\ReconfirmDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\UserQRCodeDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\HutaoPassportUnregisterDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\HutaoPassportResetPasswordDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\HutaoPassportRegisterDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\HutaoPassportLoginDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\DailyNoteWebhookDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="Control\Image\CachedImage.xaml">
@@ -465,24 +411,12 @@
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\CultivatePromotionDeltaBatchDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Control\StatisticsSegmented.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\GeetestCustomUrlDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Control\WebViewer.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -544,11 +478,6 @@
</ItemGroup>
<!-- Pages -->
<ItemGroup>
<Page Update="View\Dialog\LaunchGamePackageConvertDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Page\TestPage.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -564,16 +493,6 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\CultivatePromotionDeltaDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\CultivateProjectDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Page\CultivationPage.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -584,11 +503,6 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\DailyNoteNotificationDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Page\DailyNotePage.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -599,11 +513,6 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\LaunchGameAccountNameDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Page\LoginMihoyoUserPage.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -619,26 +528,11 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\GachaLogUrlDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Page\AvatarPropertyPage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\AchievementArchiveCreateDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\AchievementImportDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Control\DescParamComboBox.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -699,31 +593,16 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\UserDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Control\ItemIcon.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\GachaLogImportDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Control\StatisticsCard.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\GachaLogRefreshProgressDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Page\GachaLogPage.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -764,11 +643,6 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Folder Include="UI\Xaml\Control\Image\" />
<Folder Include="UI\Shell\" />
<Folder Include="View\Converter\" />
</ItemGroup>
<ItemGroup>
<Page Update="UI\Xaml\Control\Card\HorizontalCard.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -779,4 +653,13 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Folder Include="UI\Xaml\View\Card\" />
<Folder Include="UI\Xaml\View\Page\" />
</ItemGroup>
<ItemGroup>
<Page Update="UI\Xaml\View\Window\WebView2Window.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
</Project>

View File

@@ -1,6 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"
xmlns:shux="using:Snap.Hutao.UI.Xaml"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image">
@@ -12,7 +13,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="shuxcc:CardBlock">
<Grid>
<Grid Style="{ThemeResource GridCardStyle}">
<StackPanel VerticalAlignment="Center">
<shuxci:CachedImage shux:FrameworkElementHelper.SquareLength="{TemplateBinding IconSquareLength}" Source="{TemplateBinding ImageSource}"/>
<TextBlock
@@ -25,9 +26,10 @@
Margin="8"
HorizontalAlignment="Right"
VerticalAlignment="Top"
cw:FrameworkElementExtensions.AncestorType="shuxcc:CardBlock"
shux:FrameworkElementHelper.SquareLength="8"
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
Visibility="{Binding IsDotVisible, Source={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"/>
Visibility="{Binding (cw:FrameworkElementExtensions.Ancestor).IsDotVisible, RelativeSource={RelativeSource Self}, Converter={StaticResource BoolToVisibilityConverter}}"/>
</Grid>
</ControlTemplate>
</Setter.Value>

View File

@@ -4,16 +4,11 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Helper;
namespace Snap.Hutao.UI.Xaml.Control;
/// <summary>
/// 导航项帮助类
/// This type can't be internal
/// </summary>
[HighQuality]
[SuppressMessage("", "SH001")]
[DependencyProperty("NavigateTo", typeof(Type), IsAttached = true, AttachedType = typeof(NavigationViewItem))]
[DependencyProperty("ExtraData", typeof(object), IsAttached = true, AttachedType = typeof(NavigationViewItem))]
public sealed partial class NavHelper
public sealed partial class NavigationViewItemHelper
{
}

View File

@@ -6,7 +6,6 @@ using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Markup;
using Microsoft.UI.Xaml.Navigation;
using Snap.Hutao.Service.Navigation;
using Snap.Hutao.View.Helper;
using Snap.Hutao.ViewModel.Abstraction;
namespace Snap.Hutao.UI.Xaml.Control;
@@ -15,7 +14,6 @@ namespace Snap.Hutao.UI.Xaml.Control;
[SuppressMessage("", "CA1001")]
internal class ScopedPage : Page
{
private readonly RoutedEventHandler unloadEventHandler;
private readonly CancellationTokenSource viewCancellationTokenSource = new();
private readonly IServiceScope pageScope;
@@ -23,8 +21,7 @@ internal class ScopedPage : Page
protected ScopedPage()
{
unloadEventHandler = OnUnloaded;
Unloaded += unloadEventHandler;
Unloaded += OnUnloaded;
pageScope = Ioc.Default.GetRequiredService<IScopedPageScopeReferenceTracker>().CreateScope();
}
@@ -98,7 +95,7 @@ internal class ScopedPage : Page
return;
}
Unloaded -= unloadEventHandler;
Unloaded -= OnUnloaded;
}
private void DisposeViewModel()

View File

@@ -1,4 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TransitionCollection x:Key="AddDeleteThemeTransitions">
<AddDeleteThemeTransition/>
</TransitionCollection>
<TransitionCollection x:Key="ContentThemeTransitions">
<ContentThemeTransition/>
</TransitionCollection>
@@ -11,13 +14,13 @@
<ReorderThemeTransition/>
<EntranceThemeTransition IsStaggeringEnabled="False"/>
</TransitionCollection>
<TransitionCollection x:Key="NavigationThemeTransitions">
<NavigationThemeTransition/>
</TransitionCollection>
<TransitionCollection x:Key="ReorderThemeTransitions">
<ReorderThemeTransition/>
</TransitionCollection>
<TransitionCollection x:Key="RepositionThemeTransitions">
<RepositionThemeTransition/>
</TransitionCollection>
<TransitionCollection x:Key="NavigationThemeTransitions">
<NavigationThemeTransition/>
</TransitionCollection>
</ResourceDictionary>

View File

@@ -4,7 +4,7 @@
using Microsoft.UI.Xaml;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
[DependencyProperty("VisibleValue", typeof(object))]
[DependencyProperty("CollapsedValue", typeof(object))]

View File

@@ -5,20 +5,20 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Markup;
using Snap.Hutao.UI.Xaml.Control;
namespace Snap.Hutao.View.Helper;
namespace Snap.Hutao.UI.Xaml;
internal sealed class DeferContentLoader : IDeferContentLoader
{
private readonly WeakReference<FrameworkElement> reference = new(default!);
private readonly WeakReference<FrameworkElement> contentHost = new(default!);
public DeferContentLoader(FrameworkElement element)
{
reference.SetTarget(element);
contentHost.SetTarget(element);
}
public DependencyObject? Load(string name)
{
if (reference.TryGetTarget(out FrameworkElement? element))
if (contentHost.TryGetTarget(out FrameworkElement? element))
{
return element.FindName(name) as DependencyObject;
}
@@ -28,9 +28,9 @@ internal sealed class DeferContentLoader : IDeferContentLoader
public void Unload(DependencyObject @object)
{
if (reference.TryGetTarget(out FrameworkElement? element) && element is ScopedPage scopedPage)
if (contentHost.TryGetTarget(out FrameworkElement? element) && element is ScopedPage scopedPage)
{
scopedPage.UnloadObjectOverride(@object);
scopedPage.UnloadObjectOverride(@object);
}
else
{

View File

@@ -3,7 +3,7 @@
using Microsoft.UI.Xaml;
namespace Snap.Hutao.View.Helper;
namespace Snap.Hutao.UI.Xaml;
internal interface IDeferContentLoader
{

View File

@@ -7,6 +7,7 @@ namespace Snap.Hutao.UI.Xaml;
[SuppressMessage("", "SH001")]
[DependencyProperty("VisibilityObject", typeof(object), null, nameof(OnVisibilityObjectChanged), IsAttached = true, AttachedType = typeof(UIElement))]
[DependencyProperty("VisibilityBoolean", typeof(bool), null, nameof(OnVisibilityBooleanChanged), IsAttached = true, AttachedType = typeof(UIElement))]
[DependencyProperty("OpacityObject", typeof(object), null, nameof(OnOpacityObjectChanged), IsAttached = true, AttachedType = typeof(UIElement))]
public sealed partial class UIElementHelper
{
@@ -21,4 +22,10 @@ public sealed partial class UIElementHelper
UIElement element = (UIElement)dp;
element.Opacity = e.NewValue is null ? 0D : 1D;
}
private static void OnVisibilityBooleanChanged(DependencyObject dp, DependencyPropertyChangedEventArgs e)
{
UIElement element = (UIElement)dp;
element.Visibility = e.NewValue is true ? Visibility.Visible : Visibility.Collapsed;
}
}

View File

@@ -1,5 +1,5 @@
<Button
x:Class="Snap.Hutao.View.Card.AchievementCard"
x:Class="Snap.Hutao.UI.Xaml.View.Card.AchievementCard"
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"

View File

@@ -2,18 +2,11 @@
// Licensed under the MIT license.
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.UI.Xaml;
namespace Snap.Hutao.View.Card;
namespace Snap.Hutao.UI.Xaml.View.Card;
/// <summary>
/// 成就卡片
/// </summary>
internal sealed partial class AchievementCard : Button
{
/// <summary>
/// 构造一个新的成就卡片
/// </summary>
public AchievementCard()
{
this.InitializeDataContext<ViewModel.Achievement.AchievementViewModelSlim>();

View File

@@ -1,5 +1,5 @@
<Button
x:Class="Snap.Hutao.View.Card.DailyNoteCard"
x:Class="Snap.Hutao.UI.Xaml.View.Card.DailyNoteCard"
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"
@@ -7,9 +7,9 @@
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
xmlns:shme="using:Snap.Hutao.Model.Entity"
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvc="using:Snap.Hutao.View.Control"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shvd="using:Snap.Hutao.ViewModel.DailyNote"
Padding="0"
HorizontalAlignment="Stretch"

View File

@@ -2,9 +2,8 @@
// Licensed under the MIT license.
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.UI.Xaml;
namespace Snap.Hutao.View.Card;
namespace Snap.Hutao.UI.Xaml.View.Card;
/// <summary>
/// 实时便笺卡片

View File

@@ -1,5 +1,5 @@
<Button
x:Class="Snap.Hutao.View.Card.GachaStatisticsCard"
x:Class="Snap.Hutao.UI.Xaml.View.Card.GachaStatisticsCard"
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"

View File

@@ -2,9 +2,8 @@
// Licensed under the MIT license.
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.UI.Xaml;
namespace Snap.Hutao.View.Card;
namespace Snap.Hutao.UI.Xaml.View.Card;
/// <summary>
/// 祈愿记录卡片

View File

@@ -1,5 +1,5 @@
<Button
x:Class="Snap.Hutao.View.Card.LaunchGameCard"
x:Class="Snap.Hutao.UI.Xaml.View.Card.LaunchGameCard"
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"

View File

@@ -2,9 +2,8 @@
// Licensed under the MIT license.
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.UI.Xaml;
namespace Snap.Hutao.View.Card;
namespace Snap.Hutao.UI.Xaml.View.Card;
/// <summary>
/// 启动游戏卡片
@@ -19,4 +18,4 @@ internal sealed partial class LaunchGameCard : Button
this.InitializeDataContext<ViewModel.Game.LaunchGameViewModelSlim>();
InitializeComponent();
}
}
}

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.AchievementArchiveCreateDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.AchievementArchiveCreateDialog"
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"

View File

@@ -3,7 +3,7 @@
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 成就存档创建对话框

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.AchievementImportDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.AchievementImportDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cwc="using:CommunityToolkit.WinUI.Controls"

View File

@@ -6,7 +6,7 @@ using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Model.InterChange.Achievement;
using Snap.Hutao.Service.Achievement;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 成就对话框

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.CultivateProjectDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.CultivateProjectDialog"
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"

View File

@@ -5,7 +5,7 @@ using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Model.Entity;
using Snap.Hutao.Service.User;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 养成计划对话框

View File

@@ -1,14 +1,14 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.CultivatePromotionDeltaBatchDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.CultivatePromotionDeltaBatchDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cwc="using:CommunityToolkit.WinUI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvd="using:Snap.Hutao.View.Dialog"
xmlns:shuxvd="using:Snap.Hutao.UI.Xaml.View.Dialog"
Title="{shuxm:ResourceString Name=ViewDialogCultivatePromotionDeltaBatchTitle}"
d:DataContext="{d:DesignInstance shvd:CultivatePromotionDeltaDialog}"
d:DataContext="{d:DesignInstance shuxvd:CultivatePromotionDeltaDialog}"
CloseButtonText="{shuxm:ResourceString Name=ContentDialogCancelCloseButtonText}"
DefaultButton="Primary"
PrimaryButtonText="{shuxm:ResourceString Name=ContentDialogConfirmPrimaryButtonText}"

View File

@@ -5,7 +5,7 @@ using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Core.Setting;
using Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
[DependencyProperty("PromotionDelta", typeof(AvatarPromotionDelta))]
internal sealed partial class CultivatePromotionDeltaBatchDialog : ContentDialog

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.CultivatePromotionDeltaDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.CultivatePromotionDeltaDialog"
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"

View File

@@ -6,7 +6,7 @@ using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Model.Calculable;
using Snap.Hutao.Web.Hoyolab.Takumi.Event.Calculate;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 养成计算对话框

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.DailyNoteNotificationDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.DailyNoteNotificationDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:clw="using:CommunityToolkit.WinUI.Controls"

View File

@@ -4,7 +4,7 @@
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Model.Entity;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 实时便笺通知设置对话框

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.DailyNoteWebhookDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.DailyNoteWebhookDialog"
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"

View File

@@ -3,7 +3,7 @@
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
[DependencyProperty("Text", typeof(string))]
internal sealed partial class DailyNoteWebhookDialog : ContentDialog

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.GachaLogImportDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.GachaLogImportDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cwc="using:CommunityToolkit.WinUI.Controls"

View File

@@ -5,7 +5,7 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Model.InterChange.GachaLog;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 祈愿记录导入对话框

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.GachaLogRefreshProgressDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.GachaLogRefreshProgressDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cwc="using:CommunityToolkit.WinUI.Controls"

View File

@@ -5,7 +5,7 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Service.GachaLog;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 祈愿记录刷新进度对话框

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.GachaLogUrlDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.GachaLogUrlDialog"
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"

View File

@@ -3,7 +3,7 @@
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 祈愿记录Url对话框

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.GeetestCustomUrlDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.GeetestCustomUrlDialog"
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"

View File

@@ -4,7 +4,7 @@
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Service;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
[DependencyProperty("Text", typeof(string))]
internal sealed partial class GeetestCustomUrlDialog : ContentDialog

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.HutaoPassportLoginDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.HutaoPassportLoginDialog"
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"

View File

@@ -3,7 +3,7 @@
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
[DependencyProperty("UserName", typeof(string))]
[DependencyProperty("Password", typeof(string))]

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.HutaoPassportRegisterDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.HutaoPassportRegisterDialog"
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"

View File

@@ -7,7 +7,7 @@ using Snap.Hutao.Service.Notification;
using Snap.Hutao.Web.Hutao;
using Snap.Hutao.Web.Hutao.Response;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
[DependencyProperty("UserName", typeof(string))]
[DependencyProperty("Password", typeof(string))]

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.HutaoPassportResetPasswordDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.HutaoPassportResetPasswordDialog"
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"

View File

@@ -7,7 +7,7 @@ using Snap.Hutao.Service.Notification;
using Snap.Hutao.Web.Hutao;
using Snap.Hutao.Web.Hutao.Response;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
[DependencyProperty("UserName", typeof(string))]
[DependencyProperty("Password", typeof(string))]

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.HutaoPassportUnregisterDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.HutaoPassportUnregisterDialog"
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"

View File

@@ -7,7 +7,7 @@ using Snap.Hutao.Service.Notification;
using Snap.Hutao.Web.Hutao;
using Snap.Hutao.Web.Hutao.Response;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
[DependencyProperty("UserName", typeof(string))]
[DependencyProperty("Password", typeof(string))]

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.LaunchGameAccountNameDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.LaunchGameAccountNameDialog"
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"

View File

@@ -3,7 +3,7 @@
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 游戏账号命名对话框

View File

@@ -1,14 +1,14 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.LaunchGameConfigurationFixDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.LaunchGameConfigurationFixDialog"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvd="using:Snap.Hutao.View.Dialog"
xmlns:shuxvd="using:Snap.Hutao.UI.Xaml.View.Dialog"
Title="{shuxm:ResourceString Name=ViewDialogLaunchGameConfigurationFixDialogTitle}"
d:DataContext="{d:DesignInstance shvd:LaunchGameConfigurationFixDialog}"
d:DataContext="{d:DesignInstance shuxvd:LaunchGameConfigurationFixDialog}"
CloseButtonText="{shuxm:ResourceString Name=ContentDialogCancelCloseButtonText}"
PrimaryButtonText="{shuxm:ResourceString Name=ContentDialogConfirmPrimaryButtonText}"
Style="{StaticResource DefaultContentDialogStyle}"

View File

@@ -4,7 +4,7 @@
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Service.Game.Scheme;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
[DependencyProperty("KnownSchemes", typeof(IEnumerable<LaunchScheme>))]
[DependencyProperty("SelectedScheme", typeof(LaunchScheme))]

View File

@@ -1,13 +1,13 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.LaunchGamePackageConvertDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.LaunchGamePackageConvertDialog"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvd="using:Snap.Hutao.View.Dialog"
xmlns:shuxvd="using:Snap.Hutao.UI.Xaml.View.Dialog"
Title="{shuxm:ResourceString Name=ViewDialogLaunchGamePackageConvertTitle}"
d:DataContext="{d:DesignInstance shvd:LaunchGamePackageConvertDialog}"
d:DataContext="{d:DesignInstance shuxvd:LaunchGamePackageConvertDialog}"
Style="{StaticResource DefaultContentDialogStyle}"
mc:Ignorable="d">

View File

@@ -5,7 +5,7 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Service.Game.Package;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 启动游戏客户端转换对话框

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.ReconfirmDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.ReconfirmDialog"
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"

View File

@@ -4,7 +4,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
[DependencyProperty("Text", typeof(string), default(string), nameof(OnTextChanged))]
internal sealed partial class ReconfirmDialog : ContentDialog

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.SpiralAbyssUploadRecordHomaNotLoginDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.SpiralAbyssUploadRecordHomaNotLoginDialog"
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"

View File

@@ -3,7 +3,7 @@
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
internal sealed partial class SpiralAbyssUploadRecordHomaNotLoginDialog : ContentDialog
{

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.UpdatePackageDownloadConfirmDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.UpdatePackageDownloadConfirmDialog"
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"

View File

@@ -3,7 +3,7 @@
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
internal sealed partial class UpdatePackageDownloadConfirmDialog : ContentDialog
{

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.UserDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.UserDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cwc="using:CommunityToolkit.WinUI.Controls"

View File

@@ -4,7 +4,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
/// <summary>
/// 添加用户对话框

View File

@@ -1,5 +1,5 @@
<ContentDialog
x:Class="Snap.Hutao.View.Dialog.UserQRCodeDialog"
x:Class="Snap.Hutao.UI.Xaml.View.Dialog.UserQRCodeDialog"
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"

View File

@@ -13,7 +13,7 @@ using System.Collections.Specialized;
using System.IO;
using System.Web;
namespace Snap.Hutao.View.Dialog;
namespace Snap.Hutao.UI.Xaml.View.Dialog;
[DependencyProperty("QRCodeSource", typeof(ImageSource))]
internal sealed partial class UserQRCodeDialog : ContentDialog, IDisposable

View File

@@ -1,5 +1,5 @@
<UserControl
x:Class="Snap.Hutao.View.Guide.GuideView"
x:Class="Snap.Hutao.UI.Xaml.View.GuideView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"

View File

@@ -5,7 +5,7 @@ using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.UI.Xaml;
using Snap.Hutao.ViewModel.Guide;
namespace Snap.Hutao.View.Guide;
namespace Snap.Hutao.UI.Xaml.View;
/// <summary>
/// 指引视图

View File

@@ -1,5 +1,5 @@
<UserControl
x:Class="Snap.Hutao.View.InfoBarView"
x:Class="Snap.Hutao.UI.Xaml.View.InfoBarView"
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"
@@ -106,11 +106,8 @@
ItemContainerTransitions="{StaticResource RepositionThemeTransitions}"
ItemTemplateSelector="{StaticResource InfoBarTemplateSelector}"
ItemsSource="{x:Bind InfoBars}"
Visibility="{x:Bind VisibilityButton.IsChecked, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}">
<ItemsControl.Transitions>
<AddDeleteThemeTransition/>
</ItemsControl.Transitions>
</ItemsControl>
Transitions="{ThemeResource AddDeleteThemeTransitions}"
Visibility="{x:Bind VisibilityButton.IsChecked, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}"/>
<Border
Margin="16"

View File

@@ -8,7 +8,7 @@ using Snap.Hutao.Core.Setting;
using Snap.Hutao.Service.Notification;
using System.Collections.ObjectModel;
namespace Snap.Hutao.View;
namespace Snap.Hutao.UI.Xaml.View;
[DependencyProperty("InfoBars", typeof(ObservableCollection<InfoBarOptions>))]
internal sealed partial class InfoBarView : UserControl

View File

@@ -1,5 +1,5 @@
<UserControl
x:Class="Snap.Hutao.View.MainView"
x:Class="Snap.Hutao.UI.Xaml.View.MainView"
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"
@@ -9,10 +9,9 @@
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxdcs="using:Snap.Hutao.UI.Xaml.Data.Converter.Specialized"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shv="using:Snap.Hutao.View"
xmlns:shvh="using:Snap.Hutao.View.Helper"
xmlns:shuxv="using:Snap.Hutao.UI.Xaml.View"
xmlns:shuxvp="using:Snap.Hutao.UI.Xaml.View.Page"
xmlns:shvm="using:Snap.Hutao.ViewModel"
xmlns:shvp="using:Snap.Hutao.View.Page"
d:DataContext="{d:DesignInstance Type=shvm:MainViewModel}"
mc:Ignorable="d">
@@ -55,70 +54,70 @@
<NavigationView.MenuItems>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:AnnouncementPage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:AnnouncementPage"
Content="{shuxm:ResourceString Name=ViewAnnouncementHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/Announcement.png}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:FeedbackPage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:FeedbackPage"
Content="{shuxm:ResourceString Name=ViewFeedbackHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/Feedback.png}"/>
<NavigationViewItemHeader Content="{shuxm:ResourceString Name=ViewToolHeader}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:LaunchGamePage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:LaunchGamePage"
Content="{shuxm:ResourceString Name=ViewLaunchGameHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/LaunchGame.png}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:GachaLogPage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:GachaLogPage"
Content="{shuxm:ResourceString Name=ViewGachaLogHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/GachaLog.png}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:AchievementPage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:AchievementPage"
Content="{shuxm:ResourceString Name=ViewAchievementHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/Achievement.png}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:DailyNotePage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:DailyNotePage"
Content="{shuxm:ResourceString Name=ViewDailyNoteHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/DailyNote.png}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:AvatarPropertyPage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:AvatarPropertyPage"
Content="{shuxm:ResourceString Name=ViewAvatarPropertyHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/AvatarProperty.png}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:SpiralAbyssRecordPage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:SpiralAbyssRecordPage"
Content="{shuxm:ResourceString Name=ViewSpiralAbyssHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/SpiralAbyss.png}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:CultivationPage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:CultivationPage"
Content="{shuxm:ResourceString Name=ViewCultivationHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/Cultivation.png}"/>
<NavigationViewItemHeader Content="{shuxm:ResourceString Name=ViewDataHeader}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:WikiAvatarPage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:WikiAvatarPage"
Content="{shuxm:ResourceString Name=ViewWikiAvatarHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/WikiAvatar.png}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:WikiWeaponPage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:WikiWeaponPage"
Content="{shuxm:ResourceString Name=ViewWikiWeaponHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/WikiWeapon.png}"/>
<NavigationViewItem
shvh:NavHelper.NavigateTo="shvp:WikiMonsterPage"
shuxc:NavigationViewItemHelper.NavigateTo="shuxvp:WikiMonsterPage"
Content="{shuxm:ResourceString Name=ViewWikiMonsterHeader}"
Icon="{shuxm:BitmapIcon Source=ms-appx:///Resource/Navigation/WikiMonster.png}"/>
</NavigationView.MenuItems>
<NavigationView.PaneFooter>
<shv:UserView/>
<shuxv:UserView/>
</NavigationView.PaneFooter>
<Frame
@@ -127,6 +126,6 @@
UseLayoutRounding="True"/>
</NavigationView>
<shv:InfoBarView/>
<shuxv:InfoBarView/>
</Grid>
</UserControl>

View File

@@ -4,10 +4,10 @@
using Microsoft.UI.Xaml.Controls;
using Snap.Hutao.Service.Navigation;
using Snap.Hutao.UI.Xaml;
using Snap.Hutao.View.Page;
using Snap.Hutao.UI.Xaml.View.Page;
using Snap.Hutao.ViewModel;
namespace Snap.Hutao.View;
namespace Snap.Hutao.UI.Xaml.View;
/// <summary>
/// 主视图

View File

@@ -1,5 +1,5 @@
<shuxc:ScopedPage
x:Class="Snap.Hutao.View.Page.AchievementPage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.AchievementPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"

View File

@@ -4,7 +4,7 @@
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.ViewModel.Achievement;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
/// <summary>
/// 成就页面

View File

@@ -1,5 +1,5 @@
<shuxc:ScopedPage
x:Class="Snap.Hutao.View.Page.AnnouncementPage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.AnnouncementPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"
@@ -127,7 +127,7 @@
</Grid>
<!-- 公告详情网页视图 -->
<FlyoutBase.AttachedFlyout>
<!--<FlyoutBase.AttachedFlyout>
<Flyout LightDismissOverlayMode="On" Placement="Full">
<Flyout.FlyoutPresenterStyle>
<Style BasedOn="{StaticResource DefaultFlyoutPresenterStyle}" TargetType="FlyoutPresenter">
@@ -138,12 +138,12 @@
</Flyout.FlyoutPresenterStyle>
<shvco:AnnouncementContentViewer Announcement="{Binding}"/>
</Flyout>
</FlyoutBase.AttachedFlyout>
</FlyoutBase.AttachedFlyout>-->
<mxi:Interaction.Behaviors>
<mxic:EventTriggerBehavior EventName="Tapped">
<!--<mxic:EventTriggerBehavior EventName="Tapped">
<shuxba:ShowAttachedFlyoutAction/>
</mxic:EventTriggerBehavior>
</mxic:EventTriggerBehavior>-->
<mxic:EventTriggerBehavior EventName="PointerEntered">
<shuxba:StartAnimationActionNoThrow Animation="{Binding ElementName=ImageZoomInAnimation}" TargetObject="{Binding ElementName=ImageZoomBorder}"/>
</mxic:EventTriggerBehavior>

View File

@@ -4,7 +4,7 @@
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.ViewModel.Home;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
/// <summary>
/// 公告页面

View File

@@ -1,5 +1,5 @@
<shuxc:ScopedPage
x:Class="Snap.Hutao.View.Page.AvatarPropertyPage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.AvatarPropertyPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"

View File

@@ -4,7 +4,7 @@
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.ViewModel.AvatarProperty;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
/// <summary>
/// 角色属性页

View File

@@ -1,5 +1,5 @@
<shuxc:ScopedPage
x:Class="Snap.Hutao.View.Page.CultivationPage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.CultivationPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"

View File

@@ -4,7 +4,7 @@
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.ViewModel.Cultivation;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
/// <summary>
/// 养成页面

View File

@@ -1,5 +1,5 @@
<shuxc:ScopedPage
x:Class="Snap.Hutao.View.Page.DailyNotePage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.DailyNotePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"

View File

@@ -4,7 +4,7 @@
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.ViewModel.DailyNote;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
/// <summary>
/// 实时便笺页面

View File

@@ -1,5 +1,5 @@
<shuxc:ScopedPage
x:Class="Snap.Hutao.View.Page.FeedbackPage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.FeedbackPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:clw="using:CommunityToolkit.Labs.WinUI"

View File

@@ -4,7 +4,7 @@
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.ViewModel.Feedback;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
internal sealed partial class FeedbackPage : ScopedPage
{

View File

@@ -1,5 +1,5 @@
<shuxc:ScopedPage
x:Class="Snap.Hutao.View.Page.GachaLogPage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.GachaLogPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"

View File

@@ -4,7 +4,7 @@
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.ViewModel.GachaLog;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
/// <summary>
/// 祈愿记录页面

View File

@@ -8,7 +8,7 @@ using Snap.Hutao.Service.User;
using Snap.Hutao.Web.Bridge;
using Snap.Hutao.Web.WebView2;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
internal interface ISupportLoginByWebView
{

View File

@@ -1,5 +1,5 @@
<shuxc:ScopedPage
x:Class="Snap.Hutao.View.Page.LaunchGamePage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.LaunchGamePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"

View File

@@ -4,7 +4,7 @@
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.ViewModel.Game;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
/// <summary>
/// 启动游戏页面

View File

@@ -1,5 +1,5 @@
<Page
x:Class="Snap.Hutao.View.Page.LoginHoyoverseUserPage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.LoginHoyoverseUserPage"
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"

View File

@@ -5,6 +5,7 @@ using Microsoft.UI.Xaml;
using Microsoft.Web.WebView2.Core;
using Snap.Hutao.Service.Notification;
using Snap.Hutao.Service.User;
using Snap.Hutao.UI.Xaml.View.Page;
using Snap.Hutao.Web;
using Snap.Hutao.Web.Hoyolab;
using Snap.Hutao.Web.Hoyolab.Takumi.Auth;
@@ -13,7 +14,7 @@ using Snap.Hutao.Web.Request.Builder.Abstraction;
using Snap.Hutao.Web.Response;
using System.Net.Http;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
/// <summary>
/// 登录米哈游通行证页面

View File

@@ -1,5 +1,5 @@
<Page
x:Class="Snap.Hutao.View.Page.LoginMihoyoUserPage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.LoginMihoyoUserPage"
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"

View File

@@ -5,12 +5,13 @@ using Microsoft.UI.Xaml;
using Microsoft.Web.WebView2.Core;
using Snap.Hutao.Service.Notification;
using Snap.Hutao.Service.User;
using Snap.Hutao.UI.Xaml.View.Page;
using Snap.Hutao.Web.Hoyolab;
using Snap.Hutao.Web.Hoyolab.Passport;
using Snap.Hutao.Web.Hoyolab.Takumi.Auth;
using Snap.Hutao.Web.Response;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
/// <summary>
/// 登录米哈游通行证页面

View File

@@ -1,5 +1,5 @@
<shuxc:ScopedPage
x:Class="Snap.Hutao.View.Page.SettingPage"
x:Class="Snap.Hutao.UI.Xaml.View.Page.SettingPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cw="using:CommunityToolkit.WinUI"

View File

@@ -4,7 +4,7 @@
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.ViewModel.Setting;
namespace Snap.Hutao.View.Page;
namespace Snap.Hutao.UI.Xaml.View.Page;
/// <summary>
/// 设置页面

Some files were not shown because too many files have changed in this diff Show More