This commit is contained in:
Lightczx
2024-06-24 16:04:50 +08:00
parent c9df6ac77b
commit 83347dfafb
68 changed files with 286 additions and 254 deletions

View File

@@ -1,3 +1,5 @@
files:
- source: /src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.resx
translation: /src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.%osx_locale%.resx
- source: /src/Snap.Hutao/Snap.Hutao/Resource/Localization/SHRegex.resx
translation: /src/Snap.Hutao/Snap.Hutao/Resource/Localization/SHRegex.%osx_locale%.resx

View File

@@ -9,6 +9,9 @@
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.SettingsControls/SettingsCard/SettingsCard.xaml"/>
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.TokenizingTextBox/TokenizingTextBox.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Loading.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Card/CardBlock.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Card/CardProgressBar.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Card/HorizontalCard.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Image/CachedImage.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/Card.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/Color.xaml"/>
@@ -30,7 +33,6 @@
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/TransitionCollection.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/Uri.xaml"/>
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/WindowOverride.xaml"/>
<ResourceDictionary Source="ms-appx:///View/Card/Primitive/CardProgressBar.xaml"/>
<ResourceDictionary Source="ms-appx:///View/Control/RateDeltaTextBlockStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -3,7 +3,7 @@
using Snap.Hutao.Core.ExceptionService;
using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -5,7 +5,7 @@ using Snap.Hutao.Core.ExceptionService;
using Snap.Hutao.Metadata;
using Snap.Hutao.Model.Metadata.Avatar;
using Snap.Hutao.Model.Primitive;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;

View File

@@ -2,7 +2,7 @@
// Licensed under the MIT license.
using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
using System.Collections.Frozen;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -2,7 +2,7 @@
// Licensed under the MIT license.
using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -4,7 +4,7 @@
using Microsoft.UI;
using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.UI.Xaml.Control.Theme;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
using System.Collections.Frozen;
using Windows.UI;

View File

@@ -2,7 +2,7 @@
// Licensed under the MIT license.
using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -1,7 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -3,7 +3,7 @@
using Snap.Hutao.Core.ExceptionService;
using Snap.Hutao.Model.Intrinsic;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
using System.Collections.Frozen;
namespace Snap.Hutao.Model.Metadata.Converter;

View File

@@ -4,8 +4,10 @@
using CommunityToolkit.Mvvm.ComponentModel;
using Microsoft.EntityFrameworkCore;
using Snap.Hutao.Core.Database;
using Snap.Hutao.Model.Entity;
using Snap.Hutao.Model.Entity.Database;
using System.Globalization;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
namespace Snap.Hutao.Service.Abstraction;
@@ -30,6 +32,18 @@ internal abstract partial class DbStoreOptions : ObservableObject
return input.ToStringOrEmpty();
}
protected void InitializeOptions(string keyLike, Expression<Func<SettingEntry, bool>> entrySelector, Action<string, string?> entryAction)
{
using (IServiceScope scope = serviceProvider.CreateScope())
{
AppDbContext appDbContext = scope.ServiceProvider.GetRequiredService<AppDbContext>();
foreach (SettingEntry entry in appDbContext.Settings.Where(entrySelector))
{
entryAction(entry.Key, entry.Value);
}
}
}
protected string GetOption(ref string? storage, string key, string defaultValue = "")
{
return GetOption(ref storage, key, () => defaultValue);

View File

@@ -3,7 +3,7 @@
namespace Snap.Hutao.Service.Abstraction;
internal interface IAppInfrastructureService
internal interface IAppInfrastructureService : IAppService
{
IServiceProvider ServiceProvider { get; }
}

View File

@@ -90,6 +90,8 @@
<None Remove="Control\Image\CachedImage.xaml" />
<None Remove="Control\Loading.xaml" />
<None Remove="Control\Panel\LayoutSwitch.xaml" />
<None Remove="UI\Xaml\Control\Card\CardBlock.xaml" />
<None Remove="UI\Xaml\Control\Card\HorizontalCard.xaml" />
<None Remove="UI\Xaml\Control\Theme\Card.xaml" />
<None Remove="UI\Xaml\Control\Theme\Color.xaml" />
<None Remove="UI\Xaml\Control\Theme\ComboBox.xaml" />
@@ -148,8 +150,6 @@
<None Remove="View\Card\DailyNoteCard.xaml" />
<None Remove="View\Card\GachaStatisticsCard.xaml" />
<None Remove="View\Card\LaunchGameCard.xaml" />
<None Remove="View\Card\Primitive\CardProgressBar.xaml" />
<None Remove="View\Card\Primitive\HorizontalCard.xaml" />
<None Remove="View\Control\BaseValueSlider.xaml" />
<None Remove="View\Control\BottomTextControl.xaml" />
<None Remove="View\Control\DescParamComboBox.xaml" />
@@ -416,11 +416,6 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Card\Primitive\HorizontalCard.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Dialog\HutaoPassportUnregisterDialog.xaml">
@@ -458,12 +453,6 @@
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Card\Primitive\CardProgressBar.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="View\Card\CardBlock.xaml">
<Generator>MSBuild:Compile</Generator>
@@ -778,5 +767,16 @@
<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>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="UI\Xaml\Control\Card\CardBlock.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,16 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.UI.Xaml.Control.Card;
[DependencyProperty("Text", typeof(string))]
[DependencyProperty("ImageSource", typeof(object))]
[DependencyProperty("IsDotVisible", typeof(bool), false)]
[DependencyProperty("IconSquareLength", typeof(double))]
internal sealed partial class CardBlock : Microsoft.UI.Xaml.Controls.Control
{
public CardBlock()
{
DefaultStyleKey = typeof(CardBlock);
}
}

View File

@@ -0,0 +1,37 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
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">
<Style BasedOn="{StaticResource DefaultCardBlockStyle}" TargetType="shuxcc:CardBlock"/>
<Style x:Key="DefaultCardBlockStyle" TargetType="shuxcc:CardBlock">
<Setter Property="IconSquareLength" Value="32"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="shuxcc:CardBlock">
<Grid>
<StackPanel VerticalAlignment="Center">
<shuxci:CachedImage shux:FrameworkElementHelper.SquareLength="{TemplateBinding IconSquareLength}" Source="{TemplateBinding ImageSource}"/>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{TemplateBinding Text}"/>
</StackPanel>
<InfoBadge
Margin="8"
HorizontalAlignment="Right"
VerticalAlignment="Top"
shux:FrameworkElementHelper.SquareLength="8"
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
Visibility="{Binding IsDotVisible, Source={RelativeSource TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@@ -5,7 +5,7 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
namespace Snap.Hutao.View.Card.Primitive;
namespace Snap.Hutao.UI.Xaml.Control.Card;
[DependencyProperty("ProgressForeground", typeof(Brush))]
[DependencyProperty("TextForeground", typeof(Brush))]
@@ -13,9 +13,10 @@ namespace Snap.Hutao.View.Card.Primitive;
[DependencyProperty("Value", typeof(double))]
[DependencyProperty("Header", typeof(string))]
[DependencyProperty("Description", typeof(string))]
internal sealed partial class CardProgressBar : ContentControl
internal sealed partial class CardProgressBar : Microsoft.UI.Xaml.Controls.Control
{
public CardProgressBar()
{
DefaultStyleKey = typeof(CardProgressBar);
}
}
}

View File

@@ -1,16 +1,16 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive">
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card">
<Style BasedOn="{StaticResource DefaultCardProgressBarStyle}" TargetType="shvcp:CardProgressBar"/>
<Style BasedOn="{StaticResource DefaultCardProgressBarStyle}" TargetType="shuxcc:CardProgressBar"/>
<Style x:Key="DefaultCardProgressBarStyle" TargetType="shvcp:CardProgressBar">
<Style x:Key="DefaultCardProgressBarStyle" TargetType="shuxcc:CardProgressBar">
<Setter Property="TextForeground" Value="{ThemeResource TextFillColorPrimaryBrush}"/>
<Setter Property="MinHeight" Value="40"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ControlTemplate TargetType="shuxcc:CardProgressBar">
<Grid MinHeight="{TemplateBinding MinHeight}" Style="{ThemeResource GridCardStyle}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
@@ -21,25 +21,25 @@
MinHeight="{TemplateBinding MinHeight}"
Background="Transparent"
CornerRadius="{StaticResource ControlCornerRadius}"
Foreground="{Binding ProgressForeground, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
Maximum="{Binding Maximum, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{TemplateBinding ProgressForeground}"
Maximum="{TemplateBinding Maximum}"
Opacity="{StaticResource LargeBackgroundProgressBarOpacity}"
Value="{Binding Value, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
Value="{TemplateBinding Value}"/>
<TextBlock
Grid.Column="0"
Margin="6,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{Binding TextForeground, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{TemplateBinding TextForeground}"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding Header, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
Text="{TemplateBinding Header}"/>
<TextBlock
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{Binding TextForeground, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
Foreground="{TemplateBinding TextForeground}"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding Description, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"/>
Text="{TemplateBinding Description}"/>
</Grid>
</ControlTemplate>
</Setter.Value>

View File

@@ -3,7 +3,7 @@
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Card.Primitive;
namespace Snap.Hutao.UI.Xaml.Control.Card;
/// <summary>
/// 保存对卡片的引用

View File

@@ -0,0 +1,16 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
namespace Snap.Hutao.UI.Xaml.Control.Card;
[DependencyProperty("Left", typeof(UIElement), default!)]
[DependencyProperty("Right", typeof(UIElement), default!)]
internal sealed partial class HorizontalCard : Microsoft.UI.Xaml.Controls.Control
{
public HorizontalCard()
{
DefaultStyleKey = typeof(HorizontalCard);
}
}

View File

@@ -0,0 +1,31 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card">
<Style BasedOn="{StaticResource DefaultHorizontalCardStyle}" TargetType="shuxcc:HorizontalCard"/>
<Style x:Key="DefaultHorizontalCardStyle" TargetType="shuxcc:HorizontalCard">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="shuxcc:HorizontalCard">
<Border Style="{StaticResource BorderCardStyle}">
<Grid Background="{TemplateBinding Background}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Child="{TemplateBinding Left}"/>
<Border
Grid.Column="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Child="{TemplateBinding Right}"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cwc="using:CommunityToolkit.WinUI.Converters"
xmlns:shmmc="using:Snap.Hutao.Model.Metadata.Converter"
xmlns:shvc="using:Snap.Hutao.View.Converter">
xmlns:shuxdc="using:Snap.Hutao.UI.Xaml.Data.Converter">
<cwc:BoolNegationConverter x:Key="BoolNegationConverter"/>
<cwc:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
<cwc:FileSizeToFriendlyStringConverter x:Key="FileSizeToFriendlyStringConverter"/>
@@ -25,12 +25,12 @@
<shmmc:PropertiesParametersDescriptor x:Key="PropertyDescriptor"/>
<shmmc:QualityColorConverter x:Key="QualityColorConverter"/>
<shmmc:WeaponTypeIconConverter x:Key="WeaponTypeIconConverter"/>
<shvc:BoolToVisibilityRevertConverter x:Key="BoolToVisibilityRevertConverter"/>
<shvc:EmptyObjectToBoolConverter x:Key="EmptyObjectToBoolConverter"/>
<shvc:EmptyObjectToBoolRevertConverter x:Key="EmptyObjectToBoolRevertConverter"/>
<shvc:EmptyObjectToVisibilityConverter x:Key="EmptyObjectToVisibilityConverter"/>
<shvc:EmptyObjectToVisibilityRevertConverter x:Key="EmptyObjectToVisibilityRevertConverter"/>
<shvc:Int32ToVisibilityConverter x:Key="Int32ToVisibilityConverter"/>
<shvc:Int32ToVisibilityRevertConverter x:Key="Int32ToVisibilityRevertConverter"/>
<shvc:StringBoolConverter x:Key="StringBoolConverter"/>
</ResourceDictionary>
<shuxdc:BoolToVisibilityRevertConverter x:Key="BoolToVisibilityRevertConverter"/>
<shuxdc:EmptyObjectToBoolConverter x:Key="EmptyObjectToBoolConverter"/>
<shuxdc:EmptyObjectToBoolRevertConverter x:Key="EmptyObjectToBoolRevertConverter"/>
<shuxdc:EmptyObjectToVisibilityConverter x:Key="EmptyObjectToVisibilityConverter"/>
<shuxdc:EmptyObjectToVisibilityRevertConverter x:Key="EmptyObjectToVisibilityRevertConverter"/>
<shuxdc:Int32ToVisibilityConverter x:Key="Int32ToVisibilityConverter"/>
<shuxdc:Int32ToVisibilityRevertConverter x:Key="Int32ToVisibilityRevertConverter"/>
<shuxdc:StringBoolConverter x:Key="StringBoolConverter"/>
</ResourceDictionary>

View File

@@ -4,7 +4,7 @@
using CommunityToolkit.WinUI.Converters;
using Microsoft.UI.Xaml;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
/// <summary>
/// This class converts a boolean value into a Visibility enumeration.

View File

@@ -5,7 +5,7 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
using Snap.Hutao.Core.ExceptionService;
namespace Snap.Hutao.UI.Xaml.Data;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
internal abstract class DependencyValueConverter<TFrom, TTo> : DependencyObject, IValueConverter
{

View File

@@ -3,7 +3,7 @@
using CommunityToolkit.WinUI.Converters;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
/// <summary>
/// This class converts a object? value into a boolean.

View File

@@ -3,7 +3,7 @@
using CommunityToolkit.WinUI.Converters;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
/// <summary>
/// This class converts a object? value into a boolean in reverse.

View File

@@ -4,7 +4,7 @@
using CommunityToolkit.WinUI.Converters;
using Microsoft.UI.Xaml;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
/// <summary>
/// This class converts a object? value into a Visibility enumeration.

View File

@@ -4,7 +4,7 @@
using CommunityToolkit.WinUI.Converters;
using Microsoft.UI.Xaml;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
/// <summary>
/// This class converts a object? value into a Visibility enumeration in reverse.

View File

@@ -5,7 +5,7 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
using Snap.Hutao.Core.ExceptionService;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
/// <summary>
/// Int32 转 Visibility

View File

@@ -5,7 +5,7 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;
using Snap.Hutao.Core.ExceptionService;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
/// <summary>
/// Int32 反转 Visibility

View File

@@ -1,10 +1,9 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Media.Backdrop;
namespace Snap.Hutao.View.Converter.Specialized;
namespace Snap.Hutao.UI.Xaml.Data.Converter.Specialized;
internal sealed class BackdropTypeToOpacityConverter : ValueConverter<BackdropType, double>
{

View File

@@ -4,7 +4,7 @@
using CommunityToolkit.WinUI.Converters;
using Microsoft.UI.Xaml;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter.Specialized;
internal sealed class BoolToGridLengthConverter : BoolToObjectConverter
{

View File

@@ -2,12 +2,12 @@
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
using Snap.Hutao.Win32;
using System.Runtime.CompilerServices;
using Windows.UI;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter.Specialized;
/// <summary>
/// Int32 转 色阶颜色

View File

@@ -3,9 +3,9 @@
using Microsoft.UI.Xaml;
using Snap.Hutao.UI.Xaml.Control;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter.Specialized;
/// <summary>
/// 条件转换器

View File

@@ -2,12 +2,12 @@
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
using Snap.Hutao.Win32;
using System.Runtime.CompilerServices;
using Windows.UI;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter.Specialized;
/// <summary>
/// UInt32 转 色阶颜色

View File

@@ -3,7 +3,7 @@
using CommunityToolkit.WinUI.Converters;
namespace Snap.Hutao.View.Converter;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
/// <summary>
/// 字符串空检查转换器

View File

@@ -4,7 +4,7 @@
using Microsoft.UI.Xaml.Data;
using Snap.Hutao.Core.ExceptionService;
namespace Snap.Hutao.UI.Xaml.Data;
namespace Snap.Hutao.UI.Xaml.Data.Converter;
internal abstract class ValueConverter<TFrom, TTo> : IValueConverter
{

View File

@@ -2,7 +2,7 @@
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Snap.Hutao.UI.Xaml.Data;
using Snap.Hutao.UI.Xaml.Data.Converter;
namespace Snap.Hutao.View.Converter;

View File

@@ -9,7 +9,7 @@
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvc="using:Snap.Hutao.View.Control"
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shvd="using:Snap.Hutao.ViewModel.DailyNote"
Padding="0"
HorizontalAlignment="Stretch"
@@ -57,7 +57,7 @@
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding RefreshTimeFormatted}"/>
<shvcp:CardBlock
<shuxcc:CardBlock
Grid.Row="1"
Grid.Column="0"
IconSquareLength="64"
@@ -73,12 +73,12 @@
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<shvcp:CardBlock
<shuxcc:CardBlock
Grid.Row="0"
ImageSource="{StaticResource UI_ItemIcon_204}"
IsDotVisible="{Binding HomeCoinNotifySuppressed}"
Text="{Binding DailyNote.HomeCoinFormatted}"/>
<shvcp:CardBlock
<shuxcc:CardBlock
Grid.Row="1"
ImageSource="{StaticResource UI_MarkQuest_Events_Proce}"
IsDotVisible="{Binding DailyTaskNotifySuppressed}"
@@ -92,11 +92,11 @@
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<shvcp:CardBlock
<shuxcc:CardBlock
Grid.Row="0"
ImageSource="{StaticResource UI_MarkTower}"
Text="{Binding DailyNote.ResinDiscountFormatted}"/>
<shvcp:CardBlock
<shuxcc:CardBlock
Grid.Row="1"
ImageSource="{StaticResource UI_ItemIcon_220021}"
IsDotVisible="{Binding TransformerNotifySuppressed}"

View File

@@ -6,9 +6,9 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
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:shvcp="using:Snap.Hutao.View.Card.Primitive"
xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog"
Padding="0"
HorizontalAlignment="Stretch"
@@ -64,7 +64,7 @@
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"/>
<shvcp:CardProgressBar
<shuxcc:CardProgressBar
Grid.Column="0"
Description="{Binding LastOrangePull}"
Header="{shuxm:ResourceString Name=ViewControlStatisticsCardOrangeText}"
@@ -72,7 +72,7 @@
ProgressForeground="{StaticResource OrangeColorBrush}"
TextForeground="{StaticResource OrangeColorBrush}"
Value="{Binding LastOrangePull, Mode=OneWay}"/>
<shvcp:CardProgressBar
<shuxcc:CardProgressBar
Grid.Column="0"
Description="{Binding LastPurplePull}"
Header="{shuxm:ResourceString Name=ViewControlStatisticsCardPurpleText}"
@@ -96,7 +96,7 @@
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"/>
<shvcp:CardProgressBar
<shuxcc:CardProgressBar
Grid.Column="0"
Description="{Binding LastOrangePull}"
Header="{shuxm:ResourceString Name=ViewControlStatisticsCardOrangeText}"
@@ -104,7 +104,7 @@
ProgressForeground="{StaticResource OrangeColorBrush}"
TextForeground="{StaticResource OrangeColorBrush}"
Value="{Binding LastOrangePull}"/>
<shvcp:CardProgressBar
<shuxcc:CardProgressBar
Grid.Column="0"
Description="{Binding LastPurplePull}"
Header="{shuxm:ResourceString Name=ViewControlStatisticsCardPurpleText}"
@@ -127,7 +127,7 @@
TextTrimming="CharacterEllipsis"
TextWrapping="NoWrap"/>
<shvcp:CardProgressBar
<shuxcc:CardProgressBar
Grid.Column="0"
Description="{Binding LastOrangePull}"
Header="{shuxm:ResourceString Name=ViewControlStatisticsCardOrangeText}"
@@ -135,7 +135,7 @@
ProgressForeground="{StaticResource OrangeColorBrush}"
TextForeground="{StaticResource OrangeColorBrush}"
Value="{Binding LastOrangePull}"/>
<shvcp:CardProgressBar
<shuxcc:CardProgressBar
Grid.Column="0"
Description="{Binding LastPurplePull}"
Header="{shuxm:ResourceString Name=ViewControlStatisticsCardPurpleText}"

View File

@@ -1,27 +0,0 @@
<Grid
x:Class="Snap.Hutao.View.Card.Primitive.CardBlock"
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:shux="using:Snap.Hutao.UI.Xaml"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
Style="{ThemeResource GridCardStyle}"
mc:Ignorable="d">
<StackPanel VerticalAlignment="Center">
<shuxci:CachedImage shux:FrameworkElementHelper.SquareLength="{x:Bind IconSquareLength}" Source="{x:Bind ImageSource, Mode=OneWay}"/>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Bind Text, Mode=OneWay}"/>
</StackPanel>
<InfoBadge
Margin="8"
HorizontalAlignment="Right"
VerticalAlignment="Top"
shux:FrameworkElementHelper.SquareLength="8"
Style="{ThemeResource AttentionDotInfoBadgeStyle}"
Visibility="{x:Bind IsDotVisible, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}"/>
</Grid>

View File

@@ -1,20 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Card.Primitive;
[DependencyProperty("Text", typeof(string))]
[DependencyProperty("ImageSource", typeof(object))]
[DependencyProperty("IsDotVisible", typeof(bool), false)]
[DependencyProperty("IconSquareLength", typeof(double), 32D)]
internal sealed partial class CardBlock : Grid
{
public CardBlock()
{
// TODO: Convert to custom control
InitializeComponent();
}
}

View File

@@ -1,24 +0,0 @@
<UserControl
x:Class="Snap.Hutao.View.Card.Primitive.HorizontalCard"
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"
mc:Ignorable="d">
<Border Style="{StaticResource BorderCardStyle}">
<Grid Background="{x:Bind Background, Mode=OneWay}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Border Child="{x:Bind Left, Mode=OneWay}"/>
<Border
Grid.Column="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Child="{x:Bind Right, Mode=OneWay}"/>
</Grid>
</Border>
</UserControl>

View File

@@ -1,17 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Snap.Hutao.View.Card.Primitive;
[DependencyProperty("Left", typeof(UIElement), default!)]
[DependencyProperty("Right", typeof(UIElement), default!)]
internal sealed partial class HorizontalCard : UserControl
{
public HorizontalCard()
{
InitializeComponent();
}
}

View File

@@ -9,24 +9,25 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:shux="using:Snap.Hutao.UI.Xaml"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
xmlns:shuxdc="using:Snap.Hutao.UI.Xaml.Data.Converter"
xmlns:shuxdcs="using:Snap.Hutao.UI.Xaml.Data.Converter.Specialized"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvcont="using:Snap.Hutao.View.Control"
xmlns:shvconv="using:Snap.Hutao.View.Converter"
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
xmlns:shvg="using:Snap.Hutao.ViewModel.GachaLog"
cw:Effects.Shadow="{ThemeResource CompatCardShadow}"
d:DataContext="{d:DesignInstance shvg:TypedWishSummary}"
mc:Ignorable="d">
<UserControl.Resources>
<shvconv:BoolToGridLengthConverter x:Key="BoolToGridLengthConverter"/>
<shvconv:BoolToGridLengthConverter
<shuxdcs:BoolToGridLengthConverter x:Key="BoolToGridLengthConverter"/>
<shuxdcs:BoolToGridLengthConverter
x:Key="BoolToGridLengthSpacingConverter"
FalseValue="0"
TrueValue="4"/>
<shvconv:Int32ToGradientColorConverter x:Key="Int32ToGradientColorConverter" MaximumValue="{Binding GuaranteeOrangeThreshold}"/>
<shuxdcs:Int32ToGradientColorConverter x:Key="Int32ToGradientColorConverter" MaximumValue="{Binding GuaranteeOrangeThreshold}"/>
<DataTemplate x:Key="OrangeListTemplate" d:DataType="shvg:SummaryItem">
<Grid Margin="0" Style="{ThemeResource GridCardStyle}">
@@ -183,7 +184,7 @@
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<shvcp:CardProgressBar
<shuxcc:CardProgressBar
Grid.Column="0"
MinHeight="32"
Description="{Binding LastOrangePull}"
@@ -192,7 +193,7 @@
ProgressForeground="{StaticResource OrangeColorBrush}"
TextForeground="{StaticResource OrangeColorBrush}"
Value="{Binding LastOrangePull}"/>
<shvcp:CardProgressBar
<shuxcc:CardProgressBar
Grid.Column="1"
MinHeight="32"
Description="{Binding LastPurplePull}"

View File

@@ -7,9 +7,9 @@
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
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:shvcs="using:Snap.Hutao.View.Converter.Specialized"
xmlns:shvh="using:Snap.Hutao.View.Helper"
xmlns:shvm="using:Snap.Hutao.ViewModel"
xmlns:shvp="using:Snap.Hutao.View.Page"
@@ -25,7 +25,7 @@
<Thickness x:Key="NavigationViewContentGridBorderThickness">0,1,0,0</Thickness>
<x:Double x:Key="NavigationViewItemOnLeftIconBoxHeight">24</x:Double>
<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent"/>
<shvcs:BackdropTypeToOpacityConverter x:Key="BackdropTypeToOpacityConverter"/>
<shuxdcs:BackdropTypeToOpacityConverter x:Key="BackdropTypeToOpacityConverter"/>
</UserControl.Resources>
<Grid>

View File

@@ -13,11 +13,11 @@
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
xmlns:shuxba="using:Snap.Hutao.UI.Xaml.Behavior.Action"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shuxma="using:Snap.Hutao.UI.Xaml.Media.Animation"
xmlns:shvco="using:Snap.Hutao.View.Control"
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
xmlns:shvh="using:Snap.Hutao.ViewModel.Home"
d:DataContext="{d:DesignInstance shvh:AnnouncementViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
@@ -195,7 +195,7 @@
</InfoBar>
</DataTemplate>
<DataTemplate x:Key="CardTemplate" x:DataType="shvcp:CardReference">
<DataTemplate x:Key="CardTemplate" x:DataType="shuxcc:CardReference">
<ItemContainer cw:Effects.Shadow="{ThemeResource CompatCardShadow}">
<ItemContainer.Resources>
<SolidColorBrush x:Key="ItemContainerPointerOverBackground" Color="Transparent"/>

View File

@@ -16,7 +16,8 @@
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shva="using:Snap.Hutao.ViewModel.AvatarProperty"
xmlns:shvcont="using:Snap.Hutao.View.Control"
xmlns:shvconv="using:Snap.Hutao.View.Converter"
xmlns:shuxdc="using:Snap.Hutao.UI.Xaml.Data.Converter"
xmlns:shuxdcs="using:Snap.Hutao.UI.Xaml.Data.Converter.Specialized"
d:DataContext="{d:DesignInstance shva:AvatarPropertyViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
@@ -29,13 +30,13 @@
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<shvconv:UInt32ToGradientColorConverter
<shuxdcs:UInt32ToGradientColorConverter
x:Key="CountToGradientColorConverter"
Maximum="#FFFD0093"
Minimum="#FF4B00D9"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<shvconv:UInt32ToGradientColorConverter
<shuxdcs:UInt32ToGradientColorConverter
x:Key="CountToGradientColorConverter"
Maximum="#FFFF69BF"
Minimum="#FF9F69FF"/>
@@ -51,7 +52,7 @@
</cwconv:BoolToObjectConverter.FalseValue>
</cwconv:BoolToObjectConverter>
<shvconv:LayoutSwitchModeConverter
<shuxdcs:LayoutSwitchModeConverter
x:Key="LayoutSwitchModeConverter"
GridValue="{x:Bind GridImageExportPanel}"
ListValue="{x:Bind ListImageExportPanel}"/>

View File

@@ -11,11 +11,11 @@
xmlns:shux="using:Snap.Hutao.UI.Xaml"
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
xmlns:shuxcl="using:Snap.Hutao.UI.Xaml.Control.Layout"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvco="using:Snap.Hutao.View.Control"
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
xmlns:shvcu="using:Snap.Hutao.ViewModel.Cultivation"
d:DataContext="{d:DesignInstance shvcu:CultivationViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
@@ -173,8 +173,8 @@
<SolidColorBrush x:Key="ItemContainerPointerOverBackground" Color="Transparent"/>
<SolidColorBrush x:Key="ItemContainerPressedBackground" Color="Transparent"/>
</ItemContainer.Resources>
<shvcp:HorizontalCard>
<shvcp:HorizontalCard.Left>
<shuxcc:HorizontalCard>
<shuxcc:HorizontalCard.Left>
<Grid Grid.Column="0">
<shvco:ItemIcon
Width="40"
@@ -189,8 +189,8 @@
Glyph="&#xE73E;"
Visibility="{Binding IsFinished, Converter={StaticResource BoolToVisibilityConverter}}"/>
</Grid>
</shvcp:HorizontalCard.Left>
<shvcp:HorizontalCard.Right>
</shuxcc:HorizontalCard.Left>
<shuxcc:HorizontalCard.Right>
<Grid Margin="16,0">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
@@ -208,8 +208,8 @@
VerticalAlignment="Center"
Text="{Binding CountFormatted}"/>
</Grid>
</shvcp:HorizontalCard.Right>
</shvcp:HorizontalCard>
</shuxcc:HorizontalCard.Right>
</shuxcc:HorizontalCard>
</ItemContainer>
</DataTemplate>

View File

@@ -12,10 +12,10 @@
xmlns:shux="using:Snap.Hutao.UI.Xaml"
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvc="using:Snap.Hutao.View.Control"
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
xmlns:shvd="using:Snap.Hutao.ViewModel.DailyNote"
d:DataContext="{d:DesignInstance shvd:DailyNoteViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
@@ -282,7 +282,7 @@
<ItemsControl Margin="0,-3,0,0" ItemsSource="{Binding DailyNote.DailyTask.AttendanceRewards}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<shvcp:CardProgressBar
<shuxcc:CardProgressBar
MinWidth="120"
MinHeight="32"
Margin="0,3,0,0"

View File

@@ -11,13 +11,13 @@
xmlns:shux="using:Snap.Hutao.UI.Xaml"
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
xmlns:shuxcp="using:Snap.Hutao.UI.Xaml.Control.Panel"
xmlns:shuxct="using:Snap.Hutao.UI.Xaml.Control.TextBlock"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvcom="using:Snap.Hutao.ViewModel.Complex"
xmlns:shvcon="using:Snap.Hutao.View.Control"
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
xmlns:shvs="using:Snap.Hutao.ViewModel.SpiralAbyss"
d:DataContext="{d:DesignInstance shvs:SpiralAbyssRecordViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
@@ -562,15 +562,15 @@
</DataTemplate>
<DataTemplate x:Key="RatedAvatarTemplate" x:DataType="shvcom:AvatarView">
<shvcp:HorizontalCard>
<shvcp:HorizontalCard.Left>
<shuxcc:HorizontalCard>
<shuxcc:HorizontalCard.Left>
<shvcon:ItemIcon
Width="56"
Height="56"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
</shvcp:HorizontalCard.Left>
<shvcp:HorizontalCard.Right>
</shuxcc:HorizontalCard.Left>
<shuxcc:HorizontalCard.Right>
<StackPanel
Width="64"
Margin="8,8,8,8"
@@ -582,8 +582,8 @@
Text="{Binding RateDelta}"
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
</StackPanel>
</shvcp:HorizontalCard.Right>
</shvcp:HorizontalCard>
</shuxcc:HorizontalCard.Right>
</shuxcc:HorizontalCard>
</DataTemplate>
</Grid.Resources>

View File

@@ -10,12 +10,12 @@
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxca="using:Snap.Hutao.UI.Xaml.Control.AutoSuggestBox"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
xmlns:shuxct="using:Snap.Hutao.UI.Xaml.Control.TextBlock"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvcont="using:Snap.Hutao.View.Control"
xmlns:shvconv="using:Snap.Hutao.View.Converter"
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
xmlns:shvw="using:Snap.Hutao.ViewModel.Wiki"
d:DataContext="{d:DesignInstance Type=shvw:WikiAvatarViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
@@ -132,33 +132,33 @@
</DataTemplate>
<DataTemplate x:Key="CultivationItemTemplate">
<shvcp:HorizontalCard>
<shvcp:HorizontalCard.Left>
<shuxcc:HorizontalCard>
<shuxcc:HorizontalCard.Left>
<shvcont:ItemIcon
Width="40"
Height="40"
Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}"
Quality="{Binding RankLevel}"/>
</shvcp:HorizontalCard.Left>
<shvcp:HorizontalCard.Right>
</shuxcc:HorizontalCard.Left>
<shuxcc:HorizontalCard.Right>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding Name}"/>
</shvcp:HorizontalCard.Right>
</shvcp:HorizontalCard>
</shuxcc:HorizontalCard.Right>
</shuxcc:HorizontalCard>
</DataTemplate>
<DataTemplate x:Key="CollocationTemplate">
<shvcp:HorizontalCard>
<shvcp:HorizontalCard.Left>
<shuxcc:HorizontalCard>
<shuxcc:HorizontalCard.Left>
<shvcont:ItemIcon
Width="48"
Height="48"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
</shvcp:HorizontalCard.Left>
<shvcp:HorizontalCard.Right>
</shuxcc:HorizontalCard.Left>
<shuxcc:HorizontalCard.Right>
<StackPanel Margin="8,0,0,0" HorizontalAlignment="Left">
<TextBlock Text="{Binding Name}"/>
<StackPanel Orientation="Horizontal" Spacing="4">
@@ -172,13 +172,13 @@
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
</StackPanel>
</StackPanel>
</shvcp:HorizontalCard.Right>
</shvcp:HorizontalCard>
</shuxcc:HorizontalCard.Right>
</shuxcc:HorizontalCard>
</DataTemplate>
<DataTemplate x:Key="CollocationReliquaryTemplate">
<shvcp:HorizontalCard>
<shvcp:HorizontalCard.Left>
<shuxcc:HorizontalCard>
<shuxcc:HorizontalCard.Left>
<cwc:SwitchPresenter Value="{Binding Icons.Count, Mode=OneWay}">
<cwc:Case IsDefault="True">
<cwc:Case.Value>
@@ -228,8 +228,8 @@
</Grid>
</cwc:Case>
</cwc:SwitchPresenter>
</shvcp:HorizontalCard.Left>
<shvcp:HorizontalCard.Right>
</shuxcc:HorizontalCard.Left>
<shuxcc:HorizontalCard.Right>
<StackPanel Margin="8,0,8,0" HorizontalAlignment="Left">
<TextBlock
Text="{Binding Name}"
@@ -246,8 +246,8 @@
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
</StackPanel>
</StackPanel>
</shvcp:HorizontalCard.Right>
</shvcp:HorizontalCard>
</shuxcc:HorizontalCard.Right>
</shuxcc:HorizontalCard>
</DataTemplate>
<DataTemplate x:Key="CostumeTemplate">

View File

@@ -10,11 +10,11 @@
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
xmlns:shuxct="using:Snap.Hutao.UI.Xaml.Control.TextBlock"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvc="using:Snap.Hutao.View.Control"
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
xmlns:shvw="using:Snap.Hutao.ViewModel.Wiki"
d:DataContext="{d:DesignInstance Type=shvw:WikiMonsterViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
@@ -57,21 +57,21 @@
</DataTemplate>
<DataTemplate x:Key="MonsterDropTemplate">
<shvcp:HorizontalCard>
<shvcp:HorizontalCard.Left>
<shuxcc:HorizontalCard>
<shuxcc:HorizontalCard.Left>
<shvc:ItemIcon
Width="40"
Height="40"
Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}"
Quality="{Binding RankLevel}"/>
</shvcp:HorizontalCard.Left>
<shvcp:HorizontalCard.Right>
</shuxcc:HorizontalCard.Left>
<shuxcc:HorizontalCard.Right>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding Name}"/>
</shvcp:HorizontalCard.Right>
</shvcp:HorizontalCard>
</shuxcc:HorizontalCard.Right>
</shuxcc:HorizontalCard>
</DataTemplate>
<DataTemplate x:Key="MonsterGridTemplate">

View File

@@ -10,11 +10,11 @@
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
xmlns:shuxca="using:Snap.Hutao.UI.Xaml.Control.AutoSuggestBox"
xmlns:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
xmlns:shuxct="using:Snap.Hutao.UI.Xaml.Control.TextBlock"
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
xmlns:shvc="using:Snap.Hutao.View.Control"
xmlns:shvcp="using:Snap.Hutao.View.Card.Primitive"
xmlns:shvw="using:Snap.Hutao.ViewModel.Wiki"
d:DataContext="{d:DesignInstance Type=shvw:WikiWeaponViewModel}"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
@@ -91,21 +91,21 @@
</DataTemplate>
<DataTemplate x:Key="CultivateItemTemplate">
<shvcp:HorizontalCard>
<shvcp:HorizontalCard.Left>
<shuxcc:HorizontalCard>
<shuxcc:HorizontalCard.Left>
<shvc:ItemIcon
Width="40"
Height="40"
Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}"
Quality="{Binding RankLevel}"/>
</shvcp:HorizontalCard.Left>
<shvcp:HorizontalCard.Right>
</shuxcc:HorizontalCard.Left>
<shuxcc:HorizontalCard.Right>
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding Name}"/>
</shvcp:HorizontalCard.Right>
</shvcp:HorizontalCard>
</shuxcc:HorizontalCard.Right>
</shuxcc:HorizontalCard>
</DataTemplate>
<DataTemplate x:Key="AffixPivotHeaderTemplate">
@@ -123,15 +123,15 @@
</DataTemplate>
<DataTemplate x:Key="CollocationTemplate">
<shvcp:HorizontalCard>
<shvcp:HorizontalCard.Left>
<shuxcc:HorizontalCard>
<shuxcc:HorizontalCard.Left>
<shvc:ItemIcon
Width="48"
Height="48"
Icon="{Binding Icon}"
Quality="{Binding Quality}"/>
</shvcp:HorizontalCard.Left>
<shvcp:HorizontalCard.Right>
</shuxcc:HorizontalCard.Left>
<shuxcc:HorizontalCard.Right>
<StackPanel Margin="8,0,0,0" HorizontalAlignment="Left">
<TextBlock Text="{Binding Name}"/>
<StackPanel Orientation="Horizontal" Spacing="4">
@@ -145,8 +145,8 @@
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
</StackPanel>
</StackPanel>
</shvcp:HorizontalCard.Right>
</shvcp:HorizontalCard>
</shuxcc:HorizontalCard.Right>
</shuxcc:HorizontalCard>
</DataTemplate>
<DataTemplate x:Key="WeaponGridTemplate">

View File

@@ -5,8 +5,8 @@ using Snap.Hutao.Core.Setting;
using Snap.Hutao.Service;
using Snap.Hutao.Service.Announcement;
using Snap.Hutao.Service.Hutao;
using Snap.Hutao.UI.Xaml.Control.Card;
using Snap.Hutao.View.Card;
using Snap.Hutao.View.Card.Primitive;
using Snap.Hutao.Web.Hoyolab.Hk4e.Common.Announcement;
using System.Collections.ObjectModel;