mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
refine UI
This commit is contained in:
@@ -44,8 +44,9 @@
|
|||||||
<CornerRadius x:Key="CompatCornerRadiusSmall">2</CornerRadius>
|
<CornerRadius x:Key="CompatCornerRadiusSmall">2</CornerRadius>
|
||||||
<!-- OpenPaneLength -->
|
<!-- OpenPaneLength -->
|
||||||
<x:Double x:Key="CompatSplitViewOpenPaneLength">212</x:Double>
|
<x:Double x:Key="CompatSplitViewOpenPaneLength">212</x:Double>
|
||||||
<x:Double x:Key="CompatSplitViewOpenPaneLength2">284</x:Double>
|
|
||||||
<GridLength x:Key="CompatGridLength2">268</GridLength>
|
<x:Double x:Key="CompatSplitViewOpenPaneLength2">304</x:Double>
|
||||||
|
<GridLength x:Key="CompatGridLength2">288</GridLength>
|
||||||
|
|
||||||
<x:Double x:Key="HomeAdaptiveCardHeight">180</x:Double>
|
<x:Double x:Key="HomeAdaptiveCardHeight">180</x:Double>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
|
||||||
|
namespace Snap.Hutao.Control;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 依赖对象转换器
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TFrom">源类型</typeparam>
|
||||||
|
/// <typeparam name="TTo">目标类型</typeparam>
|
||||||
|
internal abstract class DependencyValueConverter<TFrom, TTo> : DependencyObject, IValueConverter
|
||||||
|
{
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public object? Convert(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
#if DEBUG
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return Convert((TFrom)value);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Ioc.Default
|
||||||
|
.GetRequiredService<ILogger<ValueConverter<TFrom, TTo>>>()
|
||||||
|
.LogError(ex, "值转换器异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
#else
|
||||||
|
return Convert((TFrom)value);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public object? ConvertBack(object value, Type targetType, object parameter, string language)
|
||||||
|
{
|
||||||
|
return ConvertBack((TTo)value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从源类型转换到目标类型
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="from">源</param>
|
||||||
|
/// <returns>目标</returns>
|
||||||
|
public abstract TTo Convert(TFrom from);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从目标类型转换到源类型
|
||||||
|
/// 重写时请勿调用基类方法
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="to">目标</param>
|
||||||
|
/// <returns>源</returns>
|
||||||
|
public virtual TFrom ConvertBack(TTo to)
|
||||||
|
{
|
||||||
|
throw Must.NeverHappen();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,10 +8,10 @@ using Windows.UI;
|
|||||||
namespace Snap.Hutao.Control.Media;
|
namespace Snap.Hutao.Control.Media;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// BGRA8 结构
|
/// BGRA 结构
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HighQuality]
|
[HighQuality]
|
||||||
internal struct Bgra8
|
internal struct Bgra32
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// B
|
/// B
|
||||||
@@ -38,9 +38,9 @@ internal struct Bgra8
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="color">颜色</param>
|
/// <param name="color">颜色</param>
|
||||||
/// <returns>新的 BGRA8 结构</returns>
|
/// <returns>新的 BGRA8 结构</returns>
|
||||||
public static unsafe Bgra8 FromColor(Color color)
|
public static unsafe Bgra32 FromColor(Color color)
|
||||||
{
|
{
|
||||||
Unsafe.SkipInit(out Bgra8 bgra8);
|
Unsafe.SkipInit(out Bgra32 bgra8);
|
||||||
*(uint*)&bgra8 = BinaryPrimitives.ReverseEndianness(*(uint*)&color);
|
*(uint*)&bgra8 = BinaryPrimitives.ReverseEndianness(*(uint*)&color);
|
||||||
return bgra8;
|
return bgra8;
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
// https://github.com/xunkong/desktop/tree/main/src/Desktop/Desktop/Pages/CharacterInfoPage.xaml.cs
|
// https://github.com/xunkong/desktop/tree/main/src/Desktop/Desktop/Pages/CharacterInfoPage.xaml.cs
|
||||||
|
|
||||||
using CommunityToolkit.WinUI;
|
using CommunityToolkit.WinUI;
|
||||||
|
using System.Buffers.Binary;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Windows.UI;
|
using Windows.UI;
|
||||||
|
|
||||||
@@ -13,61 +14,71 @@ namespace Snap.Hutao.Control.Media;
|
|||||||
/// RGBA 颜色
|
/// RGBA 颜色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HighQuality]
|
[HighQuality]
|
||||||
[StructLayout(LayoutKind.Explicit)]
|
internal struct Rgba32
|
||||||
internal struct Rgba8
|
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// R
|
/// R
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[FieldOffset(3)]
|
|
||||||
public byte R;
|
public byte R;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// G
|
/// G
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[FieldOffset(2)]
|
|
||||||
public byte G;
|
public byte G;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// B
|
/// B
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[FieldOffset(1)]
|
|
||||||
public byte B;
|
public byte B;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A
|
/// A
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[FieldOffset(0)]
|
|
||||||
public byte A;
|
public byte A;
|
||||||
|
|
||||||
[FieldOffset(0)]
|
|
||||||
private readonly uint data;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造一个新的 RGBA8 颜色
|
/// 构造一个新的 RGBA8 颜色
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="hex">色值字符串</param>
|
/// <param name="hex">色值字符串</param>
|
||||||
public Rgba8(in ReadOnlySpan<char> hex)
|
public unsafe Rgba32(string hex)
|
||||||
|
: this(Convert.ToUInt32(hex, 16))
|
||||||
{
|
{
|
||||||
R = 0;
|
|
||||||
G = 0;
|
|
||||||
B = 0;
|
|
||||||
A = 0;
|
|
||||||
data = Convert.ToUInt32(hex.ToString(), 16);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Rgba8(byte r, byte g, byte b, byte a)
|
/// <summary>
|
||||||
|
/// 使用 RGBA 代码初始化新的结构
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="code">RGBA 代码</param>
|
||||||
|
public unsafe Rgba32(uint code)
|
||||||
|
{
|
||||||
|
// RRGGBBAA -> AABBGGRR
|
||||||
|
fixed (Rgba32* pSelf = &this)
|
||||||
|
{
|
||||||
|
*(uint*)pSelf = BinaryPrimitives.ReverseEndianness(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Rgba32(byte r, byte g, byte b, byte a)
|
||||||
{
|
{
|
||||||
data = 0;
|
|
||||||
R = r;
|
R = r;
|
||||||
G = g;
|
G = g;
|
||||||
B = b;
|
B = b;
|
||||||
A = a;
|
A = a;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static implicit operator Color(Rgba8 hexColor)
|
public static unsafe implicit operator Color(Rgba32 hexColor)
|
||||||
{
|
{
|
||||||
return Color.FromArgb(hexColor.A, hexColor.R, hexColor.G, hexColor.B);
|
// AABBGGRR -> BBGGRRAA
|
||||||
|
// AABBGGRR -> 000000AA
|
||||||
|
uint a = (*(uint*)&hexColor) >> 24;
|
||||||
|
|
||||||
|
// AABBGGRR -> BBGGRR00
|
||||||
|
uint rgb = (*(uint*)&hexColor) << 8;
|
||||||
|
|
||||||
|
// BBGGRR00 + 000000AA
|
||||||
|
uint rgba = rgb + a;
|
||||||
|
|
||||||
|
return *(Color*)&rgba;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -75,7 +86,7 @@ internal struct Rgba8
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="hsl">HSL 颜色</param>
|
/// <param name="hsl">HSL 颜色</param>
|
||||||
/// <returns>RGBA8颜色</returns>
|
/// <returns>RGBA8颜色</returns>
|
||||||
public static Rgba8 FromHsl(HslColor hsl)
|
public static Rgba32 FromHsl(HslColor hsl)
|
||||||
{
|
{
|
||||||
double chroma = (1 - Math.Abs((2 * hsl.L) - 1)) * hsl.S;
|
double chroma = (1 - Math.Abs((2 * hsl.L) - 1)) * hsl.S;
|
||||||
double h1 = hsl.H / 60;
|
double h1 = hsl.H / 60;
|
||||||
@@ -20,15 +20,15 @@ internal static class SoftwareBitmapExtension
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="softwareBitmap">软件位图</param>
|
/// <param name="softwareBitmap">软件位图</param>
|
||||||
/// <param name="tint">底色</param>
|
/// <param name="tint">底色</param>
|
||||||
public static unsafe void NormalBlend(this SoftwareBitmap softwareBitmap, Bgra8 tint)
|
public static unsafe void NormalBlend(this SoftwareBitmap softwareBitmap, Bgra32 tint)
|
||||||
{
|
{
|
||||||
using (BitmapBuffer buffer = softwareBitmap.LockBuffer(BitmapBufferAccessMode.ReadWrite))
|
using (BitmapBuffer buffer = softwareBitmap.LockBuffer(BitmapBufferAccessMode.ReadWrite))
|
||||||
{
|
{
|
||||||
using (IMemoryBufferReference reference = buffer.CreateReference())
|
using (IMemoryBufferReference reference = buffer.CreateReference())
|
||||||
{
|
{
|
||||||
reference.As<IMemoryBufferByteAccess>().GetBuffer(out byte* data, out uint length);
|
reference.As<IMemoryBufferByteAccess>().GetBuffer(out byte* data, out uint length);
|
||||||
Span<Bgra8> bytes = new(data, unchecked((int)length / (sizeof(Bgra8) / sizeof(uint))));
|
Span<Bgra32> bytes = new(data, unchecked((int)length / sizeof(Bgra32)));
|
||||||
foreach (ref Bgra8 pixel in bytes)
|
foreach (ref Bgra32 pixel in bytes)
|
||||||
{
|
{
|
||||||
byte baseAlpha = pixel.A;
|
byte baseAlpha = pixel.A;
|
||||||
int opposite = 0xFF - baseAlpha;
|
int opposite = 0xFF - baseAlpha;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
// Licensed under the MIT license.
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
using CommunityToolkit.WinUI;
|
using CommunityToolkit.WinUI;
|
||||||
|
using CommunityToolkit.WinUI.Helpers;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Microsoft.UI.Xaml.Documents;
|
using Microsoft.UI.Xaml.Documents;
|
||||||
@@ -57,10 +58,10 @@ internal sealed class DescriptionTextBlock : ContentControl
|
|||||||
TextBlock text = (TextBlock)((DescriptionTextBlock)d).Content;
|
TextBlock text = (TextBlock)((DescriptionTextBlock)d).Content;
|
||||||
ReadOnlySpan<char> description = (string)e.NewValue;
|
ReadOnlySpan<char> description = (string)e.NewValue;
|
||||||
|
|
||||||
ApplyDescription(text, description);
|
UpdateDescription(text, description);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ApplyDescription(TextBlock text, in ReadOnlySpan<char> description)
|
private static void UpdateDescription(TextBlock text, in ReadOnlySpan<char> description)
|
||||||
{
|
{
|
||||||
text.Inlines.Clear();
|
text.Inlines.Clear();
|
||||||
|
|
||||||
@@ -68,7 +69,7 @@ internal sealed class DescriptionTextBlock : ContentControl
|
|||||||
for (int i = 0; i < description.Length;)
|
for (int i = 0; i < description.Length;)
|
||||||
{
|
{
|
||||||
// newline
|
// newline
|
||||||
if (description[i] == '\\' && description[i + 1] == 'n')
|
if (description.Slice(i, 2).SequenceEqual(@"\n"))
|
||||||
{
|
{
|
||||||
AppendText(text, description[last..i]);
|
AppendText(text, description[last..i]);
|
||||||
AppendLineBreak(text);
|
AppendLineBreak(text);
|
||||||
@@ -77,10 +78,10 @@ internal sealed class DescriptionTextBlock : ContentControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// color tag
|
// color tag
|
||||||
else if (description[i] == '<' && description[i + 1] == 'c')
|
else if (description.Slice(i, 2).SequenceEqual("<c"))
|
||||||
{
|
{
|
||||||
AppendText(text, description[last..i]);
|
AppendText(text, description[last..i]);
|
||||||
Rgba8 color = new(description.Slice(i + 8, 8));
|
Rgba32 color = new(description.Slice(i + 8, 8).ToString());
|
||||||
int length = description[(i + ColorTagLeftLength)..].IndexOf('<');
|
int length = description[(i + ColorTagLeftLength)..].IndexOf('<');
|
||||||
AppendColorText(text, description.Slice(i + ColorTagLeftLength, length), color);
|
AppendColorText(text, description.Slice(i + ColorTagLeftLength, length), color);
|
||||||
|
|
||||||
@@ -89,7 +90,7 @@ internal sealed class DescriptionTextBlock : ContentControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// italic
|
// italic
|
||||||
else if (description[i] == '<' && description[i + 1] == 'i')
|
else if (description.Slice(i, 2).SequenceEqual("<i"))
|
||||||
{
|
{
|
||||||
AppendText(text, description[last..i]);
|
AppendText(text, description[last..i]);
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ internal sealed class DescriptionTextBlock : ContentControl
|
|||||||
text.Inlines.Add(new Run { Text = slice.ToString() });
|
text.Inlines.Add(new Run { Text = slice.ToString() });
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void AppendColorText(TextBlock text, in ReadOnlySpan<char> slice, Rgba8 color)
|
private static void AppendColorText(TextBlock text, in ReadOnlySpan<char> slice, Rgba32 color)
|
||||||
{
|
{
|
||||||
Color targetColor;
|
Color targetColor;
|
||||||
if (ThemeHelper.IsDarkMode(text.ActualTheme))
|
if (ThemeHelper.IsDarkMode(text.ActualTheme))
|
||||||
@@ -127,7 +128,7 @@ internal sealed class DescriptionTextBlock : ContentControl
|
|||||||
{
|
{
|
||||||
HslColor hsl = color.ToHsl();
|
HslColor hsl = color.ToHsl();
|
||||||
hsl.L *= 0.3;
|
hsl.L *= 0.3;
|
||||||
targetColor = Rgba8.FromHsl(hsl);
|
targetColor = Rgba32.FromHsl(hsl);
|
||||||
}
|
}
|
||||||
|
|
||||||
text.Inlines.Add(new Run
|
text.Inlines.Add(new Run
|
||||||
@@ -154,6 +155,6 @@ internal sealed class DescriptionTextBlock : ContentControl
|
|||||||
private void OnActualThemeChanged(FrameworkElement sender, object args)
|
private void OnActualThemeChanged(FrameworkElement sender, object args)
|
||||||
{
|
{
|
||||||
// Simply re-apply texts
|
// Simply re-apply texts
|
||||||
ApplyDescription((TextBlock)Content, Description);
|
UpdateDescription((TextBlock)Content, Description);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
// 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.Composition.SystemBackdrops;
|
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
|
|
||||||
namespace Snap.Hutao.Control.Theme;
|
namespace Snap.Hutao.Control.Theme;
|
||||||
@@ -12,37 +11,6 @@ namespace Snap.Hutao.Control.Theme;
|
|||||||
[HighQuality]
|
[HighQuality]
|
||||||
internal static class ThemeHelper
|
internal static class ThemeHelper
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 判断主题是否相等
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="applicationTheme">应用主题</param>
|
|
||||||
/// <param name="elementTheme">元素主题</param>
|
|
||||||
/// <returns>主题是否相等</returns>
|
|
||||||
public static bool Equals(ApplicationTheme applicationTheme, ElementTheme elementTheme)
|
|
||||||
{
|
|
||||||
return (applicationTheme, elementTheme) switch
|
|
||||||
{
|
|
||||||
(ApplicationTheme.Light, ElementTheme.Light) => true,
|
|
||||||
(ApplicationTheme.Dark, ElementTheme.Dark) => true,
|
|
||||||
_ => false,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 从 <see cref="ApplicationTheme"/> 转换到 <see cref="ElementTheme"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="applicationTheme">应用主题</param>
|
|
||||||
/// <returns>元素主题</returns>
|
|
||||||
public static ElementTheme ApplicationToElement(ApplicationTheme applicationTheme)
|
|
||||||
{
|
|
||||||
return applicationTheme switch
|
|
||||||
{
|
|
||||||
ApplicationTheme.Light => ElementTheme.Light,
|
|
||||||
ApplicationTheme.Dark => ElementTheme.Dark,
|
|
||||||
_ => throw Must.NeverHappen(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 从 <see cref="ElementTheme"/> 转换到 <see cref="ApplicationTheme"/>
|
/// 从 <see cref="ElementTheme"/> 转换到 <see cref="ApplicationTheme"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -58,22 +26,6 @@ internal static class ThemeHelper
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 从 <see cref="ElementTheme"/> 转换到 <see cref="SystemBackdropTheme"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="elementTheme">元素主题</param>
|
|
||||||
/// <returns>背景主题</returns>
|
|
||||||
public static SystemBackdropTheme ElementToSystemBackdrop(ElementTheme elementTheme)
|
|
||||||
{
|
|
||||||
return elementTheme switch
|
|
||||||
{
|
|
||||||
ElementTheme.Default => SystemBackdropTheme.Default,
|
|
||||||
ElementTheme.Light => SystemBackdropTheme.Light,
|
|
||||||
ElementTheme.Dark => SystemBackdropTheme.Dark,
|
|
||||||
_ => throw Must.NeverHappen(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 检查是否为暗黑模式
|
/// 检查是否为暗黑模式
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ RemoveWindowSubclass
|
|||||||
SetWindowSubclass
|
SetWindowSubclass
|
||||||
|
|
||||||
// DWMAPI
|
// DWMAPI
|
||||||
DwmGetWindowAttribute
|
|
||||||
DwmSetWindowAttribute
|
DwmSetWindowAttribute
|
||||||
|
|
||||||
// GDI32
|
// GDI32
|
||||||
@@ -14,14 +13,11 @@ GetDeviceCaps
|
|||||||
CloseHandle
|
CloseHandle
|
||||||
CreateEventW
|
CreateEventW
|
||||||
CreateRemoteThread
|
CreateRemoteThread
|
||||||
CreateToolhelp32Snapshot
|
|
||||||
GetModuleHandleW
|
GetModuleHandleW
|
||||||
GetProcAddress
|
GetProcAddress
|
||||||
K32EnumProcessModules
|
K32EnumProcessModules
|
||||||
K32GetModuleBaseName
|
K32GetModuleBaseNameW
|
||||||
K32GetModuleInformation
|
K32GetModuleInformation
|
||||||
Module32First
|
|
||||||
Module32Next
|
|
||||||
ReadProcessMemory
|
ReadProcessMemory
|
||||||
SetEvent
|
SetEvent
|
||||||
VirtualAlloc
|
VirtualAlloc
|
||||||
|
|||||||
@@ -93,30 +93,30 @@
|
|||||||
TrueValue="{ThemeResource CardBackgroundFillColorDefaultBrush}"/>
|
TrueValue="{ThemeResource CardBackgroundFillColorDefaultBrush}"/>
|
||||||
|
|
||||||
<DataTemplate x:Key="OrangeGridTemplate" d:DataType="shvg:SummaryItem">
|
<DataTemplate x:Key="OrangeGridTemplate" d:DataType="shvg:SummaryItem">
|
||||||
<Grid Width="40" Margin="0,4,4,0">
|
<Border
|
||||||
<Border
|
Width="40"
|
||||||
Background="{Binding IsUp, Converter={StaticResource BoolToBrushConverter}}"
|
Margin="0,4,4,0"
|
||||||
Style="{StaticResource BorderCardStyle}"
|
Background="{Binding IsUp, Converter={StaticResource BoolToBrushConverter}}"
|
||||||
ToolTipService.ToolTip="{Binding TimeFormatted}">
|
Style="{StaticResource BorderCardStyle}"
|
||||||
<StackPanel>
|
ToolTipService.ToolTip="{Binding TimeFormatted}">
|
||||||
<shvcoont:ItemIcon
|
<StackPanel>
|
||||||
Width="40"
|
<shvcoont:ItemIcon
|
||||||
Height="40"
|
Width="40"
|
||||||
Icon="{Binding Icon}"
|
Height="40"
|
||||||
Quality="QUALITY_ORANGE"/>
|
Icon="{Binding Icon}"
|
||||||
<TextBlock
|
Quality="QUALITY_ORANGE"/>
|
||||||
HorizontalTextAlignment="Center"
|
<TextBlock
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
HorizontalTextAlignment="Center"
|
||||||
Text="{Binding LastPull}"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
TextTrimming="None"
|
Text="{Binding LastPull}"
|
||||||
TextWrapping="NoWrap">
|
TextTrimming="None"
|
||||||
<TextBlock.Foreground>
|
TextWrapping="NoWrap">
|
||||||
<SolidColorBrush Color="{Binding Color}"/>
|
<TextBlock.Foreground>
|
||||||
</TextBlock.Foreground>
|
<SolidColorBrush Color="{Binding Color}"/>
|
||||||
</TextBlock>
|
</TextBlock.Foreground>
|
||||||
</StackPanel>
|
</TextBlock>
|
||||||
</Border>
|
</StackPanel>
|
||||||
</Grid>
|
</Border>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
// Copyright (c) DGP Studio. All rights reserved.
|
||||||
|
// Licensed under the MIT license.
|
||||||
|
|
||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Snap.Hutao.Control;
|
||||||
|
|
||||||
|
namespace Snap.Hutao.View.Converter;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 条件转换器
|
||||||
|
/// </summary>
|
||||||
|
internal sealed class PanelSelectorModeConverter : DependencyValueConverter<string, object>
|
||||||
|
{
|
||||||
|
private static readonly DependencyProperty ListValueProperty = Property<PanelSelectorModeConverter>.Depend<object>(nameof(ListValue));
|
||||||
|
private static readonly DependencyProperty GridValueProperty = Property<PanelSelectorModeConverter>.Depend<object>(nameof(GridValue));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 列表值
|
||||||
|
/// </summary>
|
||||||
|
public object ListValue
|
||||||
|
{
|
||||||
|
get => GetValue(ListValueProperty);
|
||||||
|
set => SetValue(ListValueProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 网格值
|
||||||
|
/// </summary>
|
||||||
|
public object GridValue
|
||||||
|
{
|
||||||
|
get => GetValue(GridValueProperty);
|
||||||
|
set => SetValue(GridValueProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public override object Convert(string from)
|
||||||
|
{
|
||||||
|
return from switch
|
||||||
|
{
|
||||||
|
"List" => ListValue,
|
||||||
|
"Grid" => GridValue,
|
||||||
|
_ => default!,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
x:Class="Snap.Hutao.View.Page.AchievementPage"
|
x:Class="Snap.Hutao.View.Page.AchievementPage"
|
||||||
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:cwuc="using:CommunityToolkit.WinUI.UI.Controls"
|
||||||
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:mxi="using:Microsoft.Xaml.Interactivity"
|
xmlns:mxi="using:Microsoft.Xaml.Interactivity"
|
||||||
@@ -10,6 +11,7 @@
|
|||||||
xmlns:shcb="using:Snap.Hutao.Control.Behavior"
|
xmlns:shcb="using:Snap.Hutao.Control.Behavior"
|
||||||
xmlns:shci="using:Snap.Hutao.Control.Image"
|
xmlns:shci="using:Snap.Hutao.Control.Image"
|
||||||
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
xmlns:shcm="using:Snap.Hutao.Control.Markup"
|
||||||
|
xmlns:shcp="using:Snap.Hutao.Control.Panel"
|
||||||
xmlns:shva="using:Snap.Hutao.ViewModel.Achievement"
|
xmlns:shva="using:Snap.Hutao.ViewModel.Achievement"
|
||||||
d:DataContext="{d:DesignInstance shva:AchievementViewModel}"
|
d:DataContext="{d:DesignInstance shva:AchievementViewModel}"
|
||||||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
|
||||||
@@ -35,11 +37,14 @@
|
|||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock
|
<StackPanel Orientation="Horizontal">
|
||||||
Margin="16,0,0,2"
|
<shcp:PanelSelector x:Name="ItemsPanelSelector" Margin="8,0,0,0"/>
|
||||||
VerticalAlignment="Center"
|
<TextBlock
|
||||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
Margin="16,0,0,2"
|
||||||
Text="{Binding FinishDescription}"/>
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
|
Text="{Binding FinishDescription}"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
<CommandBar
|
<CommandBar
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
@@ -113,128 +118,184 @@
|
|||||||
Label="{shcm:ResourceString Name=ViewPageAchievementSortIncompletedItemsFirst}"/>
|
Label="{shcm:ResourceString Name=ViewPageAchievementSortIncompletedItemsFirst}"/>
|
||||||
</CommandBar>
|
</CommandBar>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<cwuc:SwitchPresenter Grid.Row="1" Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
||||||
|
<cwuc:SwitchPresenter.ContentTransitions>
|
||||||
|
<TransitionCollection>
|
||||||
|
<ContentThemeTransition/>
|
||||||
|
</TransitionCollection>
|
||||||
|
</cwuc:SwitchPresenter.ContentTransitions>
|
||||||
|
<cwuc:Case Value="List">
|
||||||
|
<SplitView
|
||||||
|
Grid.Row="1"
|
||||||
|
DisplayMode="Inline"
|
||||||
|
IsPaneOpen="True"
|
||||||
|
OpenPaneLength="{StaticResource CompatSplitViewOpenPaneLength2}"
|
||||||
|
PaneBackground="Transparent">
|
||||||
|
<SplitView.Pane>
|
||||||
|
<ListView
|
||||||
|
ItemsSource="{Binding AchievementGoals}"
|
||||||
|
SelectedItem="{Binding SelectedAchievementGoal, Mode=TwoWay}"
|
||||||
|
SelectionMode="Single">
|
||||||
|
<ListView.ItemContainerStyle>
|
||||||
|
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
|
||||||
|
<Setter Property="Margin" Value="0,0,6,0"/>
|
||||||
|
</Style>
|
||||||
|
</ListView.ItemContainerStyle>
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Grid Margin="0,6">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="36"/>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<shci:CachedImage
|
||||||
|
Grid.Column="0"
|
||||||
|
Width="36"
|
||||||
|
Height="36"
|
||||||
|
Source="{Binding Icon}"/>
|
||||||
|
<StackPanel Grid.Column="1" Margin="12,0,0,2">
|
||||||
|
<TextBlock VerticalAlignment="Center" Text="{Binding Name}"/>
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,2,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Opacity="0.7"
|
||||||
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
|
Text="{Binding FinishDescription}"/>
|
||||||
|
<ProgressBar
|
||||||
|
Margin="0,4,0,0"
|
||||||
|
Maximum="1"
|
||||||
|
Value="{Binding FinishPercent}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
|
</SplitView.Pane>
|
||||||
|
|
||||||
<SplitView
|
<SplitView.Content>
|
||||||
Grid.Row="1"
|
<ScrollViewer Padding="0,0,8,0">
|
||||||
DisplayMode="Inline"
|
<ItemsControl
|
||||||
IsPaneOpen="True"
|
Margin="8,0,0,16"
|
||||||
OpenPaneLength="{StaticResource CompatSplitViewOpenPaneLength2}"
|
ItemsPanel="{StaticResource ItemsStackPanelTemplate}"
|
||||||
PaneBackground="Transparent">
|
ItemsSource="{Binding Achievements}">
|
||||||
<SplitView.Pane>
|
<ItemsControl.ItemContainerTransitions>
|
||||||
<ListView
|
<TransitionCollection>
|
||||||
|
<ContentThemeTransition/>
|
||||||
|
</TransitionCollection>
|
||||||
|
</ItemsControl.ItemContainerTransitions>
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<Border
|
||||||
|
Margin="0,8,0,0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource BorderCardStyle}">
|
||||||
|
<Grid MinHeight="48" Padding="8">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
Grid.Column="0"
|
||||||
|
MinWidth="0"
|
||||||
|
MinHeight="0"
|
||||||
|
Margin="8,0"
|
||||||
|
Padding="0,0,0,0"
|
||||||
|
Command="{Binding Path=DataContext.SaveAchievementCommand, Source={StaticResource BindingProxy}}"
|
||||||
|
CommandParameter="{Binding}"
|
||||||
|
IsChecked="{Binding IsChecked, Mode=TwoWay}"/>
|
||||||
|
<Grid Grid.Column="1" Margin="8,0,0,0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<!-- text -->
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<!-- time -->
|
||||||
|
<ColumnDefinition Width="auto"/>
|
||||||
|
<!-- pic -->
|
||||||
|
<ColumnDefinition Width="auto"/>
|
||||||
|
<!-- count -->
|
||||||
|
<ColumnDefinition Width="32"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Inner.Title}"/>
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,2,0,0"
|
||||||
|
Style="{StaticResource SecondaryTextStyle}"
|
||||||
|
Text="{Binding Inner.Description}"
|
||||||
|
TextTrimming="CharacterEllipsis"/>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="12,0,12,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Time}"
|
||||||
|
Visibility="{Binding IsChecked, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
||||||
|
<Image
|
||||||
|
Grid.Column="2"
|
||||||
|
Height="32"
|
||||||
|
Source="ms-appx:///Resource/Icon/UI_ItemIcon_201.png"/>
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="3"
|
||||||
|
Margin="12,0,0,0"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{Binding Inner.FinishReward.Count}"/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</ScrollViewer>
|
||||||
|
</SplitView.Content>
|
||||||
|
</SplitView>
|
||||||
|
</cwuc:Case>
|
||||||
|
<cwuc:Case Value="Grid">
|
||||||
|
<GridView
|
||||||
|
Padding="12,12,6,0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Left"
|
||||||
|
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}"
|
||||||
ItemsSource="{Binding AchievementGoals}"
|
ItemsSource="{Binding AchievementGoals}"
|
||||||
SelectedItem="{Binding SelectedAchievementGoal, Mode=TwoWay}"
|
SelectedItem="{Binding SelectedAchievementGoal, Mode=TwoWay}"
|
||||||
SelectionMode="Single">
|
SelectionMode="Single">
|
||||||
<ListView.ItemContainerStyle>
|
<GridView.ItemTemplate>
|
||||||
<Style BasedOn="{StaticResource DefaultListViewItemStyle}" TargetType="ListViewItem">
|
|
||||||
<Setter Property="Margin" Value="0,0,6,0"/>
|
|
||||||
</Style>
|
|
||||||
</ListView.ItemContainerStyle>
|
|
||||||
<ListView.ItemTemplate>
|
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid Margin="0,6">
|
<Border MinWidth="180" Style="{StaticResource BorderCardStyle}">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid>
|
||||||
<ColumnDefinition Width="36"/>
|
<Grid.RowDefinitions>
|
||||||
<ColumnDefinition/>
|
<RowDefinition Height="auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
<RowDefinition/>
|
||||||
<shci:CachedImage
|
</Grid.RowDefinitions>
|
||||||
Grid.Column="0"
|
<shci:CachedImage
|
||||||
Width="36"
|
Grid.Row="0"
|
||||||
Height="36"
|
Width="64"
|
||||||
Source="{Binding Icon}"/>
|
Height="64"
|
||||||
<StackPanel Grid.Column="1" Margin="12,0,0,2">
|
Margin="8"
|
||||||
<TextBlock VerticalAlignment="Center" Text="{Binding Name}"/>
|
Source="{Binding Icon}"/>
|
||||||
<TextBlock
|
<StackPanel Grid.Row="1" Margin="8,0">
|
||||||
Margin="0,2,0,0"
|
<TextBlock
|
||||||
VerticalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Opacity="0.7"
|
Text="{Binding Name}"
|
||||||
Style="{StaticResource CaptionTextBlockStyle}"
|
TextTrimming="CharacterEllipsis"
|
||||||
Text="{Binding FinishDescription}"/>
|
TextWrapping="NoWrap"/>
|
||||||
<ProgressBar
|
<TextBlock
|
||||||
Margin="0,4,0,0"
|
Margin="0,2,0,0"
|
||||||
Maximum="1"
|
HorizontalAlignment="Center"
|
||||||
Value="{Binding FinishPercent}"/>
|
Opacity="0.7"
|
||||||
</StackPanel>
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
</Grid>
|
Text="{Binding FinishDescription}"/>
|
||||||
|
<ProgressBar
|
||||||
|
Margin="0,8"
|
||||||
|
Maximum="1"
|
||||||
|
Value="{Binding FinishPercent}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListView.ItemTemplate>
|
</GridView.ItemTemplate>
|
||||||
</ListView>
|
</GridView>
|
||||||
</SplitView.Pane>
|
</cwuc:Case>
|
||||||
|
</cwuc:SwitchPresenter>
|
||||||
<SplitView.Content>
|
|
||||||
<ScrollViewer Padding="0,0,16,0">
|
|
||||||
<ItemsControl
|
|
||||||
Margin="8,0,0,16"
|
|
||||||
ItemsPanel="{StaticResource ItemsStackPanelTemplate}"
|
|
||||||
ItemsSource="{Binding Achievements}">
|
|
||||||
<ItemsControl.ItemContainerTransitions>
|
|
||||||
<ContentThemeTransition/>
|
|
||||||
</ItemsControl.ItemContainerTransitions>
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<Border
|
|
||||||
Margin="0,8,0,0"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Style="{StaticResource BorderCardStyle}">
|
|
||||||
<Grid MinHeight="48" Padding="8">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<CheckBox
|
|
||||||
Grid.Column="0"
|
|
||||||
MinWidth="0"
|
|
||||||
MinHeight="0"
|
|
||||||
Margin="8,0"
|
|
||||||
Padding="0,0,0,0"
|
|
||||||
Command="{Binding Path=DataContext.SaveAchievementCommand, Source={StaticResource BindingProxy}}"
|
|
||||||
CommandParameter="{Binding}"
|
|
||||||
IsChecked="{Binding IsChecked, Mode=TwoWay}"/>
|
|
||||||
<Grid Grid.Column="1" Margin="8,0,0,0">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<!-- text -->
|
|
||||||
<ColumnDefinition/>
|
|
||||||
<!-- time -->
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
<!-- pic -->
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
<!-- count -->
|
|
||||||
<ColumnDefinition Width="32"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="{Binding Inner.Title}"/>
|
|
||||||
<TextBlock
|
|
||||||
Margin="0,2,0,0"
|
|
||||||
Style="{StaticResource SecondaryTextStyle}"
|
|
||||||
Text="{Binding Inner.Description}"
|
|
||||||
TextTrimming="CharacterEllipsis"/>
|
|
||||||
</StackPanel>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="12,0,12,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Time}"
|
|
||||||
Visibility="{Binding IsChecked, Converter={StaticResource BoolToVisibilityConverter}}"/>
|
|
||||||
<Image
|
|
||||||
Grid.Column="2"
|
|
||||||
Height="32"
|
|
||||||
Source="ms-appx:///Resource/Icon/UI_ItemIcon_201.png"/>
|
|
||||||
<TextBlock
|
|
||||||
Grid.Column="3"
|
|
||||||
Margin="12,0,0,0"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{Binding Inner.FinishReward.Count}"/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</ScrollViewer>
|
|
||||||
</SplitView.Content>
|
|
||||||
</SplitView>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid Visibility="{Binding SelectedArchive, Converter={StaticResource EmptyObjectToVisibilityRevertConverter}}">
|
<Grid Visibility="{Binding SelectedArchive, Converter={StaticResource EmptyObjectToVisibilityRevertConverter}}">
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -213,7 +213,7 @@
|
|||||||
<SplitView
|
<SplitView
|
||||||
DisplayMode="Inline"
|
DisplayMode="Inline"
|
||||||
IsPaneOpen="True"
|
IsPaneOpen="True"
|
||||||
OpenPaneLength="296"
|
OpenPaneLength="323"
|
||||||
PaneBackground="Transparent">
|
PaneBackground="Transparent">
|
||||||
<SplitView.Pane>
|
<SplitView.Pane>
|
||||||
<ListView ItemsSource="{Binding Statistics.HistoryWishes}" SelectedItem="{Binding SelectedHistoryWish, Mode=TwoWay}">
|
<ListView ItemsSource="{Binding Statistics.HistoryWishes}" SelectedItem="{Binding SelectedHistoryWish, Mode=TwoWay}">
|
||||||
@@ -241,64 +241,66 @@
|
|||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
Text="{Binding TotalCountFormatted}"/>
|
Text="{Binding TotalCountFormatted}"/>
|
||||||
<Border
|
<ItemsControl
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="0,6,0,0"
|
Margin="0,6,0,0"
|
||||||
Padding="2"
|
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
ItemsSource="{Binding OrangeUpList}">
|
||||||
CornerRadius="{StaticResource CompatCornerRadiusSmall}">
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsControl ItemsSource="{Binding OrangeUpList}">
|
<ItemsPanelTemplate>
|
||||||
<ItemsControl.ItemsPanel>
|
<StackPanel Orientation="Horizontal" Spacing="2"/>
|
||||||
<ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
<StackPanel Orientation="Horizontal"/>
|
</ItemsControl.ItemsPanel>
|
||||||
</ItemsPanelTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
<DataTemplate>
|
||||||
<ItemsControl.ItemTemplate>
|
<Border Width="40" Style="{StaticResource BorderCardStyle}">
|
||||||
<DataTemplate>
|
<StackPanel>
|
||||||
<StackPanel Margin="2">
|
<shvc:ItemIcon
|
||||||
<shci:CachedImage
|
Width="40"
|
||||||
Width="32"
|
Height="40"
|
||||||
Height="32"
|
Icon="{Binding Icon}"
|
||||||
Source="{Binding Icon}"/>
|
Quality="{Binding Quality}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,2,0,0"
|
HorizontalTextAlignment="Center"
|
||||||
HorizontalAlignment="Center"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="{Binding Count}"/>
|
Text="{Binding Count}"
|
||||||
|
TextTrimming="None"
|
||||||
|
TextWrapping="NoWrap"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</Border>
|
||||||
</ItemsControl.ItemTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl.ItemTemplate>
|
||||||
</Border>
|
</ItemsControl>
|
||||||
<Border
|
<ItemsControl
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Margin="0,6,0,0"
|
Margin="0,6,0,0"
|
||||||
Padding="2"
|
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Background="{StaticResource CardBackgroundFillColorDefault}"
|
ItemsSource="{Binding PurpleUpList}">
|
||||||
CornerRadius="{StaticResource CompatCornerRadiusSmall}">
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsControl ItemsSource="{Binding PurpleUpList}">
|
<ItemsPanelTemplate>
|
||||||
<ItemsControl.ItemsPanel>
|
<StackPanel Orientation="Horizontal" Spacing="2"/>
|
||||||
<ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
<StackPanel Orientation="Horizontal"/>
|
</ItemsControl.ItemsPanel>
|
||||||
</ItemsPanelTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
<DataTemplate>
|
||||||
<ItemsControl.ItemTemplate>
|
<Border Width="40" Style="{StaticResource BorderCardStyle}">
|
||||||
<DataTemplate>
|
<StackPanel>
|
||||||
<StackPanel Margin="2">
|
<shvc:ItemIcon
|
||||||
<shci:CachedImage
|
Width="40"
|
||||||
Width="32"
|
Height="40"
|
||||||
Height="32"
|
Icon="{Binding Icon}"
|
||||||
Source="{Binding Icon}"/>
|
Quality="{Binding Quality}"/>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Margin="0,2,0,0"
|
HorizontalTextAlignment="Center"
|
||||||
HorizontalAlignment="Center"
|
Style="{StaticResource CaptionTextBlockStyle}"
|
||||||
Text="{Binding Count}"/>
|
Text="{Binding Count}"
|
||||||
|
TextTrimming="None"
|
||||||
|
TextWrapping="NoWrap"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</Border>
|
||||||
</ItemsControl.ItemTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl.ItemTemplate>
|
||||||
</Border>
|
</ItemsControl>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Margin="0,6,0,8"
|
Margin="0,6,0,8"
|
||||||
|
|||||||
@@ -30,7 +30,10 @@
|
|||||||
PaneBackground="Transparent"
|
PaneBackground="Transparent"
|
||||||
Visibility="{Binding SpiralAbyssView, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
Visibility="{Binding SpiralAbyssView, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
||||||
<SplitView.Pane>
|
<SplitView.Pane>
|
||||||
<ListView ItemsSource="{Binding SpiralAbyssEntries}" SelectedItem="{Binding SelectedEntry, Mode=TwoWay}">
|
<ListView
|
||||||
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
|
ItemsSource="{Binding SpiralAbyssEntries}"
|
||||||
|
SelectedItem="{Binding SelectedEntry, Mode=TwoWay}">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Schedule}"/>
|
<TextBlock Text="{Binding Schedule}"/>
|
||||||
@@ -254,19 +257,12 @@
|
|||||||
ItemsSource="{Binding Avatars}">
|
ItemsSource="{Binding Avatars}">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<shvc:BottomTextControl Margin="0,0,8,0" Text="{Binding Name}">
|
<shvc:ItemIcon
|
||||||
<shvc:BottomTextControl.Resources>
|
Width="60"
|
||||||
<Style BasedOn="{StaticResource CaptionTextBlockStyle}" TargetType="TextBlock">
|
Height="60"
|
||||||
<Setter Property="TextWrapping" Value="NoWrap"/>
|
Margin="0,0,8,0"
|
||||||
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
|
Icon="{Binding Icon}"
|
||||||
</Style>
|
Quality="{Binding Quality}"/>
|
||||||
</shvc:BottomTextControl.Resources>
|
|
||||||
<shvc:ItemIcon
|
|
||||||
Width="60"
|
|
||||||
Height="60"
|
|
||||||
Icon="{Binding Icon}"
|
|
||||||
Quality="{Binding Quality}"/>
|
|
||||||
</shvc:BottomTextControl>
|
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
<StackPanel
|
<StackPanel
|
||||||
MaxWidth="800"
|
MaxWidth="800"
|
||||||
Margin="0,0,20,16"
|
Margin="0,0,16,16"
|
||||||
HorizontalAlignment="Left">
|
HorizontalAlignment="Left">
|
||||||
<!-- 简介 -->
|
<!-- 简介 -->
|
||||||
<Grid Margin="16,16,0,16" VerticalAlignment="Top">
|
<Grid Margin="16,16,0,16" VerticalAlignment="Top">
|
||||||
@@ -585,7 +585,7 @@
|
|||||||
</cwuc:Case>
|
</cwuc:Case>
|
||||||
<cwuc:Case Value="Grid">
|
<cwuc:Case Value="Grid">
|
||||||
<GridView
|
<GridView
|
||||||
Padding="12,12,6,0"
|
Padding="12,12,2,0"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
HorizontalContentAlignment="Left"
|
HorizontalContentAlignment="Left"
|
||||||
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}"
|
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}"
|
||||||
|
|||||||
@@ -54,15 +54,15 @@
|
|||||||
</AutoSuggestBox>
|
</AutoSuggestBox>
|
||||||
</AppBarElementContainer>
|
</AppBarElementContainer>
|
||||||
</CommandBar>
|
</CommandBar>
|
||||||
<SplitView
|
|
||||||
Grid.Row="1"
|
<cwuc:SwitchPresenter Grid.Row="1" Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
||||||
DisplayMode="Inline"
|
<cwuc:Case Value="List">
|
||||||
IsPaneOpen="True"
|
<SplitView
|
||||||
OpenPaneLength="{StaticResource CompatSplitViewOpenPaneLength2}"
|
DisplayMode="Inline"
|
||||||
PaneBackground="{StaticResource CardBackgroundFillColorSecondary}">
|
IsPaneOpen="True"
|
||||||
<SplitView.Pane>
|
OpenPaneLength="{StaticResource CompatSplitViewOpenPaneLength2}"
|
||||||
<cwuc:SwitchPresenter Grid.Row="1" Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
PaneBackground="{StaticResource CardBackgroundFillColorSecondary}">
|
||||||
<cwuc:Case Value="List">
|
<SplitView.Pane>
|
||||||
<ListView
|
<ListView
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
ItemsSource="{Binding Monsters}"
|
ItemsSource="{Binding Monsters}"
|
||||||
@@ -99,111 +99,111 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListView.ItemTemplate>
|
</ListView.ItemTemplate>
|
||||||
</ListView>
|
</ListView>
|
||||||
</cwuc:Case>
|
</SplitView.Pane>
|
||||||
<cwuc:Case Value="Grid">
|
<SplitView.Content>
|
||||||
<GridView
|
<ScrollViewer>
|
||||||
Margin="6,6,0,0"
|
<Grid>
|
||||||
HorizontalAlignment="Stretch"
|
<Grid.ColumnDefinitions>
|
||||||
HorizontalContentAlignment="Left"
|
<ColumnDefinition MaxWidth="800"/>
|
||||||
ItemsSource="{Binding Monsters}"
|
<ColumnDefinition Width="auto"/>
|
||||||
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
</Grid.ColumnDefinitions>
|
||||||
SelectionMode="Single">
|
<StackPanel Margin="0,0,16,0">
|
||||||
<GridView.ItemsPanel>
|
<TextBlock
|
||||||
<ItemsPanelTemplate>
|
Margin="16,16,0,0"
|
||||||
<ItemsWrapGrid Orientation="Horizontal"/>
|
HorizontalAlignment="Stretch"
|
||||||
</ItemsPanelTemplate>
|
VerticalAlignment="Center"
|
||||||
</GridView.ItemsPanel>
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
<GridView.ItemTemplate>
|
Text="{Binding Selected.Title}"/>
|
||||||
<DataTemplate>
|
<ItemsControl Margin="16,8,0,0" ItemsSource="{Binding Selected.Affixes}">
|
||||||
<shvc:ItemIcon
|
<ItemsControl.ItemsPanel>
|
||||||
Width="46"
|
<ItemsPanelTemplate>
|
||||||
Height="46"
|
<cwuc:WrapPanel HorizontalSpacing="8" Orientation="Horizontal"/>
|
||||||
Icon="{Binding Icon, Converter={StaticResource MonsterIconConverter}, Mode=OneWay}"
|
</ItemsPanelTemplate>
|
||||||
Quality="QUALITY_NONE"/>
|
</ItemsControl.ItemsPanel>
|
||||||
</DataTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
</GridView.ItemTemplate>
|
<DataTemplate>
|
||||||
</GridView>
|
<TextBlock Text="{Binding}"/>
|
||||||
</cwuc:Case>
|
</DataTemplate>
|
||||||
</cwuc:SwitchPresenter>
|
</ItemsControl.ItemTemplate>
|
||||||
</SplitView.Pane>
|
</ItemsControl>
|
||||||
<SplitView.Content>
|
<shvc:BaseValueSlider
|
||||||
<ScrollViewer>
|
Margin="16,16,0,0"
|
||||||
<Grid>
|
HorizontalAlignment="Stretch"
|
||||||
<Grid.ColumnDefinitions>
|
HorizontalContentAlignment="Stretch"
|
||||||
<ColumnDefinition MaxWidth="800"/>
|
BaseValueInfo="{Binding BaseValueInfo, Mode=OneWay}"
|
||||||
<ColumnDefinition Width="auto"/>
|
IsPromoteVisible="False"/>
|
||||||
</Grid.ColumnDefinitions>
|
<ItemsControl Margin="16,16,0,0" ItemsSource="{Binding Selected.BaseValue.SubHurts}">
|
||||||
<StackPanel Margin="0,0,20,0">
|
<ItemsControl.Resources>
|
||||||
<TextBlock
|
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
|
||||||
Margin="16,16,0,0"
|
<x:Double x:Key="SettingsCardWrapThreshold">0</x:Double>
|
||||||
HorizontalAlignment="Stretch"
|
<x:Double x:Key="SettingsCardWrapNoIconThreshold">0</x:Double>
|
||||||
VerticalAlignment="Center"
|
</ItemsControl.Resources>
|
||||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
<ItemsControl.ItemsPanel>
|
||||||
Text="{Binding Selected.Title}"/>
|
<ItemsPanelTemplate>
|
||||||
<ItemsControl Margin="16,8,0,0" ItemsSource="{Binding Selected.Affixes}">
|
<cwuc:UniformGrid
|
||||||
<ItemsControl.ItemsPanel>
|
ColumnSpacing="2"
|
||||||
<ItemsPanelTemplate>
|
Columns="2"
|
||||||
<cwuc:WrapPanel HorizontalSpacing="8" Orientation="Horizontal"/>
|
RowSpacing="2"/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding}"/>
|
<clw:SettingsCard Header="{Binding Name}">
|
||||||
</DataTemplate>
|
<TextBlock Text="{Binding Value}"/>
|
||||||
</ItemsControl.ItemTemplate>
|
</clw:SettingsCard>
|
||||||
</ItemsControl>
|
</DataTemplate>
|
||||||
<shvc:BaseValueSlider
|
</ItemsControl.ItemTemplate>
|
||||||
Margin="16,16,0,0"
|
</ItemsControl>
|
||||||
HorizontalAlignment="Stretch"
|
<TextBlock
|
||||||
HorizontalContentAlignment="Stretch"
|
Margin="16,32,0,0"
|
||||||
BaseValueInfo="{Binding BaseValueInfo, Mode=OneWay}"
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
IsPromoteVisible="False"/>
|
Text="{shcm:ResourceString Name=ViewPageWikiMonsterDropItems}"
|
||||||
<ItemsControl Margin="16,16,0,0" ItemsSource="{Binding Selected.BaseValue.SubHurts}">
|
Visibility="{Binding Selected.DropsView, Converter={StaticResource EmptyObjectToVisibilityConverter}}"/>
|
||||||
<ItemsControl.Resources>
|
<GridView
|
||||||
<x:Double x:Key="SettingsCardMinHeight">0</x:Double>
|
Margin="16,16,-4,12"
|
||||||
<x:Double x:Key="SettingsCardWrapThreshold">0</x:Double>
|
Padding="0"
|
||||||
<x:Double x:Key="SettingsCardWrapNoIconThreshold">0</x:Double>
|
ItemsSource="{Binding Selected.DropsView}"
|
||||||
</ItemsControl.Resources>
|
SelectionMode="None"
|
||||||
<ItemsControl.ItemsPanel>
|
Visibility="{Binding Selected.DropsView, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
||||||
<ItemsPanelTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<cwuc:UniformGrid
|
<DataTemplate>
|
||||||
ColumnSpacing="2"
|
<shvc:BottomTextControl Text="{Binding Name}">
|
||||||
Columns="2"
|
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding RankLevel}"/>
|
||||||
RowSpacing="2"/>
|
</shvc:BottomTextControl>
|
||||||
</ItemsPanelTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemTemplate>
|
||||||
<ItemsControl.ItemTemplate>
|
</GridView>
|
||||||
<DataTemplate>
|
</StackPanel>
|
||||||
<clw:SettingsCard Header="{Binding Name}">
|
</Grid>
|
||||||
<TextBlock Text="{Binding Value}"/>
|
</ScrollViewer>
|
||||||
</clw:SettingsCard>
|
</SplitView.Content>
|
||||||
</DataTemplate>
|
</SplitView>
|
||||||
</ItemsControl.ItemTemplate>
|
</cwuc:Case>
|
||||||
</ItemsControl>
|
<cwuc:Case Value="Grid">
|
||||||
<TextBlock
|
<GridView
|
||||||
Margin="16,32,0,0"
|
Padding="12,12,2,0"
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
HorizontalAlignment="Stretch"
|
||||||
Text="{shcm:ResourceString Name=ViewPageWikiMonsterDropItems}"
|
HorizontalContentAlignment="Left"
|
||||||
Visibility="{Binding Selected.DropsView, Converter={StaticResource EmptyObjectToVisibilityConverter}}"/>
|
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}"
|
||||||
<GridView
|
ItemsSource="{Binding Monsters}"
|
||||||
Margin="16,16,-4,12"
|
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
||||||
Padding="0"
|
SelectionMode="Single">
|
||||||
ItemsSource="{Binding Selected.DropsView}"
|
<GridView.ItemsPanel>
|
||||||
SelectionMode="None"
|
<ItemsPanelTemplate>
|
||||||
Visibility="{Binding Selected.DropsView, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
<ItemsWrapGrid Orientation="Horizontal"/>
|
||||||
<ItemsControl.ItemTemplate>
|
</ItemsPanelTemplate>
|
||||||
<DataTemplate>
|
</GridView.ItemsPanel>
|
||||||
<shvc:BottomTextControl Text="{Binding Name}">
|
<GridView.ItemTemplate>
|
||||||
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource ItemIconConverter}}" Quality="{Binding RankLevel}"/>
|
<DataTemplate>
|
||||||
</shvc:BottomTextControl>
|
<shvc:BottomTextControl Text="{Binding Title}">
|
||||||
</DataTemplate>
|
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource MonsterIconConverter}, Mode=OneWay}" Quality="QUALITY_NONE"/>
|
||||||
</ItemsControl.ItemTemplate>
|
</shvc:BottomTextControl>
|
||||||
</GridView>
|
</DataTemplate>
|
||||||
</StackPanel>
|
</GridView.ItemTemplate>
|
||||||
</Grid>
|
</GridView>
|
||||||
</ScrollViewer>
|
</cwuc:Case>
|
||||||
</SplitView.Content>
|
</cwuc:SwitchPresenter>
|
||||||
</SplitView>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<shvc:LoadingView IsLoading="{Binding Monsters, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
<shvc:LoadingView IsLoading="{Binding Monsters, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -69,15 +69,19 @@
|
|||||||
Icon="{shcm:FontIcon Glyph=}"
|
Icon="{shcm:FontIcon Glyph=}"
|
||||||
Label="{shcm:ResourceString Name=ViewPageWiKiGeneralAddToDevPlanButtonLabel}"/>
|
Label="{shcm:ResourceString Name=ViewPageWiKiGeneralAddToDevPlanButtonLabel}"/>
|
||||||
</CommandBar>
|
</CommandBar>
|
||||||
<SplitView
|
<cwuc:SwitchPresenter Grid.Row="1" Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
||||||
Grid.Row="1"
|
<cwuc:SwitchPresenter.ContentTransitions>
|
||||||
DisplayMode="Inline"
|
<TransitionCollection>
|
||||||
IsPaneOpen="True"
|
<ContentThemeTransition/>
|
||||||
OpenPaneLength="{StaticResource CompatSplitViewOpenPaneLength}"
|
</TransitionCollection>
|
||||||
PaneBackground="{StaticResource CardBackgroundFillColorSecondary}">
|
</cwuc:SwitchPresenter.ContentTransitions>
|
||||||
<SplitView.Pane>
|
<cwuc:Case Value="List">
|
||||||
<cwuc:SwitchPresenter Grid.Row="1" Value="{Binding ElementName=ItemsPanelSelector, Path=Current}">
|
<SplitView
|
||||||
<cwuc:Case Value="List">
|
DisplayMode="Inline"
|
||||||
|
IsPaneOpen="True"
|
||||||
|
OpenPaneLength="{StaticResource CompatSplitViewOpenPaneLength}"
|
||||||
|
PaneBackground="{StaticResource CardBackgroundFillColorSecondary}">
|
||||||
|
<SplitView.Pane>
|
||||||
<ListView
|
<ListView
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
ItemsSource="{Binding Weapons}"
|
ItemsSource="{Binding Weapons}"
|
||||||
@@ -105,144 +109,145 @@
|
|||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListView.ItemTemplate>
|
</ListView.ItemTemplate>
|
||||||
</ListView>
|
</ListView>
|
||||||
</cwuc:Case>
|
|
||||||
<cwuc:Case Value="Grid">
|
|
||||||
<GridView
|
|
||||||
Margin="6,6,0,0"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
HorizontalContentAlignment="Left"
|
|
||||||
ItemsSource="{Binding Weapons}"
|
|
||||||
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
|
||||||
SelectionMode="Single">
|
|
||||||
<GridView.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<shvc:ItemIcon
|
|
||||||
Width="44"
|
|
||||||
Height="44"
|
|
||||||
Icon="{Binding Icon, Converter={StaticResource EquipIconConverter}, Mode=OneWay}"
|
|
||||||
Quality="{Binding Quality}"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</GridView.ItemTemplate>
|
|
||||||
</GridView>
|
|
||||||
</cwuc:Case>
|
|
||||||
</cwuc:SwitchPresenter>
|
|
||||||
</SplitView.Pane>
|
|
||||||
<SplitView.Content>
|
|
||||||
<ScrollViewer>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition MaxWidth="800"/>
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<StackPanel Margin="0,0,20,0">
|
|
||||||
<Border
|
|
||||||
Margin="16,16,0,0"
|
|
||||||
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="{StaticResource CompatCornerRadius}">
|
|
||||||
<Border.Background>
|
|
||||||
<ImageBrush ImageSource="ms-appx:///Resource/Icon/UI_GachaShowPanel_Bg_Weapon.png"/>
|
|
||||||
</Border.Background>
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
<ColumnDefinition/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<mxi:Interaction.Behaviors>
|
|
||||||
<shcb:AutoHeightBehavior TargetHeight="1024" TargetWidth="2048"/>
|
|
||||||
</mxi:Interaction.Behaviors>
|
|
||||||
<ScrollViewer Grid.Column="0" Margin="16">
|
|
||||||
<StackPanel>
|
|
||||||
<shvc:BottomTextControl RequestedTheme="Light" Text="{shcm:ResourceString Name=ViewPageWiKiWeaponBeforeAscensionTitle}">
|
|
||||||
<shvc:ItemIcon Icon="{Binding Selected.Icon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
|
|
||||||
</shvc:BottomTextControl>
|
|
||||||
|
|
||||||
<shvc:BottomTextControl
|
</SplitView.Pane>
|
||||||
Margin="0,16,0,0"
|
<SplitView.Content>
|
||||||
RequestedTheme="Light"
|
<ScrollViewer>
|
||||||
Text="{shcm:ResourceString Name=ViewPageWiKiWeaponAfterAscensionTitle}">
|
<Grid>
|
||||||
<shvc:ItemIcon Icon="{Binding Selected.AwakenIcon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
|
<Grid.ColumnDefinitions>
|
||||||
</shvc:BottomTextControl>
|
<ColumnDefinition MaxWidth="800"/>
|
||||||
</StackPanel>
|
<ColumnDefinition Width="auto"/>
|
||||||
</ScrollViewer>
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Margin="0,0,16,0">
|
||||||
|
<Border
|
||||||
|
Margin="16,16,0,0"
|
||||||
|
BorderBrush="{StaticResource CardStrokeColorDefault}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="{StaticResource CompatCornerRadius}">
|
||||||
|
<Border.Background>
|
||||||
|
<ImageBrush ImageSource="ms-appx:///Resource/Icon/UI_GachaShowPanel_Bg_Weapon.png"/>
|
||||||
|
</Border.Background>
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="auto"/>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<mxi:Interaction.Behaviors>
|
||||||
|
<shcb:AutoHeightBehavior TargetHeight="1024" TargetWidth="2048"/>
|
||||||
|
</mxi:Interaction.Behaviors>
|
||||||
|
<ScrollViewer Grid.Column="0" Margin="16">
|
||||||
|
<StackPanel>
|
||||||
|
<shvc:BottomTextControl RequestedTheme="Light" Text="{shcm:ResourceString Name=ViewPageWiKiWeaponBeforeAscensionTitle}">
|
||||||
|
<shvc:ItemIcon Icon="{Binding Selected.Icon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
|
||||||
|
</shvc:BottomTextControl>
|
||||||
|
|
||||||
<Grid Grid.ColumnSpan="2">
|
<shvc:BottomTextControl
|
||||||
<Grid.ColumnDefinitions>
|
Margin="0,16,0,0"
|
||||||
<ColumnDefinition Width="176*"/>
|
RequestedTheme="Light"
|
||||||
<ColumnDefinition Width="848*"/>
|
Text="{shcm:ResourceString Name=ViewPageWiKiWeaponAfterAscensionTitle}">
|
||||||
</Grid.ColumnDefinitions>
|
<shvc:ItemIcon Icon="{Binding Selected.AwakenIcon, Converter={StaticResource EquipIconConverter}}" Quality="{Binding Selected.RankLevel}"/>
|
||||||
<shci:CachedImage
|
</shvc:BottomTextControl>
|
||||||
Grid.Column="1"
|
</StackPanel>
|
||||||
HorizontalAlignment="Center"
|
</ScrollViewer>
|
||||||
VerticalAlignment="Stretch"
|
|
||||||
Source="{Binding Selected.Icon, Converter={StaticResource GachaEquipIconConverter}}"/>
|
<Grid Grid.ColumnSpan="2">
|
||||||
</Grid>
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="176*"/>
|
||||||
|
<ColumnDefinition Width="848*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<shci:CachedImage
|
||||||
|
Grid.Column="1"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Stretch"
|
||||||
|
Source="{Binding Selected.Icon, Converter={StaticResource GachaEquipIconConverter}}"/>
|
||||||
|
</Grid>
|
||||||
|
<TextBlock
|
||||||
|
Grid.Column="1"
|
||||||
|
Margin="16"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
VerticalAlignment="Bottom"
|
||||||
|
Style="{StaticResource SubtitleTextBlockStyle}"
|
||||||
|
Text="{Binding Selected.Name}"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Column="1"
|
Margin="16,16,0,0"
|
||||||
Margin="16"
|
Text="{Binding Selected.Description}"
|
||||||
HorizontalAlignment="Right"
|
TextWrapping="Wrap"/>
|
||||||
VerticalAlignment="Bottom"
|
<shvc:BaseValueSlider
|
||||||
Style="{StaticResource SubtitleTextBlockStyle}"
|
Margin="16,16,0,0"
|
||||||
Text="{Binding Selected.Name}"/>
|
HorizontalAlignment="Stretch"
|
||||||
</Grid>
|
HorizontalContentAlignment="Stretch"
|
||||||
</Border>
|
BaseValueInfo="{Binding BaseValueInfo, Mode=OneWay}"/>
|
||||||
<TextBlock
|
<StackPanel Visibility="{Binding Selected.Affix, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
||||||
Margin="16,16,0,0"
|
<TextBlock
|
||||||
Text="{Binding Selected.Description}"
|
Margin="16,32,0,0"
|
||||||
TextWrapping="Wrap"/>
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
<shvc:BaseValueSlider
|
Text="{Binding Selected.Affix.Name}"/>
|
||||||
Margin="16,16,0,0"
|
<Pivot ItemsSource="{Binding Selected.Affix.Descriptions}">
|
||||||
HorizontalAlignment="Stretch"
|
<Pivot.HeaderTemplate>
|
||||||
HorizontalContentAlignment="Stretch"
|
<DataTemplate>
|
||||||
BaseValueInfo="{Binding BaseValueInfo, Mode=OneWay}"/>
|
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" Text="{Binding LevelFormatted}"/>
|
||||||
<StackPanel Visibility="{Binding Selected.Affix, Converter={StaticResource EmptyObjectToVisibilityConverter}}">
|
</DataTemplate>
|
||||||
<TextBlock
|
</Pivot.HeaderTemplate>
|
||||||
Margin="16,32,0,0"
|
<Pivot.ItemTemplate>
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
<DataTemplate>
|
||||||
Text="{Binding Selected.Affix.Name}"/>
|
<shct:DescriptionTextBlock Margin="16,16,0,0" Description="{Binding Description}">
|
||||||
<Pivot ItemsSource="{Binding Selected.Affix.Descriptions}">
|
<shct:DescriptionTextBlock.Resources>
|
||||||
<Pivot.HeaderTemplate>
|
<Style BasedOn="{StaticResource BodyTextBlockStyle}" TargetType="TextBlock">
|
||||||
<DataTemplate>
|
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||||
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" Text="{Binding LevelFormatted}"/>
|
</Style>
|
||||||
</DataTemplate>
|
</shct:DescriptionTextBlock.Resources>
|
||||||
</Pivot.HeaderTemplate>
|
</shct:DescriptionTextBlock>
|
||||||
<Pivot.ItemTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate>
|
</Pivot.ItemTemplate>
|
||||||
<shct:DescriptionTextBlock Margin="16,16,0,0" Description="{Binding Description}">
|
</Pivot>
|
||||||
<shct:DescriptionTextBlock.Resources>
|
</StackPanel>
|
||||||
<Style BasedOn="{StaticResource BodyTextBlockStyle}" TargetType="TextBlock">
|
|
||||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
<TextBlock
|
||||||
</Style>
|
Margin="16,32,0,0"
|
||||||
</shct:DescriptionTextBlock.Resources>
|
Style="{StaticResource BaseTextBlockStyle}"
|
||||||
</shct:DescriptionTextBlock>
|
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarTeamCombinationHeader}"/>
|
||||||
</DataTemplate>
|
<GridView
|
||||||
</Pivot.ItemTemplate>
|
Margin="16,16,0,0"
|
||||||
</Pivot>
|
HorizontalAlignment="Stretch"
|
||||||
</StackPanel>
|
HorizontalContentAlignment="Stretch"
|
||||||
|
ItemsSource="{Binding Selected.Collocation.Avatars}"
|
||||||
|
SelectionMode="None">
|
||||||
|
<GridView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<shvc:BottomTextControl Text="{Binding Rate}" ToolTipService.ToolTip="{Binding Name}">
|
||||||
|
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
||||||
|
</shvc:BottomTextControl>
|
||||||
|
</DataTemplate>
|
||||||
|
</GridView.ItemTemplate>
|
||||||
|
</GridView>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</SplitView.Content>
|
||||||
|
</SplitView>
|
||||||
|
</cwuc:Case>
|
||||||
|
<cwuc:Case Value="Grid">
|
||||||
|
<GridView
|
||||||
|
Padding="12,12,2,0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
HorizontalContentAlignment="Left"
|
||||||
|
ItemContainerStyle="{StaticResource LargeGridViewItemStyle}"
|
||||||
|
ItemsSource="{Binding Weapons}"
|
||||||
|
SelectedItem="{Binding Selected, Mode=TwoWay}"
|
||||||
|
SelectionMode="Single">
|
||||||
|
<GridView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<shvc:BottomTextControl Text="{Binding Name}">
|
||||||
|
<shvc:ItemIcon Icon="{Binding Icon, Converter={StaticResource EquipIconConverter}, Mode=OneWay}" Quality="{Binding Quality}"/>
|
||||||
|
</shvc:BottomTextControl>
|
||||||
|
</DataTemplate>
|
||||||
|
</GridView.ItemTemplate>
|
||||||
|
</GridView>
|
||||||
|
</cwuc:Case>
|
||||||
|
</cwuc:SwitchPresenter>
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Margin="16,32,0,0"
|
|
||||||
Style="{StaticResource BaseTextBlockStyle}"
|
|
||||||
Text="{shcm:ResourceString Name=ViewPageWiKiAvatarTeamCombinationHeader}"/>
|
|
||||||
<GridView
|
|
||||||
Margin="16,16,0,0"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
HorizontalContentAlignment="Stretch"
|
|
||||||
ItemsSource="{Binding Selected.Collocation.Avatars}"
|
|
||||||
SelectionMode="None">
|
|
||||||
<GridView.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<shvc:BottomTextControl Text="{Binding Rate}" ToolTipService.ToolTip="{Binding Name}">
|
|
||||||
<shvc:ItemIcon Icon="{Binding Icon}" Quality="{Binding Quality}"/>
|
|
||||||
</shvc:BottomTextControl>
|
|
||||||
</DataTemplate>
|
|
||||||
</GridView.ItemTemplate>
|
|
||||||
</GridView>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</ScrollViewer>
|
|
||||||
</SplitView.Content>
|
|
||||||
</SplitView>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
<shvc:LoadingView IsLoading="{Binding Weapons, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
<shvc:LoadingView IsLoading="{Binding Weapons, Converter={StaticResource EmptyObjectToBoolRevertConverter}}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ internal sealed partial class AvatarPropertyViewModel : Abstraction.ViewModel, I
|
|||||||
using (SoftwareBitmap softwareBitmap = SoftwareBitmap.CreateCopyFromBuffer(buffer, BitmapPixelFormat.Bgra8, bitmap.PixelWidth, bitmap.PixelHeight))
|
using (SoftwareBitmap softwareBitmap = SoftwareBitmap.CreateCopyFromBuffer(buffer, BitmapPixelFormat.Bgra8, bitmap.PixelWidth, bitmap.PixelHeight))
|
||||||
{
|
{
|
||||||
Color tintColor = serviceProvider.GetRequiredService<IAppResourceProvider>().GetResource<Color>("CompatBackgroundColor");
|
Color tintColor = serviceProvider.GetRequiredService<IAppResourceProvider>().GetResource<Color>("CompatBackgroundColor");
|
||||||
Bgra8 tint = Bgra8.FromColor(tintColor);
|
Bgra32 tint = Bgra32.FromColor(tintColor);
|
||||||
softwareBitmap.NormalBlend(tint);
|
softwareBitmap.NormalBlend(tint);
|
||||||
using (InMemoryRandomAccessStream memory = new())
|
using (InMemoryRandomAccessStream memory = new())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,10 +5,7 @@ using System.Buffers.Binary;
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Windows.Graphics;
|
using Windows.Graphics;
|
||||||
using Windows.Win32.Foundation;
|
|
||||||
using Windows.Win32.System.Diagnostics.ToolHelp;
|
|
||||||
using Windows.Win32.UI.WindowsAndMessaging;
|
using Windows.Win32.UI.WindowsAndMessaging;
|
||||||
using static Windows.Win32.PInvoke;
|
|
||||||
|
|
||||||
namespace Snap.Hutao.Win32;
|
namespace Snap.Hutao.Win32;
|
||||||
|
|
||||||
@@ -18,15 +15,6 @@ namespace Snap.Hutao.Win32;
|
|||||||
[HighQuality]
|
[HighQuality]
|
||||||
internal static class StructMarshal
|
internal static class StructMarshal
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// 构造一个新的 <see cref="Windows.Win32.System.Diagnostics.ToolHelp.MODULEENTRY32"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>新的实例</returns>
|
|
||||||
public static unsafe MODULEENTRY32 MODULEENTRY32()
|
|
||||||
{
|
|
||||||
return new() { dwSize = SizeOf<MODULEENTRY32>() };
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造一个新的 <see cref="Windows.Win32.UI.WindowsAndMessaging.WINDOWPLACEMENT"/>
|
/// 构造一个新的 <see cref="Windows.Win32.UI.WindowsAndMessaging.WINDOWPLACEMENT"/>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -91,25 +79,4 @@ internal static class StructMarshal
|
|||||||
{
|
{
|
||||||
return new(point.X, point.Y, size.Width, size.Height);
|
return new(point.X, point.Y, size.Width, size.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 枚举快照的模块
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="snapshot">快照</param>
|
|
||||||
/// <returns>模块枚举</returns>
|
|
||||||
[SuppressMessage("", "SH002")]
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
||||||
public static IEnumerable<MODULEENTRY32> EnumerateModuleEntry32(HANDLE snapshot)
|
|
||||||
{
|
|
||||||
MODULEENTRY32 entry = MODULEENTRY32();
|
|
||||||
|
|
||||||
if (Module32First(snapshot, ref entry))
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
yield return entry;
|
|
||||||
}
|
|
||||||
while (Module32Next(snapshot, ref entry));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user