mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
refactor
This commit is contained in:
@@ -13,19 +13,19 @@ public sealed class JsonSerializeTest
|
|||||||
NumberHandling = JsonNumberHandling.AllowReadingFromString,
|
NumberHandling = JsonNumberHandling.AllowReadingFromString,
|
||||||
};
|
};
|
||||||
|
|
||||||
private const string SmapleObjectJson = """
|
private const string SampleObjectJson = """
|
||||||
{
|
{
|
||||||
"A" :1
|
"A" :1
|
||||||
}
|
}
|
||||||
""";
|
""";
|
||||||
|
|
||||||
private const string SmapleEmptyStringObjectJson = """
|
private const string SampleEmptyStringObjectJson = """
|
||||||
{
|
{
|
||||||
"A" : ""
|
"A" : ""
|
||||||
}
|
}
|
||||||
""";
|
""";
|
||||||
|
|
||||||
private const string SmapleNumberKeyDictionaryJson = """
|
private const string SampleNumberKeyDictionaryJson = """
|
||||||
{
|
{
|
||||||
"111" : "12",
|
"111" : "12",
|
||||||
"222" : "34"
|
"222" : "34"
|
||||||
@@ -35,7 +35,7 @@ public sealed class JsonSerializeTest
|
|||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void DelegatePropertyCanSerialize()
|
public void DelegatePropertyCanSerialize()
|
||||||
{
|
{
|
||||||
SampleDelegatePropertyClass sample = JsonSerializer.Deserialize<SampleDelegatePropertyClass>(SmapleObjectJson)!;
|
SampleDelegatePropertyClass sample = JsonSerializer.Deserialize<SampleDelegatePropertyClass>(SampleObjectJson)!;
|
||||||
Assert.AreEqual(sample.B, 1);
|
Assert.AreEqual(sample.B, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,14 +43,23 @@ public sealed class JsonSerializeTest
|
|||||||
[ExpectedException(typeof(JsonException))]
|
[ExpectedException(typeof(JsonException))]
|
||||||
public void EmptyStringCannotSerializeAsNumber()
|
public void EmptyStringCannotSerializeAsNumber()
|
||||||
{
|
{
|
||||||
SampleStringReadWriteNumberPropertyClass sample = JsonSerializer.Deserialize<SampleStringReadWriteNumberPropertyClass>(SmapleEmptyStringObjectJson)!;
|
SampleStringReadWriteNumberPropertyClass sample = JsonSerializer.Deserialize<SampleStringReadWriteNumberPropertyClass>(SampleEmptyStringObjectJson)!;
|
||||||
Assert.AreEqual(sample.A, 0);
|
Assert.AreEqual(sample.A, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void EmptyStringCanSerializeAsUri()
|
||||||
|
{
|
||||||
|
SampleEmptyUriClass sample = JsonSerializer.Deserialize<SampleEmptyUriClass>(SampleEmptyStringObjectJson)!;
|
||||||
|
Uri.TryCreate("", UriKind.RelativeOrAbsolute, out Uri? value);
|
||||||
|
Console.WriteLine(value);
|
||||||
|
Assert.AreEqual(sample.A, value);
|
||||||
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void NumberStringKeyCanSerializeAsKey()
|
public void NumberStringKeyCanSerializeAsKey()
|
||||||
{
|
{
|
||||||
Dictionary<int, string> sample = JsonSerializer.Deserialize<Dictionary<int, string>>(SmapleNumberKeyDictionaryJson, AlowStringNumberOptions)!;
|
Dictionary<int, string> sample = JsonSerializer.Deserialize<Dictionary<int, string>>(SampleNumberKeyDictionaryJson, AlowStringNumberOptions)!;
|
||||||
Assert.AreEqual(sample[111], "12");
|
Assert.AreEqual(sample[111], "12");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,6 +101,11 @@ public sealed class JsonSerializeTest
|
|||||||
public int A { get; set; }
|
public int A { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private sealed class SampleEmptyUriClass
|
||||||
|
{
|
||||||
|
public Uri A { get; set; } = default!;
|
||||||
|
}
|
||||||
|
|
||||||
private sealed class SampleByteArrayPropertyClass
|
private sealed class SampleByteArrayPropertyClass
|
||||||
{
|
{
|
||||||
public byte[]? Array { get; set; }
|
public byte[]? Array { get; set; }
|
||||||
|
|||||||
@@ -10,12 +10,14 @@
|
|||||||
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.TokenizingTextBox/TokenizingTextBox.xaml"/>
|
<ResourceDictionary Source="ms-appx:///CommunityToolkit.WinUI.Controls.TokenizingTextBox/TokenizingTextBox.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///CommunityToolkit.Labs.WinUI.TokenView/TokenItem/TokenItem.xaml"/>
|
<ResourceDictionary Source="ms-appx:///CommunityToolkit.Labs.WinUI.TokenView/TokenItem/TokenItem.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Elevation.xaml"/>
|
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Elevation.xaml"/>
|
||||||
|
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/ItemIcon.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Loading.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/CardBlock.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Card/CardProgressBar.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/Card/HorizontalCard.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Card/VerticalCard.xaml"/>
|
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Card/VerticalCard.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Image/CachedImage.xaml"/>
|
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Image/CachedImage.xaml"/>
|
||||||
|
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/TextBlock/RateDeltaTextBlock.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/Card.xaml"/>
|
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/Card.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/Color.xaml"/>
|
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/Color.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/ComboBox.xaml"/>
|
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/ComboBox.xaml"/>
|
||||||
@@ -36,7 +38,6 @@
|
|||||||
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/TransitionCollection.xaml"/>
|
<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/Uri.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/WindowOverride.xaml"/>
|
<ResourceDictionary Source="ms-appx:///UI/Xaml/Control/Theme/WindowOverride.xaml"/>
|
||||||
<ResourceDictionary Source="ms-appx:///View/Control/RateDeltaTextBlockStyle.xaml"/>
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<Style
|
<Style
|
||||||
|
|||||||
@@ -94,6 +94,7 @@
|
|||||||
<None Remove="UI\Xaml\Control\Card\HorizontalCard.xaml" />
|
<None Remove="UI\Xaml\Control\Card\HorizontalCard.xaml" />
|
||||||
<None Remove="UI\Xaml\Control\Card\VerticalCard.xaml" />
|
<None Remove="UI\Xaml\Control\Card\VerticalCard.xaml" />
|
||||||
<None Remove="UI\Xaml\Control\Elevation.xaml" />
|
<None Remove="UI\Xaml\Control\Elevation.xaml" />
|
||||||
|
<None Remove="UI\Xaml\Control\ItemIcon.xaml" />
|
||||||
<None Remove="UI\Xaml\Control\Theme\Card.xaml" />
|
<None Remove="UI\Xaml\Control\Theme\Card.xaml" />
|
||||||
<None Remove="UI\Xaml\Control\Theme\Color.xaml" />
|
<None Remove="UI\Xaml\Control\Theme\Color.xaml" />
|
||||||
<None Remove="UI\Xaml\Control\Theme\ComboBox.xaml" />
|
<None Remove="UI\Xaml\Control\Theme\ComboBox.xaml" />
|
||||||
@@ -156,10 +157,7 @@
|
|||||||
<None Remove="View\Control\BaseValueSlider.xaml" />
|
<None Remove="View\Control\BaseValueSlider.xaml" />
|
||||||
<None Remove="View\Control\DescParamComboBox.xaml" />
|
<None Remove="View\Control\DescParamComboBox.xaml" />
|
||||||
<None Remove="View\Control\HutaoStatisticsCard.xaml" />
|
<None Remove="View\Control\HutaoStatisticsCard.xaml" />
|
||||||
<None Remove="View\Control\ItemIcon.xaml" />
|
|
||||||
<None Remove="View\Control\LaunchGameResourceExpander.xaml" />
|
<None Remove="View\Control\LaunchGameResourceExpander.xaml" />
|
||||||
<None Remove="View\Control\LoadingView.xaml" />
|
|
||||||
<None Remove="View\Control\LoadingViewSlim.xaml" />
|
|
||||||
<None Remove="View\Control\RateDeltaTextBlockStyle.xaml" />
|
<None Remove="View\Control\RateDeltaTextBlockStyle.xaml" />
|
||||||
<None Remove="View\Control\SkillPivot.xaml" />
|
<None Remove="View\Control\SkillPivot.xaml" />
|
||||||
<None Remove="View\Control\SegmentedOverride.xaml" />
|
<None Remove="View\Control\SegmentedOverride.xaml" />
|
||||||
@@ -465,23 +463,12 @@
|
|||||||
</Page>
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Page Update="View\Control\LoadingViewSlim.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<!-- Pages -->
|
<!-- Pages -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="View\Page\TestPage.xaml">
|
<Page Update="View\Page\TestPage.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Page Update="View\Control\LoadingView.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="View\Page\SpiralAbyssRecordPage.xaml">
|
<Page Update="View\Page\SpiralAbyssRecordPage.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -582,11 +569,6 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<Page Update="View\Control\ItemIcon.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="View\Control\StatisticsCard.xaml">
|
<Page Update="View\Control\StatisticsCard.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -646,6 +628,11 @@
|
|||||||
<Folder Include="UI\Xaml\View\Card\" />
|
<Folder Include="UI\Xaml\View\Card\" />
|
||||||
<Folder Include="UI\Xaml\View\Page\" />
|
<Folder Include="UI\Xaml\View\Page\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="UI\Xaml\Control\ItemIcon.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="UI\Xaml\Control\Card\VerticalCard.xaml">
|
<Page Update="UI\Xaml\Control\Card\VerticalCard.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
namespace Snap.Hutao.UI.Windowing.Abstraction;
|
||||||
|
|
||||||
|
internal interface IXamlWindowClosed
|
||||||
|
{
|
||||||
|
void OnWindowClosed();
|
||||||
|
}
|
||||||
@@ -131,6 +131,12 @@ internal sealed class XamlWindowController
|
|||||||
|
|
||||||
subclass?.Dispose();
|
subclass?.Dispose();
|
||||||
windowNonRudeHWND?.Dispose();
|
windowNonRudeHWND?.Dispose();
|
||||||
|
|
||||||
|
if (window is IXamlWindowClosed xamlWindowClosed)
|
||||||
|
{
|
||||||
|
xamlWindowClosed.OnWindowClosed();
|
||||||
|
}
|
||||||
|
|
||||||
window.UninitializeController();
|
window.UninitializeController();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,8 +239,8 @@ internal sealed class XamlWindowController
|
|||||||
rect.Width = Math.Min(workAreaRect.Width, rect.Width);
|
rect.Width = Math.Min(workAreaRect.Width, rect.Width);
|
||||||
rect.Height = Math.Min(workAreaRect.Height, rect.Height);
|
rect.Height = Math.Min(workAreaRect.Height, rect.Height);
|
||||||
|
|
||||||
rect.X = workAreaRect.X + (workAreaRect.Width - rect.Width) / 2;
|
rect.X = workAreaRect.X + ((workAreaRect.Width - rect.Width) / 2);
|
||||||
rect.Y = workAreaRect.Y + (workAreaRect.Height - rect.Height) / 2;
|
rect.Y = workAreaRect.Y + ((workAreaRect.Height - rect.Height) / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RecoverOrInitWindowSize(IXamlWindowHasInitSize xamlWindow)
|
private void RecoverOrInitWindowSize(IXamlWindowHasInitSize xamlWindow)
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ using Microsoft.Xaml.Interactivity;
|
|||||||
|
|
||||||
namespace Snap.Hutao.UI.Xaml.Behavior.Action;
|
namespace Snap.Hutao.UI.Xaml.Behavior.Action;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 打开附着的浮出控件操作
|
|
||||||
/// </summary>
|
|
||||||
[HighQuality]
|
[HighQuality]
|
||||||
internal sealed class ShowAttachedFlyoutAction : DependencyObject, IAction
|
internal sealed class ShowAttachedFlyoutAction : DependencyObject, IAction
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.Xaml.Interactivity;
|
||||||
|
using Snap.Hutao.UI.Xaml.View.Window;
|
||||||
|
|
||||||
|
namespace Snap.Hutao.UI.Xaml.Behavior.Action;
|
||||||
|
|
||||||
|
[DependencyProperty("ContentProvider", typeof(IWebView2ContentProvider))]
|
||||||
|
internal sealed partial class ShowWebView2WindowAction : DependencyObject, IAction
|
||||||
|
{
|
||||||
|
public object? Execute(object sender, object parameter)
|
||||||
|
{
|
||||||
|
WebView2Window window = new(((FrameworkElement)sender).XamlRoot.ContentIslandEnvironment.AppWindowId, ContentProvider);
|
||||||
|
window.Activate();
|
||||||
|
return default!;
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/ItemIcon.cs
Normal file
13
src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/ItemIcon.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Snap.Hutao.Model.Intrinsic;
|
||||||
|
|
||||||
|
namespace Snap.Hutao.UI.Xaml.Control;
|
||||||
|
|
||||||
|
[DependencyProperty("Quality", typeof(QualityType), QualityType.QUALITY_NONE)]
|
||||||
|
[DependencyProperty("Icon", typeof(Uri))]
|
||||||
|
[DependencyProperty("Badge", typeof(Uri))]
|
||||||
|
internal sealed partial class ItemIcon : Microsoft.UI.Xaml.Controls.Control
|
||||||
|
{
|
||||||
|
}
|
||||||
37
src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/ItemIcon.xaml
Normal file
37
src/Snap.Hutao/Snap.Hutao/UI/Xaml/Control/ItemIcon.xaml
Normal 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:cw="using:CommunityToolkit.WinUI"
|
||||||
|
xmlns:shmmc="using:Snap.Hutao.Model.Metadata.Converter"
|
||||||
|
xmlns:shux="using:Snap.Hutao.UI.Xaml"
|
||||||
|
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
|
||||||
|
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image">
|
||||||
|
|
||||||
|
<shmmc:QualityConverter x:Key="QualityConverter"/>
|
||||||
|
|
||||||
|
<Style BasedOn="{StaticResource DefaultItemIconStyle}" TargetType="shuxc:ItemIcon"/>
|
||||||
|
|
||||||
|
<Style x:Key="DefaultItemIconStyle" TargetType="shuxc:ItemIcon">
|
||||||
|
<Setter Property="Height" Value="80"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="shuxc:ItemIcon">
|
||||||
|
<Grid CornerRadius="{StaticResource ControlCornerRadius}">
|
||||||
|
<shuxci:CachedImage cw:FrameworkElementExtensions.AncestorType="shuxc:ItemIcon" Source="{Binding (cw:FrameworkElementExtensions.Ancestor).Quality, RelativeSource={RelativeSource Self}, Converter={StaticResource QualityConverter}, Mode=OneWay}"/>
|
||||||
|
<shuxci:CachedImage Source="{StaticResource UI_ImgSign_ItemIcon}"/>
|
||||||
|
<shuxci:CachedImage Source="{TemplateBinding Icon}"/>
|
||||||
|
<shuxci:CachedImage
|
||||||
|
Margin="2"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
cw:FrameworkElementExtensions.AncestorType="shuxc:ItemIcon"
|
||||||
|
shux:FrameworkElementHelper.SquareLength="16"
|
||||||
|
Source="{TemplateBinding Badge}"/>
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Setter Property="Width" Value="80"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
</ResourceDictionary>
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control">
|
xmlns:clw="using:CommunityToolkit.Labs.WinUI"
|
||||||
|
xmlns:cw="using:CommunityToolkit.WinUI"
|
||||||
|
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
|
||||||
|
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
|
||||||
|
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup">
|
||||||
|
|
||||||
<Style BasedOn="{StaticResource DefaultLoadingStyle}" TargetType="shuxc:Loading"/>
|
<Style BasedOn="{StaticResource DefaultLoadingStyle}" TargetType="shuxc:Loading"/>
|
||||||
|
|
||||||
@@ -22,11 +26,7 @@
|
|||||||
x:Name="ContentGrid"
|
x:Name="ContentGrid"
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
x:Load="True">
|
x:Load="True"/>
|
||||||
<ContentPresenter.RenderTransform>
|
|
||||||
<CompositeTransform/>
|
|
||||||
</ContentPresenter.RenderTransform>
|
|
||||||
</ContentPresenter>
|
|
||||||
<VisualStateManager.VisualStateGroups>
|
<VisualStateManager.VisualStateGroups>
|
||||||
<VisualStateGroup x:Name="CommonStates">
|
<VisualStateGroup x:Name="CommonStates">
|
||||||
<VisualState x:Name="LoadingIn">
|
<VisualState x:Name="LoadingIn">
|
||||||
@@ -85,4 +85,58 @@
|
|||||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style
|
||||||
|
x:Key="DefaultLoadingViewStyle"
|
||||||
|
BasedOn="{StaticResource DefaultLoadingStyle}"
|
||||||
|
TargetType="shuxc:Loading">
|
||||||
|
<Setter Property="ContentTemplate">
|
||||||
|
<Setter.Value>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid>
|
||||||
|
<clw:Shimmer
|
||||||
|
cw:FrameworkElementExtensions.AncestorType="shuxc:Loading"
|
||||||
|
CornerRadius="{Binding (cw:FrameworkElementExtensions.Ancestor).CornerRadius, RelativeSource={RelativeSource Self}}"
|
||||||
|
IsActive="{Binding (cw:FrameworkElementExtensions.Ancestor).IsLoading, RelativeSource={RelativeSource Self}, Mode=OneWay}"
|
||||||
|
Duration="0:0:1"/>
|
||||||
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
|
<shuxci:CachedImage
|
||||||
|
Width="120"
|
||||||
|
Height="120"
|
||||||
|
Source="{StaticResource UI_EmotionIcon272}"/>
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,16,0,0"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
|
Text="{shuxm:ResourceString Name=ViewControlLoadingText}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||||
|
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style
|
||||||
|
x:Key="DefaultLoadingCardStyle"
|
||||||
|
BasedOn="{StaticResource DefaultLoadingStyle}"
|
||||||
|
TargetType="shuxc:Loading">
|
||||||
|
<Setter Property="ContentTemplate">
|
||||||
|
<Setter.Value>
|
||||||
|
<DataTemplate>
|
||||||
|
<clw:Shimmer
|
||||||
|
cw:FrameworkElementExtensions.AncestorType="shuxc:Loading"
|
||||||
|
CornerRadius="0"
|
||||||
|
IsActive="{Binding (cw:FrameworkElementExtensions.Ancestor).IsLoading, RelativeSource={RelativeSource Self}, Mode=OneWay}"
|
||||||
|
Duration="0:0:1"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Setter Property="Height" Value="{ThemeResource HomeAdaptiveCardHeight}"/>
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||||
|
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
|
||||||
namespace Snap.Hutao.View.Control;
|
namespace Snap.Hutao.UI.Xaml.Control.TextBlock;
|
||||||
|
|
||||||
[TemplateVisualState(Name = "PositiveValue", GroupName = "CommonStates")]
|
[TemplateVisualState(Name = "PositiveValue", GroupName = "CommonStates")]
|
||||||
[TemplateVisualState(Name = "NegativeValue", GroupName = "CommonStates")]
|
[TemplateVisualState(Name = "NegativeValue", GroupName = "CommonStates")]
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
<ResourceDictionary
|
<ResourceDictionary
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:shvc="using:Snap.Hutao.View.Control">
|
xmlns:shuxct="using:Snap.Hutao.UI.Xaml.Control.TextBlock">
|
||||||
|
|
||||||
<Style BasedOn="{StaticResource DefaultRateDeltaTextBlockStyle}" TargetType="shvc:RateDeltaTextBlock"/>
|
<Style BasedOn="{StaticResource DefaultRateDeltaTextBlockStyle}" TargetType="shuxct:RateDeltaTextBlock"/>
|
||||||
|
|
||||||
<Style x:Key="DefaultRateDeltaTextBlockStyle" TargetType="shvc:RateDeltaTextBlock">
|
<Style x:Key="DefaultRateDeltaTextBlockStyle" TargetType="shuxct:RateDeltaTextBlock">
|
||||||
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}"/>
|
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="shvc:RateDeltaTextBlock">
|
<ControlTemplate TargetType="shuxct:RateDeltaTextBlock">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="RootTextBlock"
|
x:Name="RootTextBlock"
|
||||||
Foreground="{TemplateBinding Foreground}"
|
Foreground="{TemplateBinding Foreground}"
|
||||||
@@ -172,11 +172,6 @@
|
|||||||
</ContentPresenter.Resources>
|
</ContentPresenter.Resources>
|
||||||
</ContentPresenter>
|
</ContentPresenter>
|
||||||
</InfoBarPanel>
|
</InfoBarPanel>
|
||||||
<ContentPresenter
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="1"
|
|
||||||
Content="{TemplateBinding Content}"
|
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"/>
|
|
||||||
<Button
|
<Button
|
||||||
Name="CloseButton"
|
Name="CloseButton"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -240,6 +235,11 @@
|
|||||||
<SymbolIcon Symbol="{StaticResource InfoBarCloseButtonSymbol}"/>
|
<SymbolIcon Symbol="{StaticResource InfoBarCloseButtonSymbol}"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Button>
|
</Button>
|
||||||
|
<ContentPresenter
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Content="{TemplateBinding Content}"
|
||||||
|
ContentTemplate="{TemplateBinding ContentTemplate}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<VisualStateManager.VisualStateGroups>
|
<VisualStateManager.VisualStateGroups>
|
||||||
|
|||||||
@@ -193,15 +193,6 @@
|
|||||||
<CompositeTransform x:Name="PivotLayoutElementTranslateTransform"/>
|
<CompositeTransform x:Name="PivotLayoutElementTranslateTransform"/>
|
||||||
</Grid.RenderTransform>
|
</Grid.RenderTransform>
|
||||||
|
|
||||||
<ItemsPresenter x:Name="PivotItemPresenter" Grid.Row="1">
|
|
||||||
<ItemsPresenter.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<TranslateTransform x:Name="ItemsPresenterTranslateTransform"/>
|
|
||||||
<CompositeTransform x:Name="ItemsPresenterCompositeTransform"/>
|
|
||||||
</TransformGroup>
|
|
||||||
</ItemsPresenter.RenderTransform>
|
|
||||||
</ItemsPresenter>
|
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Margin="16,16,16,0"
|
Margin="16,16,16,0"
|
||||||
@@ -288,6 +279,15 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
<ItemsPresenter x:Name="PivotItemPresenter" Grid.Row="1">
|
||||||
|
<ItemsPresenter.RenderTransform>
|
||||||
|
<TransformGroup>
|
||||||
|
<TranslateTransform x:Name="ItemsPresenterTranslateTransform"/>
|
||||||
|
<CompositeTransform x:Name="ItemsPresenterCompositeTransform"/>
|
||||||
|
</TransformGroup>
|
||||||
|
</ItemsPresenter.RenderTransform>
|
||||||
|
</ItemsPresenter>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</PivotPanel>
|
</PivotPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
@@ -566,17 +566,6 @@
|
|||||||
<CompositeTransform x:Name="PivotLayoutElementTranslateTransform"/>
|
<CompositeTransform x:Name="PivotLayoutElementTranslateTransform"/>
|
||||||
</Grid.RenderTransform>
|
</Grid.RenderTransform>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ItemsPresenter x:Name="PivotItemPresenter" Grid.Row="1">
|
|
||||||
<ItemsPresenter.RenderTransform>
|
|
||||||
<TransformGroup>
|
|
||||||
<TranslateTransform x:Name="ItemsPresenterTranslateTransform"/>
|
|
||||||
<CompositeTransform x:Name="ItemsPresenterCompositeTransform"/>
|
|
||||||
</TransformGroup>
|
|
||||||
</ItemsPresenter.RenderTransform>
|
|
||||||
</ItemsPresenter>
|
|
||||||
|
|
||||||
<Border
|
<Border
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Margin="16,16,16,0"
|
Margin="16,16,16,0"
|
||||||
@@ -663,6 +652,17 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<ItemsPresenter x:Name="PivotItemPresenter" Grid.Row="1">
|
||||||
|
<ItemsPresenter.RenderTransform>
|
||||||
|
<TransformGroup>
|
||||||
|
<TranslateTransform x:Name="ItemsPresenterTranslateTransform"/>
|
||||||
|
<CompositeTransform x:Name="ItemsPresenterCompositeTransform"/>
|
||||||
|
</TransformGroup>
|
||||||
|
</ItemsPresenter.RenderTransform>
|
||||||
|
</ItemsPresenter>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</PivotPanel>
|
</PivotPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
||||||
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
|
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
|
||||||
|
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
|
||||||
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
||||||
xmlns:shva="using:Snap.Hutao.ViewModel.Achievement"
|
xmlns:shva="using:Snap.Hutao.ViewModel.Achievement"
|
||||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
xmlns:shvc="using:Snap.Hutao.View.Control"
|
||||||
@@ -100,6 +101,6 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<shvc:LoadingViewSlim IsLoading="{Binding IsInitialized, Converter={StaticResource BoolNegationConverter}}"/>
|
<shuxc:Loading IsLoading="{Binding IsInitialized, Converter={StaticResource BoolNegationConverter}}" Style="{ThemeResource DefaultLoadingCardStyle}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
||||||
xmlns:shme="using:Snap.Hutao.Model.Entity"
|
xmlns:shme="using:Snap.Hutao.Model.Entity"
|
||||||
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
|
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:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
|
||||||
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
||||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
xmlns:shvc="using:Snap.Hutao.View.Control"
|
||||||
@@ -135,6 +136,6 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<shvc:LoadingViewSlim IsLoading="{Binding IsInitialized, Converter={StaticResource BoolNegationConverter}}"/>
|
<shuxc:Loading IsLoading="{Binding IsInitialized, Converter={StaticResource BoolNegationConverter}}" Style="{ThemeResource DefaultLoadingCardStyle}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
||||||
xmlns:shuxb="using:Snap.Hutao.UI.Xaml.Behavior"
|
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:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
|
||||||
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
||||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
xmlns:shvc="using:Snap.Hutao.View.Control"
|
||||||
@@ -177,6 +178,6 @@
|
|||||||
<TextBlock HorizontalAlignment="Center" Text="{shuxm:ResourceString Name=ViewGachaLogHeader}"/>
|
<TextBlock HorizontalAlignment="Center" Text="{shuxm:ResourceString Name=ViewGachaLogHeader}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<shvc:LoadingViewSlim IsLoading="{Binding IsInitialized, Converter={StaticResource BoolNegationConverter}}"/>
|
<shuxc:Loading IsLoading="{Binding IsInitialized, Converter={StaticResource BoolNegationConverter}}" Style="{ThemeResource DefaultLoadingCardStyle}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Button>
|
</Button>
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
|
||||||
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
|
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
|
||||||
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
||||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
xmlns:shvc="using:Snap.Hutao.View.Control"
|
||||||
@@ -84,7 +85,7 @@
|
|||||||
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="auto"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<shvc:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Width="36"
|
Width="36"
|
||||||
Height="36"
|
Height="36"
|
||||||
@@ -137,7 +138,7 @@
|
|||||||
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="auto"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<shvc:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Width="36"
|
Width="36"
|
||||||
Height="36"
|
Height="36"
|
||||||
|
|||||||
@@ -6,15 +6,15 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:shux="using:Snap.Hutao.UI.Xaml"
|
xmlns:shux="using:Snap.Hutao.UI.Xaml"
|
||||||
|
xmlns:shuxc="using:Snap.Hutao.UI.Xaml.Control"
|
||||||
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
||||||
xmlns:shvc="using:Snap.Hutao.View.Control"
|
|
||||||
Title="{shuxm:ResourceString Name=ViewDialogGachaLogRefreshProgressTitle}"
|
Title="{shuxm:ResourceString Name=ViewDialogGachaLogRefreshProgressTitle}"
|
||||||
Style="{StaticResource DefaultContentDialogStyle}"
|
Style="{StaticResource DefaultContentDialogStyle}"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<ContentDialog.Resources>
|
<ContentDialog.Resources>
|
||||||
<DataTemplate x:Key="GachaItemDataTemplate">
|
<DataTemplate x:Key="GachaItemDataTemplate">
|
||||||
<shvc:ItemIcon
|
<shuxc:ItemIcon
|
||||||
shux:FrameworkElementHelper.SquareLength="60"
|
shux:FrameworkElementHelper.SquareLength="60"
|
||||||
Badge="{Binding Badge}"
|
Badge="{Binding Badge}"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
|
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
|
||||||
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
||||||
xmlns:shuxma="using:Snap.Hutao.UI.Xaml.Media.Animation"
|
xmlns:shuxma="using:Snap.Hutao.UI.Xaml.Media.Animation"
|
||||||
|
xmlns:shuxvw="using:Snap.Hutao.UI.Xaml.View.Window"
|
||||||
xmlns:shvco="using:Snap.Hutao.View.Control"
|
xmlns:shvco="using:Snap.Hutao.View.Control"
|
||||||
xmlns:shvh="using:Snap.Hutao.ViewModel.Home"
|
xmlns:shvh="using:Snap.Hutao.ViewModel.Home"
|
||||||
d:DataContext="{d:DesignInstance shvh:AnnouncementViewModel}"
|
d:DataContext="{d:DesignInstance shvh:AnnouncementViewModel}"
|
||||||
@@ -126,24 +127,14 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<!-- 公告详情网页视图 -->
|
|
||||||
<!--<FlyoutBase.AttachedFlyout>
|
|
||||||
<Flyout LightDismissOverlayMode="On" Placement="Full">
|
|
||||||
<Flyout.FlyoutPresenterStyle>
|
|
||||||
<Style BasedOn="{StaticResource DefaultFlyoutPresenterStyle}" TargetType="FlyoutPresenter">
|
|
||||||
<Setter Property="Padding" Value="0"/>
|
|
||||||
<Setter Property="CornerRadius" Value="0"/>
|
|
||||||
<Setter Property="MaxWidth" Value="640"/>
|
|
||||||
</Style>
|
|
||||||
</Flyout.FlyoutPresenterStyle>
|
|
||||||
<shvco:AnnouncementContentViewer Announcement="{Binding}"/>
|
|
||||||
</Flyout>
|
|
||||||
</FlyoutBase.AttachedFlyout>-->
|
|
||||||
|
|
||||||
<mxi:Interaction.Behaviors>
|
<mxi:Interaction.Behaviors>
|
||||||
<!--<mxic:EventTriggerBehavior EventName="Tapped">
|
<mxic:EventTriggerBehavior EventName="Tapped">
|
||||||
<shuxba:ShowAttachedFlyoutAction/>
|
<shuxba:ShowWebView2WindowAction>
|
||||||
</mxic:EventTriggerBehavior>-->
|
<shuxba:ShowWebView2WindowAction.ContentProvider>
|
||||||
|
<shuxvw:AnnouncementWebView2ContentProvider Announcement="{Binding}"/>
|
||||||
|
</shuxba:ShowWebView2WindowAction.ContentProvider>
|
||||||
|
</shuxba:ShowWebView2WindowAction>
|
||||||
|
</mxic:EventTriggerBehavior>
|
||||||
<mxic:EventTriggerBehavior EventName="PointerEntered">
|
<mxic:EventTriggerBehavior EventName="PointerEntered">
|
||||||
<shuxba:StartAnimationActionNoThrow Animation="{Binding ElementName=ImageZoomInAnimation}" TargetObject="{Binding ElementName=ImageZoomBorder}"/>
|
<shuxba:StartAnimationActionNoThrow Animation="{Binding ElementName=ImageZoomInAnimation}" TargetObject="{Binding ElementName=ImageZoomBorder}"/>
|
||||||
</mxic:EventTriggerBehavior>
|
</mxic:EventTriggerBehavior>
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
<shuxcc:VerticalCard Grid.Column="0">
|
<shuxcc:VerticalCard Grid.Column="0">
|
||||||
<shuxcc:VerticalCard.Top>
|
<shuxcc:VerticalCard.Top>
|
||||||
<Grid cw:UIElementExtensions.ClipToBounds="True" CornerRadius="{ThemeResource ControlCornerRadius}">
|
<Grid cw:UIElementExtensions.ClipToBounds="True" CornerRadius="{ThemeResource ControlCornerRadius}">
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="64"
|
Width="64"
|
||||||
Height="64"
|
Height="64"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
<shuxcc:VerticalCard Grid.Column="1">
|
<shuxcc:VerticalCard Grid.Column="1">
|
||||||
<shuxcc:VerticalCard.Top>
|
<shuxcc:VerticalCard.Top>
|
||||||
<Grid cw:UIElementExtensions.ClipToBounds="True" CornerRadius="{ThemeResource ControlCornerRadius}">
|
<Grid cw:UIElementExtensions.ClipToBounds="True" CornerRadius="{ThemeResource ControlCornerRadius}">
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="64"
|
Width="64"
|
||||||
Height="64"
|
Height="64"
|
||||||
Icon="{Binding Weapon.Icon}"
|
Icon="{Binding Weapon.Icon}"
|
||||||
@@ -416,7 +416,7 @@
|
|||||||
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="auto"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Width="32"
|
Width="32"
|
||||||
Height="32"
|
Height="32"
|
||||||
@@ -626,7 +626,7 @@
|
|||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
cw:Effects.Shadow="{ThemeResource CompatCardShadow}"
|
cw:Effects.Shadow="{ThemeResource CompatCardShadow}"
|
||||||
Icon="{Binding SelectedAvatar.Icon}"
|
Icon="{Binding SelectedAvatar.Icon}"
|
||||||
Quality="{Binding SelectedAvatar.Quality}"/>
|
Quality="{Binding SelectedAvatar.Quality}"/>
|
||||||
@@ -672,7 +672,7 @@
|
|||||||
BorderBrush="{x:Null}"
|
BorderBrush="{x:Null}"
|
||||||
BorderThickness="0">
|
BorderThickness="0">
|
||||||
<Button.Content>
|
<Button.Content>
|
||||||
<shvcont:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
<shuxc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
||||||
</Button.Content>
|
</Button.Content>
|
||||||
<Button.Flyout>
|
<Button.Flyout>
|
||||||
<Flyout Placement="BottomEdgeAlignedLeft">
|
<Flyout Placement="BottomEdgeAlignedLeft">
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid>
|
<Grid>
|
||||||
<shvco:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="32"
|
Width="32"
|
||||||
Height="32"
|
Height="32"
|
||||||
Icon="{Binding Inner.Icon, Converter={StaticResource ItemIconConverter}}"
|
Icon="{Binding Inner.Icon, Converter={StaticResource ItemIconConverter}}"
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
<ColumnDefinition Width="auto"/>
|
<ColumnDefinition Width="auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<shvco:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="48"
|
Width="48"
|
||||||
Height="48"
|
Height="48"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
<shuxcc:HorizontalCard>
|
<shuxcc:HorizontalCard>
|
||||||
<shuxcc:HorizontalCard.Left>
|
<shuxcc:HorizontalCard.Left>
|
||||||
<Grid Grid.Column="0">
|
<Grid Grid.Column="0">
|
||||||
<shvco:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="40"
|
Width="40"
|
||||||
Height="40"
|
Height="40"
|
||||||
Icon="{Binding Inner.Icon, Converter={StaticResource ItemIconConverter}}"
|
Icon="{Binding Inner.Icon, Converter={StaticResource ItemIconConverter}}"
|
||||||
@@ -226,7 +226,7 @@
|
|||||||
BorderThickness="0">
|
BorderThickness="0">
|
||||||
<shuxcc:VerticalCard>
|
<shuxcc:VerticalCard>
|
||||||
<shuxcc:VerticalCard.Top>
|
<shuxcc:VerticalCard.Top>
|
||||||
<shvco:ItemIcon Icon="{Binding Inner.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Inner.RankLevel}"/>
|
<shuxc:ItemIcon Icon="{Binding Inner.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Inner.RankLevel}"/>
|
||||||
</shuxcc:VerticalCard.Top>
|
</shuxcc:VerticalCard.Top>
|
||||||
<shuxcc:VerticalCard.Bottom>
|
<shuxcc:VerticalCard.Bottom>
|
||||||
<TextBlock Text="{Binding Count, Mode=OneWay}"/>
|
<TextBlock Text="{Binding Count, Mode=OneWay}"/>
|
||||||
|
|||||||
@@ -140,17 +140,18 @@
|
|||||||
IsClickEnabled="True"/>
|
IsClickEnabled="True"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
<shvc:LoadingViewSlim
|
<shuxc:Loading
|
||||||
MinWidth="240"
|
MinWidth="240"
|
||||||
Margin="-16"
|
Margin="-16"
|
||||||
IsLoading="{Binding HutaoCloudViewModel.IsInitialized, Converter={StaticResource BoolNegationConverter}}"/>
|
IsLoading="{Binding HutaoCloudViewModel.IsInitialized, Converter={StaticResource BoolNegationConverter}}"
|
||||||
|
Style="{ThemeResource DefaultLoadingCardStyle}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Flyout>
|
</Flyout>
|
||||||
|
|
||||||
<DataTemplate x:Key="HistoryWishItemTemplate">
|
<DataTemplate x:Key="HistoryWishItemTemplate">
|
||||||
<Border Width="40" Style="{StaticResource BorderCardStyle}">
|
<Border Width="40" Style="{StaticResource BorderCardStyle}">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<shvc:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="38"
|
Width="38"
|
||||||
Height="38"
|
Height="38"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
@@ -215,7 +216,7 @@
|
|||||||
|
|
||||||
<DataTemplate x:Key="HistoryWishGridTemplate">
|
<DataTemplate x:Key="HistoryWishGridTemplate">
|
||||||
<Grid>
|
<Grid>
|
||||||
<shvc:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Badge="{Binding Badge}"
|
Badge="{Binding Badge}"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
Opacity="{Binding Count, Converter={StaticResource DoubleToOpacityConverter}}"
|
Opacity="{Binding Count, Converter={StaticResource DoubleToOpacityConverter}}"
|
||||||
@@ -476,10 +477,11 @@
|
|||||||
</PivotItem>
|
</PivotItem>
|
||||||
<PivotItem Header="{shuxm:ResourceString Name=ViewPageGahcaLogPivotStatistics}">
|
<PivotItem Header="{shuxm:ResourceString Name=ViewPageGahcaLogPivotStatistics}">
|
||||||
<Grid>
|
<Grid>
|
||||||
<shvc:LoadingView
|
<shuxc:Loading
|
||||||
Margin="16"
|
Margin="16"
|
||||||
CornerRadius="{ThemeResource ControlCornerRadius}"
|
CornerRadius="{ThemeResource ControlCornerRadius}"
|
||||||
IsLoading="{Binding HutaoCloudStatisticsViewModel.IsInitialized, Converter={StaticResource BoolNegationConverter}}"/>
|
IsLoading="{Binding HutaoCloudStatisticsViewModel.IsInitialized, Converter={StaticResource BoolNegationConverter}}"
|
||||||
|
Style="{ThemeResource DefaultLoadingViewStyle}"/>
|
||||||
<shuxcp:HorizontalEqualPanel
|
<shuxcp:HorizontalEqualPanel
|
||||||
Margin="16"
|
Margin="16"
|
||||||
Spacing="16"
|
Spacing="16"
|
||||||
|
|||||||
@@ -395,7 +395,7 @@
|
|||||||
ItemsSource="{Binding GamePackage.Main.Patches, Mode=OneWay}"/>
|
ItemsSource="{Binding GamePackage.Main.Patches, Mode=OneWay}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<shvc:LoadingView IsLoading="{Binding GamePackage, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
<shuxc:Loading IsLoading="{Binding GamePackage, Converter={StaticResource EmptyObjectToBoolRevertConverter}}" Style="{ThemeResource DefaultLoadingViewStyle}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
</Pivot>
|
</Pivot>
|
||||||
|
|||||||
@@ -88,7 +88,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ToolTipService.ToolTip>
|
</ToolTipService.ToolTip>
|
||||||
<Grid Height="40" CornerRadius="20">
|
<Grid Height="40" CornerRadius="20">
|
||||||
<shvcon:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="40"
|
Width="40"
|
||||||
Height="40"
|
Height="40"
|
||||||
Icon="{Binding Icon}"/>
|
Icon="{Binding Icon}"/>
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
<DataTemplate x:Key="AvatarTemplate" x:DataType="shvs:AvatarView">
|
<DataTemplate x:Key="AvatarTemplate" x:DataType="shvs:AvatarView">
|
||||||
<shvcon:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="60"
|
Width="60"
|
||||||
Height="60"
|
Height="60"
|
||||||
Margin="0,0,8,8"
|
Margin="0,0,8,8"
|
||||||
@@ -469,7 +469,7 @@
|
|||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<shuxcc:VerticalCard>
|
<shuxcc:VerticalCard>
|
||||||
<shuxcc:VerticalCard.Top>
|
<shuxcc:VerticalCard.Top>
|
||||||
<shvcon:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="52"
|
Width="52"
|
||||||
Height="52"
|
Height="52"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
@@ -511,7 +511,7 @@
|
|||||||
|
|
||||||
<Grid.Resources>
|
<Grid.Resources>
|
||||||
<DataTemplate x:Key="AvatarViewInTeamTemplate" d:DataType="shvcom:AvatarView">
|
<DataTemplate x:Key="AvatarViewInTeamTemplate" d:DataType="shvcom:AvatarView">
|
||||||
<shvcon:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="40"
|
Width="40"
|
||||||
Height="40"
|
Height="40"
|
||||||
shux:UIElementHelper.OpacityObject="{Binding Icon}"
|
shux:UIElementHelper.OpacityObject="{Binding Icon}"
|
||||||
@@ -569,7 +569,7 @@
|
|||||||
<DataTemplate x:Key="RatedAvatarTemplate" x:DataType="shvcom:AvatarView">
|
<DataTemplate x:Key="RatedAvatarTemplate" x:DataType="shvcom:AvatarView">
|
||||||
<shuxcc:HorizontalCard>
|
<shuxcc:HorizontalCard>
|
||||||
<shuxcc:HorizontalCard.Left>
|
<shuxcc:HorizontalCard.Left>
|
||||||
<shvcon:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="56"
|
Width="56"
|
||||||
Height="56"
|
Height="56"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
@@ -582,7 +582,7 @@
|
|||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Spacing="2">
|
Spacing="2">
|
||||||
<TextBlock HorizontalAlignment="Center" Text="{Binding Rate}"/>
|
<TextBlock HorizontalAlignment="Center" Text="{Binding Rate}"/>
|
||||||
<shvcon:RateDeltaTextBlock
|
<shuxct:RateDeltaTextBlock
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Text="{Binding RateDelta}"
|
Text="{Binding RateDelta}"
|
||||||
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
||||||
@@ -881,7 +881,7 @@
|
|||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<shvcon:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="48"
|
Width="48"
|
||||||
Height="48"
|
Height="48"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
@@ -894,7 +894,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
<TextBlock HorizontalAlignment="Center" Text="{Binding Rate}"/>
|
<TextBlock HorizontalAlignment="Center" Text="{Binding Rate}"/>
|
||||||
<shvcon:RateDeltaTextBlock
|
<shuxct:RateDeltaTextBlock
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Text="{Binding RateDelta}"
|
Text="{Binding RateDelta}"
|
||||||
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
||||||
@@ -910,7 +910,7 @@
|
|||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||||
<TextBlock HorizontalAlignment="Center" Text="{Binding Rate}"/>
|
<TextBlock HorizontalAlignment="Center" Text="{Binding Rate}"/>
|
||||||
<shvcon:RateDeltaTextBlock
|
<shuxct:RateDeltaTextBlock
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Text="{Binding RateDelta}"
|
Text="{Binding RateDelta}"
|
||||||
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
||||||
@@ -929,10 +929,11 @@
|
|||||||
|
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
</Pivot>
|
</Pivot>
|
||||||
<shvcon:LoadingView
|
<shuxc:Loading
|
||||||
Margin="16"
|
Margin="16"
|
||||||
CornerRadius="{ThemeResource ControlCornerRadius}"
|
CornerRadius="{ThemeResource ControlCornerRadius}"
|
||||||
IsLoading="{Binding Overview, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
IsLoading="{Binding Overview, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"
|
||||||
|
Style="{ThemeResource DefaultLoadingViewStyle}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</PivotItem>
|
</PivotItem>
|
||||||
</Pivot>
|
</Pivot>
|
||||||
|
|||||||
@@ -135,7 +135,7 @@
|
|||||||
<DataTemplate x:Key="CultivationItemTemplate">
|
<DataTemplate x:Key="CultivationItemTemplate">
|
||||||
<shuxcc:HorizontalCard>
|
<shuxcc:HorizontalCard>
|
||||||
<shuxcc:HorizontalCard.Left>
|
<shuxcc:HorizontalCard.Left>
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="40"
|
Width="40"
|
||||||
Height="40"
|
Height="40"
|
||||||
Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}"
|
Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}"
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
<DataTemplate x:Key="CollocationTemplate">
|
<DataTemplate x:Key="CollocationTemplate">
|
||||||
<shuxcc:HorizontalCard>
|
<shuxcc:HorizontalCard>
|
||||||
<shuxcc:HorizontalCard.Left>
|
<shuxcc:HorizontalCard.Left>
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="48"
|
Width="48"
|
||||||
Height="48"
|
Height="48"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
@@ -167,7 +167,7 @@
|
|||||||
Opacity="0.7"
|
Opacity="0.7"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="{Binding Rate}"/>
|
Text="{Binding Rate}"/>
|
||||||
<shvcont:RateDeltaTextBlock
|
<shuxct:RateDeltaTextBlock
|
||||||
Opacity="0.7"
|
Opacity="0.7"
|
||||||
Text="{Binding RateDelta}"
|
Text="{Binding RateDelta}"
|
||||||
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
||||||
@@ -186,7 +186,7 @@
|
|||||||
<x:Int32>0</x:Int32>
|
<x:Int32>0</x:Int32>
|
||||||
</cwc:Case.Value>
|
</cwc:Case.Value>
|
||||||
<Grid>
|
<Grid>
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="48"
|
Width="48"
|
||||||
Height="48"
|
Height="48"
|
||||||
Icon="{StaticResource UI_ItemIcon_None}"
|
Icon="{StaticResource UI_ItemIcon_None}"
|
||||||
@@ -198,7 +198,7 @@
|
|||||||
<x:Int32>1</x:Int32>
|
<x:Int32>1</x:Int32>
|
||||||
</cwc:Case.Value>
|
</cwc:Case.Value>
|
||||||
<Grid>
|
<Grid>
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="48"
|
Width="48"
|
||||||
Height="48"
|
Height="48"
|
||||||
Icon="{Binding Icons[0]}"
|
Icon="{Binding Icons[0]}"
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
<x:Int32>2</x:Int32>
|
<x:Int32>2</x:Int32>
|
||||||
</cwc:Case.Value>
|
</cwc:Case.Value>
|
||||||
<Grid>
|
<Grid>
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="48"
|
Width="48"
|
||||||
Height="48"
|
Height="48"
|
||||||
Quality="QUALITY_ORANGE"/>
|
Quality="QUALITY_ORANGE"/>
|
||||||
@@ -241,7 +241,7 @@
|
|||||||
Opacity="0.7"
|
Opacity="0.7"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="{Binding Rate}"/>
|
Text="{Binding Rate}"/>
|
||||||
<shvcont:RateDeltaTextBlock
|
<shuxct:RateDeltaTextBlock
|
||||||
Opacity="0.7"
|
Opacity="0.7"
|
||||||
Text="{Binding RateDelta}"
|
Text="{Binding RateDelta}"
|
||||||
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
||||||
@@ -291,7 +291,7 @@
|
|||||||
<DataTemplate x:Key="AvatarGridTemplate">
|
<DataTemplate x:Key="AvatarGridTemplate">
|
||||||
<shuxcc:VerticalCard>
|
<shuxcc:VerticalCard>
|
||||||
<shuxcc:VerticalCard.Top>
|
<shuxcc:VerticalCard.Top>
|
||||||
<shvcont:ItemIcon Icon="{Binding Icon, Converter={StaticResource AvatarIconConverter}, Mode=OneWay}" Quality="{Binding Quality}"/>
|
<shuxc:ItemIcon Icon="{Binding Icon, Converter={StaticResource AvatarIconConverter}, Mode=OneWay}" Quality="{Binding Quality}"/>
|
||||||
</shuxcc:VerticalCard.Top>
|
</shuxcc:VerticalCard.Top>
|
||||||
<shuxcc:VerticalCard.Bottom>
|
<shuxcc:VerticalCard.Bottom>
|
||||||
<TextBlock Text="{Binding Name}"/>
|
<TextBlock Text="{Binding Name}"/>
|
||||||
@@ -426,7 +426,7 @@
|
|||||||
Height="32"
|
Height="32"
|
||||||
Source="{Binding Selected.Weapon, Converter={StaticResource WeaponTypeIconConverter}}"/>
|
Source="{Binding Selected.Weapon, Converter={StaticResource WeaponTypeIconConverter}}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="128"
|
Width="128"
|
||||||
Height="128"
|
Height="128"
|
||||||
Icon="{Binding Selected.Icon, Converter={StaticResource AvatarIconConverter}, Mode=OneWay}"
|
Icon="{Binding Selected.Icon, Converter={StaticResource AvatarIconConverter}, Mode=OneWay}"
|
||||||
@@ -586,28 +586,28 @@
|
|||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarTeamCombinationHeader}"/>
|
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarTeamCombinationHeader}"/>
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
|
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarWeaponCombinationHeader}"/>
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="2"
|
||||||
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
|
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarArtifactSetCombinationHeader}"/>
|
||||||
<ItemsControl
|
<ItemsControl
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
ItemTemplate="{StaticResource CollocationTemplate}"
|
ItemTemplate="{StaticResource CollocationTemplate}"
|
||||||
ItemsPanel="{StaticResource StackPanelSpacing4Template}"
|
ItemsPanel="{StaticResource StackPanelSpacing4Template}"
|
||||||
ItemsSource="{Binding Selected.CollocationView.Avatars}"/>
|
ItemsSource="{Binding Selected.CollocationView.Avatars}"/>
|
||||||
<TextBlock
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="1"
|
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
|
||||||
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarWeaponCombinationHeader}"/>
|
|
||||||
<ItemsControl
|
<ItemsControl
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
ItemTemplate="{StaticResource CollocationTemplate}"
|
ItemTemplate="{StaticResource CollocationTemplate}"
|
||||||
ItemsPanel="{StaticResource StackPanelSpacing4Template}"
|
ItemsPanel="{StaticResource StackPanelSpacing4Template}"
|
||||||
ItemsSource="{Binding Selected.CollocationView.Weapons}"/>
|
ItemsSource="{Binding Selected.CollocationView.Weapons}"/>
|
||||||
<TextBlock
|
|
||||||
Grid.Row="0"
|
|
||||||
Grid.Column="2"
|
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
|
||||||
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarArtifactSetCombinationHeader}"/>
|
|
||||||
<ItemsControl
|
<ItemsControl
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -665,33 +665,11 @@
|
|||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarSpecialFoodTitle}"/>
|
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarSpecialFoodTitle}"/>
|
||||||
<shuxcc:VerticalCard
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="0,16,0,0">
|
|
||||||
<shuxcc:VerticalCard.Top>
|
|
||||||
<shvcont:ItemIcon Icon="{Binding Item.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Item.RankLevel}"/>
|
|
||||||
</shuxcc:VerticalCard.Top>
|
|
||||||
<shuxcc:VerticalCard.Bottom>
|
|
||||||
<TextBlock Text="{Binding Item.Name}"/>
|
|
||||||
</shuxcc:VerticalCard.Bottom>
|
|
||||||
</shuxcc:VerticalCard>
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="16,0,0,0"
|
Margin="16,0,0,0"
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarOriginalFoodTitle}"/>
|
Text="{shuxm:ResourceString Name=ViewPageWiKiAvatarOriginalFoodTitle}"/>
|
||||||
<shuxcc:VerticalCard
|
|
||||||
Grid.Row="1"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="16,16,0,0">
|
|
||||||
<shuxcc:VerticalCard.Top>
|
|
||||||
<shvcont:ItemIcon Icon="{Binding OriginItem.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding OriginItem.RankLevel}"/>
|
|
||||||
</shuxcc:VerticalCard.Top>
|
|
||||||
<shuxcc:VerticalCard.Bottom>
|
|
||||||
<TextBlock Text="{Binding OriginItem.Name}"/>
|
|
||||||
</shuxcc:VerticalCard.Bottom>
|
|
||||||
</shuxcc:VerticalCard>
|
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.RowSpan="4"
|
Grid.RowSpan="4"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
@@ -708,6 +686,28 @@
|
|||||||
Text="{Binding Item.EffectDescription}"
|
Text="{Binding Item.EffectDescription}"
|
||||||
TextWrapping="Wrap"/>
|
TextWrapping="Wrap"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<shuxcc:VerticalCard
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="0,16,0,0">
|
||||||
|
<shuxcc:VerticalCard.Top>
|
||||||
|
<shuxc:ItemIcon Icon="{Binding Item.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding Item.RankLevel}"/>
|
||||||
|
</shuxcc:VerticalCard.Top>
|
||||||
|
<shuxcc:VerticalCard.Bottom>
|
||||||
|
<TextBlock Text="{Binding Item.Name}"/>
|
||||||
|
</shuxcc:VerticalCard.Bottom>
|
||||||
|
</shuxcc:VerticalCard>
|
||||||
|
<shuxcc:VerticalCard
|
||||||
|
Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="16,16,0,0">
|
||||||
|
<shuxcc:VerticalCard.Top>
|
||||||
|
<shuxc:ItemIcon Icon="{Binding OriginItem.Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding OriginItem.RankLevel}"/>
|
||||||
|
</shuxcc:VerticalCard.Top>
|
||||||
|
<shuxcc:VerticalCard.Bottom>
|
||||||
|
<TextBlock Text="{Binding OriginItem.Name}"/>
|
||||||
|
</shuxcc:VerticalCard.Bottom>
|
||||||
|
</shuxcc:VerticalCard>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Expander>
|
</Expander>
|
||||||
</Border>
|
</Border>
|
||||||
@@ -807,6 +807,6 @@
|
|||||||
</cwc:Case>
|
</cwc:Case>
|
||||||
</cwc:SwitchPresenter>
|
</cwc:SwitchPresenter>
|
||||||
</Grid>
|
</Grid>
|
||||||
<shvcont:LoadingView IsLoading="{Binding Avatars, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
<shuxc:Loading IsLoading="{Binding Avatars, Converter={StaticResource EmptyObjectToBoolRevertConverter}}" Style="{ThemeResource DefaultLoadingViewStyle}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</shuxc:ScopedPage>
|
</shuxc:ScopedPage>
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
<DataTemplate x:Key="MonsterDropTemplate">
|
<DataTemplate x:Key="MonsterDropTemplate">
|
||||||
<shuxcc:HorizontalCard>
|
<shuxcc:HorizontalCard>
|
||||||
<shuxcc:HorizontalCard.Left>
|
<shuxcc:HorizontalCard.Left>
|
||||||
<shvc:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="40"
|
Width="40"
|
||||||
Height="40"
|
Height="40"
|
||||||
Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}"
|
Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}"
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
<DataTemplate x:Key="MonsterGridTemplate">
|
<DataTemplate x:Key="MonsterGridTemplate">
|
||||||
<shuxcc:VerticalCard>
|
<shuxcc:VerticalCard>
|
||||||
<shuxcc:VerticalCard.Top>
|
<shuxcc:VerticalCard.Top>
|
||||||
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource MonsterIconConverter}, Mode=OneWay}" Quality="QUALITY_NONE"/>
|
<shuxc:ItemIcon Icon="{Binding Icon, Converter={StaticResource MonsterIconConverter}, Mode=OneWay}" Quality="QUALITY_NONE"/>
|
||||||
</shuxcc:VerticalCard.Top>
|
</shuxcc:VerticalCard.Top>
|
||||||
<shuxcc:VerticalCard.Bottom>
|
<shuxcc:VerticalCard.Bottom>
|
||||||
<TextBlock Text="{Binding Name}"/>
|
<TextBlock Text="{Binding Name}"/>
|
||||||
@@ -218,6 +218,6 @@
|
|||||||
</cwc:Case>
|
</cwc:Case>
|
||||||
</cwc:SwitchPresenter>
|
</cwc:SwitchPresenter>
|
||||||
</Grid>
|
</Grid>
|
||||||
<shvc:LoadingView IsLoading="{Binding Monsters, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
<shuxc:Loading Style="{ThemeResource DefaultLoadingViewStyle}" IsLoading="{Binding Monsters, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</shuxc:ScopedPage>
|
</shuxc:ScopedPage>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
<DataTemplate x:Key="CultivateItemTemplate">
|
<DataTemplate x:Key="CultivateItemTemplate">
|
||||||
<shuxcc:HorizontalCard>
|
<shuxcc:HorizontalCard>
|
||||||
<shuxcc:HorizontalCard.Left>
|
<shuxcc:HorizontalCard.Left>
|
||||||
<shvc:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="40"
|
Width="40"
|
||||||
Height="40"
|
Height="40"
|
||||||
Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}"
|
Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}"
|
||||||
@@ -126,7 +126,7 @@
|
|||||||
<DataTemplate x:Key="CollocationTemplate">
|
<DataTemplate x:Key="CollocationTemplate">
|
||||||
<shuxcc:HorizontalCard>
|
<shuxcc:HorizontalCard>
|
||||||
<shuxcc:HorizontalCard.Left>
|
<shuxcc:HorizontalCard.Left>
|
||||||
<shvc:ItemIcon
|
<shuxc:ItemIcon
|
||||||
Width="48"
|
Width="48"
|
||||||
Height="48"
|
Height="48"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
Opacity="0.7"
|
Opacity="0.7"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="{Binding Rate}"/>
|
Text="{Binding Rate}"/>
|
||||||
<shvc:RateDeltaTextBlock
|
<shuxct:RateDeltaTextBlock
|
||||||
Opacity="0.7"
|
Opacity="0.7"
|
||||||
Text="{Binding RateDelta}"
|
Text="{Binding RateDelta}"
|
||||||
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
TextStyle="{StaticResource CaptionTextBlockStyle}"/>
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
<DataTemplate x:Key="WeaponGridTemplate">
|
<DataTemplate x:Key="WeaponGridTemplate">
|
||||||
<shuxcc:VerticalCard>
|
<shuxcc:VerticalCard>
|
||||||
<shuxcc:VerticalCard.Top>
|
<shuxcc:VerticalCard.Top>
|
||||||
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource EquipIconConverter}, Mode=OneWay}" Quality="{Binding Quality}"/>
|
<shuxc:ItemIcon Icon="{Binding Icon, Converter={StaticResource EquipIconConverter}, Mode=OneWay}" Quality="{Binding Quality}"/>
|
||||||
</shuxcc:VerticalCard.Top>
|
</shuxcc:VerticalCard.Top>
|
||||||
<shuxcc:VerticalCard.Bottom>
|
<shuxcc:VerticalCard.Bottom>
|
||||||
<TextBlock Text="{Binding Name}"/>
|
<TextBlock Text="{Binding Name}"/>
|
||||||
@@ -268,29 +268,6 @@
|
|||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Border Grid.ColumnSpan="2" Background="{ThemeResource DarkOnlyOverlayMaskColorBrush}"/>
|
<Border Grid.ColumnSpan="2" Background="{ThemeResource DarkOnlyOverlayMaskColorBrush}"/>
|
||||||
<ScrollViewer
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="16"
|
|
||||||
VerticalScrollBarVisibility="Hidden">
|
|
||||||
<StackPanel Spacing="16">
|
|
||||||
<shuxcc:VerticalCard MaxWidth="80">
|
|
||||||
<shuxcc:VerticalCard.Top>
|
|
||||||
<shvc:ItemIcon Icon="{Binding Selected.Icon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
|
|
||||||
</shuxcc:VerticalCard.Top>
|
|
||||||
<shuxcc:VerticalCard.Bottom>
|
|
||||||
<TextBlock Text="{shuxm:ResourceString Name=ViewPageWiKiWeaponBeforeAscensionTitle}"/>
|
|
||||||
</shuxcc:VerticalCard.Bottom>
|
|
||||||
</shuxcc:VerticalCard>
|
|
||||||
<shuxcc:VerticalCard MaxWidth="80">
|
|
||||||
<shuxcc:VerticalCard.Top>
|
|
||||||
<shvc:ItemIcon Icon="{Binding Selected.AwakenIcon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
|
|
||||||
</shuxcc:VerticalCard.Top>
|
|
||||||
<shuxcc:VerticalCard.Bottom>
|
|
||||||
<TextBlock Text="{shuxm:ResourceString Name=ViewPageWiKiWeaponAfterAscensionTitle}"/>
|
|
||||||
</shuxcc:VerticalCard.Bottom>
|
|
||||||
</shuxcc:VerticalCard>
|
|
||||||
</StackPanel>
|
|
||||||
</ScrollViewer>
|
|
||||||
|
|
||||||
<Grid Grid.ColumnSpan="2">
|
<Grid Grid.ColumnSpan="2">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -303,6 +280,29 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Source="{Binding Selected.Icon, Converter={StaticResource GachaEquipIconConverter}}"/>
|
Source="{Binding Selected.Icon, Converter={StaticResource GachaEquipIconConverter}}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<ScrollViewer
|
||||||
|
Grid.Column="0"
|
||||||
|
Margin="16"
|
||||||
|
VerticalScrollBarVisibility="Hidden">
|
||||||
|
<StackPanel Spacing="16">
|
||||||
|
<shuxcc:VerticalCard MaxWidth="80">
|
||||||
|
<shuxcc:VerticalCard.Top>
|
||||||
|
<shuxc:ItemIcon Icon="{Binding Selected.Icon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
|
||||||
|
</shuxcc:VerticalCard.Top>
|
||||||
|
<shuxcc:VerticalCard.Bottom>
|
||||||
|
<TextBlock Text="{shuxm:ResourceString Name=ViewPageWiKiWeaponBeforeAscensionTitle}"/>
|
||||||
|
</shuxcc:VerticalCard.Bottom>
|
||||||
|
</shuxcc:VerticalCard>
|
||||||
|
<shuxcc:VerticalCard MaxWidth="80">
|
||||||
|
<shuxcc:VerticalCard.Top>
|
||||||
|
<shuxc:ItemIcon Icon="{Binding Selected.AwakenIcon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
|
||||||
|
</shuxcc:VerticalCard.Top>
|
||||||
|
<shuxcc:VerticalCard.Bottom>
|
||||||
|
<TextBlock Text="{shuxm:ResourceString Name=ViewPageWiKiWeaponAfterAscensionTitle}"/>
|
||||||
|
</shuxcc:VerticalCard.Bottom>
|
||||||
|
</shuxcc:VerticalCard>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="16"
|
Margin="16"
|
||||||
@@ -414,6 +414,6 @@
|
|||||||
</cwc:SwitchPresenter>
|
</cwc:SwitchPresenter>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<shvc:LoadingView IsLoading="{Binding Weapons, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
<shuxc:Loading IsLoading="{Binding Weapons, Converter={StaticResource EmptyObjectToBoolRevertConverter}}" Style="{ThemeResource DefaultLoadingViewStyle}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</shuxc:ScopedPage>
|
</shuxc:ScopedPage>
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ using Windows.System;
|
|||||||
|
|
||||||
namespace Snap.Hutao.UI.Xaml.View.Window;
|
namespace Snap.Hutao.UI.Xaml.View.Window;
|
||||||
|
|
||||||
internal sealed partial class AnnouncementWebView2ContentProvider : IWebView2ContentProvider
|
[DependencyProperty("Announcement", typeof(Announcement))]
|
||||||
|
internal sealed partial class AnnouncementWebView2ContentProvider : DependencyObject, IWebView2ContentProvider
|
||||||
{
|
{
|
||||||
// support click open browser.
|
// support click open browser.
|
||||||
private const string MihoyoSDKDefinition = """
|
private const string MihoyoSDKDefinition = """
|
||||||
@@ -34,13 +35,6 @@ internal sealed partial class AnnouncementWebView2ContentProvider : IWebView2Con
|
|||||||
KeyValuePair.Create("background-color:rgb(244, 244, 245)", "background-color:rgba(11, 11, 10)"),
|
KeyValuePair.Create("background-color:rgb(244, 244, 245)", "background-color:rgba(11, 11, 10)"),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
private readonly Announcement? announcement;
|
|
||||||
|
|
||||||
public AnnouncementWebView2ContentProvider(Announcement? announcement)
|
|
||||||
{
|
|
||||||
this.announcement = announcement;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ElementTheme ActualTheme { get; set; }
|
public ElementTheme ActualTheme { get; set; }
|
||||||
|
|
||||||
public CoreWebView2? CoreWebView2 { get; set; }
|
public CoreWebView2? CoreWebView2 { get; set; }
|
||||||
@@ -113,6 +107,7 @@ internal sealed partial class AnnouncementWebView2ContentProvider : IWebView2Con
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
<title>{{announcement.Subtitle}} - {{announcement.Title}}</title>
|
||||||
<style>
|
<style>
|
||||||
body::-webkit-scrollbar {
|
body::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -141,7 +136,7 @@ internal sealed partial class AnnouncementWebView2ContentProvider : IWebView2Con
|
|||||||
|
|
||||||
private void LoadAnnouncement(CoreWebView2 coreWebView2)
|
private void LoadAnnouncement(CoreWebView2 coreWebView2)
|
||||||
{
|
{
|
||||||
coreWebView2.NavigateToString(GenerateHtml(announcement, ActualTheme));
|
coreWebView2.NavigateToString(GenerateHtml(Announcement, ActualTheme));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnWebMessageReceived(CoreWebView2 coreWebView2, CoreWebView2WebMessageReceivedEventArgs args)
|
private void OnWebMessageReceived(CoreWebView2 coreWebView2, CoreWebView2WebMessageReceivedEventArgs args)
|
||||||
|
|||||||
@@ -8,6 +8,19 @@
|
|||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Grid ActualThemeChanged="OnActualThemeChanged">
|
<Grid ActualThemeChanged="OnActualThemeChanged">
|
||||||
<WebView2 x:Name="WebView" DefaultBackgroundColor="Transparent"/>
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="44"/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid x:Name="TitleArea">
|
||||||
|
<TextBlock
|
||||||
|
x:Name="DocumentTitle"
|
||||||
|
Margin="12,0,0,0"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
</Grid>
|
||||||
|
<WebView2
|
||||||
|
x:Name="WebView"
|
||||||
|
Grid.Row="1"
|
||||||
|
DefaultBackgroundColor="Transparent"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
@@ -1,23 +1,64 @@
|
|||||||
// Copyright (c) DGP Studio. All rights reserved.
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
// Licensed under the MIT license.
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Microsoft.UI;
|
||||||
|
using Microsoft.UI.Windowing;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.Web.WebView2.Core;
|
||||||
|
using Snap.Hutao.UI.Windowing;
|
||||||
|
using Snap.Hutao.UI.Windowing.Abstraction;
|
||||||
using Snap.Hutao.Web.WebView2;
|
using Snap.Hutao.Web.WebView2;
|
||||||
|
using Snap.Hutao.Win32.Foundation;
|
||||||
|
using Snap.Hutao.Win32.UI.WindowsAndMessaging;
|
||||||
|
using static Snap.Hutao.Win32.User32;
|
||||||
|
|
||||||
namespace Snap.Hutao.UI.Xaml.View.Window;
|
namespace Snap.Hutao.UI.Xaml.View.Window;
|
||||||
|
|
||||||
internal sealed partial class WebView2Window : Microsoft.UI.Xaml.Window
|
[SuppressMessage("", "CA1001")]
|
||||||
|
internal sealed partial class WebView2Window : Microsoft.UI.Xaml.Window, IXamlWindowExtendContentIntoTitleBar, IXamlWindowClosed
|
||||||
{
|
{
|
||||||
private readonly CancellationTokenSource loadCts = new();
|
private readonly CancellationTokenSource loadCts = new();
|
||||||
private readonly IWebView2ContentProvider contentProvider;
|
private readonly IWebView2ContentProvider contentProvider;
|
||||||
|
private readonly IServiceScope scope;
|
||||||
|
private readonly AppWindow parentAppWindow;
|
||||||
|
private readonly HWND parentHWND;
|
||||||
|
|
||||||
public WebView2Window(Microsoft.UI.Xaml.Window parentWindow, IWebView2ContentProvider contentProvider)
|
public WebView2Window(WindowId parentWindowId, IWebView2ContentProvider contentProvider)
|
||||||
{
|
{
|
||||||
|
scope = Ioc.Default.CreateScope();
|
||||||
|
|
||||||
|
parentHWND = Win32Interop.GetWindowFromWindowId(parentWindowId);
|
||||||
|
parentAppWindow = AppWindow.GetFromWindowId(parentWindowId);
|
||||||
|
|
||||||
|
SetWindowLongPtrW(this.GetWindowHandle(), WINDOW_LONG_PTR_INDEX.GWLP_HWNDPARENT, parentHWND);
|
||||||
|
if (AppWindow.Presenter is OverlappedPresenter presenter)
|
||||||
|
{
|
||||||
|
presenter.IsModal = true;
|
||||||
|
}
|
||||||
|
|
||||||
this.contentProvider = contentProvider;
|
this.contentProvider = contentProvider;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
WebView.Loaded += OnWebViewLoaded;
|
WebView.Loaded += OnWebViewLoaded;
|
||||||
WebView.Unloaded += OnWebViewUnloaded;
|
WebView.Unloaded += OnWebViewUnloaded;
|
||||||
|
|
||||||
|
this.InitializeController(scope.ServiceProvider);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FrameworkElement TitleBarAccess { get => TitleArea; }
|
||||||
|
|
||||||
|
public new void Activate()
|
||||||
|
{
|
||||||
|
EnableWindow(parentHWND, false);
|
||||||
|
base.Activate();
|
||||||
|
AppWindow.MoveAndResize(parentAppWindow.GetRect());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnWindowClosed()
|
||||||
|
{
|
||||||
|
EnableWindow(parentHWND, true);
|
||||||
|
SetForegroundWindow(parentHWND);
|
||||||
|
scope.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnWebViewLoaded(object sender, RoutedEventArgs e)
|
private void OnWebViewLoaded(object sender, RoutedEventArgs e)
|
||||||
@@ -27,6 +68,7 @@ internal sealed partial class WebView2Window : Microsoft.UI.Xaml.Window
|
|||||||
async ValueTask OnWebViewLoadedAsync()
|
async ValueTask OnWebViewLoadedAsync()
|
||||||
{
|
{
|
||||||
await WebView.EnsureCoreWebView2Async();
|
await WebView.EnsureCoreWebView2Async();
|
||||||
|
WebView.CoreWebView2.DocumentTitleChanged += OnDocumentTitleChanged;
|
||||||
WebView.CoreWebView2.DisableDevToolsForReleaseBuild();
|
WebView.CoreWebView2.DisableDevToolsForReleaseBuild();
|
||||||
contentProvider.CoreWebView2 = WebView.CoreWebView2;
|
contentProvider.CoreWebView2 = WebView.CoreWebView2;
|
||||||
await contentProvider.LoadAsync(loadCts.Token).ConfigureAwait(false);
|
await contentProvider.LoadAsync(loadCts.Token).ConfigureAwait(false);
|
||||||
@@ -43,6 +85,11 @@ internal sealed partial class WebView2Window : Microsoft.UI.Xaml.Window
|
|||||||
WebView.Unloaded -= OnWebViewUnloaded;
|
WebView.Unloaded -= OnWebViewUnloaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnDocumentTitleChanged(CoreWebView2 sender, object args)
|
||||||
|
{
|
||||||
|
DocumentTitle.Text = sender.DocumentTitle;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnActualThemeChanged(FrameworkElement sender, object args)
|
private void OnActualThemeChanged(FrameworkElement sender, object args)
|
||||||
{
|
{
|
||||||
contentProvider.ActualTheme = sender.ActualTheme;
|
contentProvider.ActualTheme = sender.ActualTheme;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:shux="using:Snap.Hutao.UI.Xaml"
|
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:shuxcc="using:Snap.Hutao.UI.Xaml.Control.Card"
|
||||||
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
|
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
|
||||||
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
<DataTemplate x:Key="GridTemplate" d:DataType="shvg:StatisticsItem">
|
<DataTemplate x:Key="GridTemplate" d:DataType="shvg:StatisticsItem">
|
||||||
<shuxcc:VerticalCard>
|
<shuxcc:VerticalCard>
|
||||||
<shuxcc:VerticalCard.Top>
|
<shuxcc:VerticalCard.Top>
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
shux:FrameworkElementHelper.SquareLength="40"
|
shux:FrameworkElementHelper.SquareLength="40"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
Quality="{Binding Quality}"/>
|
Quality="{Binding Quality}"/>
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
<UserControl
|
|
||||||
x:Class="Snap.Hutao.View.Control.ItemIcon"
|
|
||||||
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:shmmc="using:Snap.Hutao.Model.Metadata.Converter"
|
|
||||||
xmlns:shux="using:Snap.Hutao.UI.Xaml"
|
|
||||||
xmlns:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
|
|
||||||
shux:FrameworkElementHelper.SquareLength="80"
|
|
||||||
mc:Ignorable="d">
|
|
||||||
<UserControl.Resources>
|
|
||||||
<shmmc:QualityConverter x:Key="QualityConverter"/>
|
|
||||||
</UserControl.Resources>
|
|
||||||
<Grid>
|
|
||||||
<Grid CornerRadius="{StaticResource ControlCornerRadius}">
|
|
||||||
<shuxci:CachedImage Source="{x:Bind Quality, Converter={StaticResource QualityConverter}, Mode=OneWay}"/>
|
|
||||||
<shuxci:CachedImage Source="{StaticResource UI_ImgSign_ItemIcon}"/>
|
|
||||||
<shuxci:CachedImage Source="{x:Bind Icon, Mode=OneWay}"/>
|
|
||||||
<shuxci:CachedImage
|
|
||||||
Margin="2"
|
|
||||||
HorizontalAlignment="Left"
|
|
||||||
VerticalAlignment="Top"
|
|
||||||
shux:FrameworkElementHelper.SquareLength="16"
|
|
||||||
Source="{x:Bind Badge, Mode=OneWay}"/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</UserControl>
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
// Copyright (c) DGP Studio. All rights reserved.
|
|
||||||
// Licensed under the MIT license.
|
|
||||||
|
|
||||||
using Microsoft.UI.Xaml;
|
|
||||||
using Microsoft.UI.Xaml.Controls;
|
|
||||||
using Snap.Hutao.Model.Intrinsic;
|
|
||||||
|
|
||||||
namespace Snap.Hutao.View.Control;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 物品图标
|
|
||||||
/// </summary>
|
|
||||||
[HighQuality]
|
|
||||||
[DependencyProperty("Quality", typeof(QualityType), QualityType.QUALITY_NONE)]
|
|
||||||
[DependencyProperty("Icon", typeof(Uri))]
|
|
||||||
[DependencyProperty("Badge", typeof(Uri))]
|
|
||||||
internal sealed partial class ItemIcon : UserControl
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 构造一个新的物品图标
|
|
||||||
/// </summary>
|
|
||||||
public ItemIcon()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<shuxc:Loading
|
|
||||||
x:Class="Snap.Hutao.View.Control.LoadingView"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:clw="using:CommunityToolkit.Labs.WinUI"
|
|
||||||
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:shuxci="using:Snap.Hutao.UI.Xaml.Control.Image"
|
|
||||||
xmlns:shuxm="using:Snap.Hutao.UI.Xaml.Markup"
|
|
||||||
HorizontalContentAlignment="Stretch"
|
|
||||||
VerticalContentAlignment="Stretch"
|
|
||||||
IsHitTestVisible="False"
|
|
||||||
Style="{StaticResource DefaultLoadingStyle}"
|
|
||||||
mc:Ignorable="d">
|
|
||||||
<Grid>
|
|
||||||
<clw:Shimmer CornerRadius="{x:Bind CornerRadius}" IsActive="{x:Bind IsLoading, Mode=OneWay}"/>
|
|
||||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
||||||
<shuxci:CachedImage
|
|
||||||
Width="120"
|
|
||||||
Height="120"
|
|
||||||
Source="{StaticResource UI_EmotionIcon272}"/>
|
|
||||||
<TextBlock
|
|
||||||
Margin="0,16,0,0"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
|
||||||
Text="{shuxm:ResourceString Name=ViewControlLoadingText}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</shuxc:Loading>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
// Copyright (c) DGP Studio. All rights reserved.
|
|
||||||
// Licensed under the MIT license.
|
|
||||||
|
|
||||||
using Snap.Hutao.UI.Xaml.Control;
|
|
||||||
|
|
||||||
namespace Snap.Hutao.View.Control;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 加载视图
|
|
||||||
/// </summary>
|
|
||||||
internal sealed partial class LoadingView : Loading
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 构造一个新的加载视图
|
|
||||||
/// </summary>
|
|
||||||
public LoadingView()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<shuxc:Loading
|
|
||||||
x:Class="Snap.Hutao.View.Control.LoadingViewSlim"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:clw="using:CommunityToolkit.Labs.WinUI"
|
|
||||||
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"
|
|
||||||
Height="{StaticResource HomeAdaptiveCardHeight}"
|
|
||||||
HorizontalContentAlignment="Stretch"
|
|
||||||
VerticalContentAlignment="Stretch"
|
|
||||||
Style="{StaticResource DefaultLoadingStyle}"
|
|
||||||
mc:Ignorable="d">
|
|
||||||
<clw:Shimmer
|
|
||||||
CornerRadius="0"
|
|
||||||
IsActive="{x:Bind IsLoading}"
|
|
||||||
Duration="0:0:1"/>
|
|
||||||
</shuxc:Loading>
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
// Copyright (c) DGP Studio. All rights reserved.
|
|
||||||
// Licensed under the MIT license.
|
|
||||||
|
|
||||||
using Snap.Hutao.UI.Xaml.Control;
|
|
||||||
|
|
||||||
namespace Snap.Hutao.View.Control;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 简单的加载视图
|
|
||||||
/// </summary>
|
|
||||||
internal sealed partial class LoadingViewSlim : Loading
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 构造一个新的简单的加载视图
|
|
||||||
/// </summary>
|
|
||||||
public LoadingViewSlim()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
BottomPadding="0,1"
|
BottomPadding="0,1"
|
||||||
ToolTipService.ToolTip="{Binding TimeFormatted}">
|
ToolTipService.ToolTip="{Binding TimeFormatted}">
|
||||||
<shuxcc:VerticalCard.Top>
|
<shuxcc:VerticalCard.Top>
|
||||||
<shvcont:ItemIcon
|
<shuxc:ItemIcon
|
||||||
shux:FrameworkElementHelper.SquareLength="40"
|
shux:FrameworkElementHelper.SquareLength="40"
|
||||||
Icon="{Binding Icon}"
|
Icon="{Binding Icon}"
|
||||||
Quality="{Binding Quality}"/>
|
Quality="{Binding Quality}"/>
|
||||||
|
|||||||
@@ -55,6 +55,10 @@ internal static class User32
|
|||||||
[SupportedOSPlatform("windows5.0")]
|
[SupportedOSPlatform("windows5.0")]
|
||||||
public static extern BOOL DestroyWindow(HWND hWnd);
|
public static extern BOOL DestroyWindow(HWND hWnd);
|
||||||
|
|
||||||
|
[DllImport("USER32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||||
|
[SupportedOSPlatform("windows5.0")]
|
||||||
|
public static extern BOOL EnableWindow([In] HWND hWnd, [In] BOOL bEnable);
|
||||||
|
|
||||||
[DllImport("USER32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
[DllImport("USER32.dll", CallingConvention = CallingConvention.Winapi, ExactSpelling = true)]
|
||||||
[SupportedOSPlatform("windows5.0")]
|
[SupportedOSPlatform("windows5.0")]
|
||||||
public static unsafe extern BOOL EqualRect(RECT* lprc1, RECT* lprc2);
|
public static unsafe extern BOOL EqualRect(RECT* lprc1, RECT* lprc2);
|
||||||
|
|||||||
Reference in New Issue
Block a user