Compare commits

..
Author SHA1 Message Date
Aigio Liu ee4a12e9b5 🚧 Misc 2024-08-13 20:33:37 +08:00
Aigio Liu 5e815ac0d3 🚧 Misc 2024-08-08 21:41:00 +08:00
Aigio Liu 96a14d69bd 🚧 Misc 2024-08-06 17:09:13 +08:00
Aigio Liu c79fba98d3 🚧 Misc 2024-07-04 17:51:15 +08:00
Aigio Liu 4160bb43c5 🚧 Misc 2024-06-29 00:57:23 +08:00
RMBGAME 67209f3861 🚧 Misc 2024-06-25 14:16:31 +08:00
RMBGAME 110c92d909 🐛⬆️ Avalonia 11.0-rc1 2024-06-24 14:26:48 +08:00
Aigio Liu cdc773ba74 📝 System.ArgumentException: Decoded string is not a valid IDN name. (Parameter 'unicode') 2024-06-16 00:48:32 +08:00
Aigio Liu 8ea8b73aab 🐛 System.ArgumentException: Decoded string is not a valid IDN name. (Parameter 'unicode')
at System.Globalization.IdnMapping.IcuGetAsciiCore(String unicodeString, Char* unicode, Int32 count)
   at System.Globalization.IdnMapping.GetAscii(String unicode, Int32 index, Int32 count)
   at System.Security.Cryptography.X509Certificates.SubjectAlternativeNameBuilder.AddDnsName(String dnsName)
   at BD.WTTS.Services.Implementation.CertGenerator.Add(SubjectAlternativeNameBuilder builder, String name)
2024-06-16 00:46:51 +08:00
RMBGAME 0614e172b8 ✨ 账号切换新增显示用户名设置项 2024-06-07 23:58:49 +08:00
yingpanwang 4c73a5b622 Feautre/joinsteamauthenticator (#3362)
* ✨ 导入steam令牌 新增添加 联合steam 令牌方式
2024-06-06 15:01:15 +08:00
RMBGAME 34341172b8 🚧 ItemsRepeater 2024-05-29 19:15:59 +08:00
RMBGAME 6813ed9ece ⬆️ FA 2.1.0-preview5 2024-05-27 18:23:02 +08:00
RMBGAME 3eb916e78a 🐛 蒸汽平台切换账号支持 2024-05-18 21:37:25 +08:00
RMBGAME 7424d05f54 💄 Avalonia_Edit 2024-05-17 20:27:04 +08:00
RMBGAME 76829b0ca2 🐛 fixed 挂时长启动暂停按钮显示问题 2024-05-10 17:24:43 +08:00
RMBGAME bbe98f68f6 🐛 游戏已加速情况下启动程序闪退问题修复 2024-05-06 19:04:46 +08:00
john.jiang 96025c9ef5 🎨 fixs 2024-05-06 17:12:18 +08:00
john.jiang 2fb12f1b7f 🎨 修复快速掉卡模式剩最后一个游戏闪退Bug 2024-05-06 17:07:07 +08:00
361 changed files with 4493 additions and 3849 deletions
+18
View File
@@ -496,6 +496,15 @@
"Summary": "账号平台设置集合",
"IsRegionOrEndregion": null,
"IsValueType": null
},
{
"TypeName": "bool",
"PropertyName": "IsShowAccountName",
"DefaultValue": "false",
"DefaultValueIsConst": false,
"Summary": "是否显示账号用户名",
"IsRegionOrEndregion": null,
"IsValueType": null
}
],
"Usings": ""
@@ -970,6 +979,15 @@
"Summary": "自定义 DNS over HTTPS 地址",
"IsRegionOrEndregion": null,
"IsValueType": null
},
{
"TypeName": "int",
"PropertyName": "AcceleratorTabsSelectedIndex",
"DefaultValue": "0",
"DefaultValueIsConst": false,
"Summary": "加速页面 Tab 选项卡选中下标",
"IsRegionOrEndregion": null,
"IsValueType": null
}
],
"Usings": ""
+24
View File
@@ -3,6 +3,14 @@ namespace BD.WTTS;
/// <summary>
/// 提供用来获取应用程序信息(如版本号、说明、加载的程序集等)的属性。
/// </summary>
[Mobius3(
"""
Mobius.AssemblyInfo
AssemblyInfo.cs
AssemblyInfo.Version.cs
AssemblyInfo.Version.NativeHost.cs
AssemblyInfo.Version.Setup.Windows.cs
""")]
public static partial class AssemblyInfo
{
const string Version2 = "3.0";
@@ -146,4 +154,20 @@ false
#endif
}
[AttributeUsage(AttributeTargets.All, Inherited = false)]
sealed class Mobius3Attribute : Attribute
{
public Mobius3Attribute()
{
}
public Mobius3Attribute(string str)
{
}
public bool Obsolete { get; set; }
}
+1
View File
@@ -1,3 +1,4 @@
// Mobius Properties\XmlnsDefinition.cs
#if (WINDOWS || MACCATALYST || MACOS || LINUX) && !(IOS || ANDROID)
// C# 10 定义全局 using
File diff suppressed because it is too large Load Diff
@@ -11,7 +11,7 @@
<Identity
Name="4651ED44255E.47979655102CE"
Publisher="CN=A90E406B-B2D3-4A23-B061-0FA1D65C4F66"
Version="3.0.207.0" />
Version="3.0.999.0" />
<Properties>
<DisplayName>Watt Toolkit</DisplayName>
@@ -66,15 +66,6 @@
</Application>
</Applications>
<Extensions>
<desktop2:Extension Category="windows.firewallRules">
<desktop2:FirewallRules Executable="Steam++\modules\Accelerator\Steam++.Accelerator.exe">
<desktop2:Rule Direction="in" IPProtocol="TCP" Profile="all"/>
<desktop2:Rule Direction="in" IPProtocol="UDP" Profile="all"/>
</desktop2:FirewallRules>
</desktop2:Extension>
</Extensions>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
@@ -81,8 +81,10 @@
<PackageReference Include="Avalonia" />
<PackageReference Include="Avalonia.ReactiveUI" />
<PackageReference Include="Avalonia.Controls.DataGrid" />
<PackageReference Include="Avalonia.Controls.ItemsRepeater" />
<PackageReference Include="Avalonia.Xaml.Behaviors" />
<!--<PackageReference Include="Avalonia.AvaloniaEdit" />-->
<PackageReference Include="Avalonia.AvaloniaEdit" />
<PackageReference Include="AvaloniaEdit.TextMate" />
<!--<PackageReference Include="Markdown.Avalonia" />-->
<PackageReference Include="FluentAvaloniaUI" />
<PackageReference Include="LiveChartsCore.SkiaSharpView.Avalonia" />
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.WaveProgressGradientOffsetConverter
""")]
public sealed class BitmapAssetValueConverter : ImageValueConverter
{
public override object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.ColorStringToBrushConverter
""")]
public sealed class ColorStringToBrushConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.EnumConverter
""")]
public sealed class EnumConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -2,6 +2,10 @@ using IBinding = BD.WTTS.Converters.Abstractions.IBinding;
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.EnumEqualValueConverter
""")]
public sealed class EnumEqualValueConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.EnumLocalizationNameConverter
""")]
public sealed class EnumLocalizationNameConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -2,6 +2,10 @@ using SkiaSharp;
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.Abstractions.ImageValueConverter
""")]
public abstract class ImageValueConverter : IValueConverter
{
public abstract object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture);
@@ -46,6 +50,7 @@ public abstract class ImageValueConverter : IValueConverter
/// <param name="clipStream"></param>
/// <param name="bitmap"></param>
/// <returns></returns>
[Mobius("", Obsolete = true)]
static bool TryGetBitmap([NotNullWhen(true)] ImageSource.ClipStream? clipStream, [NotNullWhen(true)] out SKBitmap? bitmap)
{
if (clipStream?.Stream == null)
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.IsNullConverter
""")]
public sealed class IsNullConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.NameToFontFamilyConverter
""")]
public sealed class NameToFontFamilyConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.RangeToSweepConverter
""")]
public sealed class RangeToSweepConverter : IMultiValueConverter
{
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.ResourceKeyValueConverter
""")]
public sealed class ResourceKeyValueConverter : IValueConverter
{
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.StringEqualsConverter
""")]
public class StringEqualsConverter : IValueConverter
{
static string ToString(object? obj) => obj?.ToString() ?? string.Empty;
@@ -2,6 +2,10 @@ using SteamKit2;
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.StringFormatConverter
""")]
public sealed class StringFormatConverter : IValueConverter, IMultiValueConverter
{
const string Size = "size";
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.VisibleStringConverter
""")]
public sealed class VisibleStringConverter : IMultiValueConverter
{
public object? Convert(IList<object?> values, Type targetType, object? parameter, CultureInfo culture)
@@ -1,5 +1,9 @@
namespace BD.WTTS.Converters;
[Mobius(
"""
Mobius.UI.Converters.WaveProgressValueConverter
""")]
public sealed class WaveProgressValueConverter : IValueConverter
{
public static readonly WaveProgressValueConverter Instance = new();
@@ -18,6 +22,10 @@ public sealed class WaveProgressValueConverter : IValueConverter
}
}
[Mobius(
"""
Mobius.UI.Converters.WaveProgressValueColorConverter
""")]
public class WaveProgressValueColorConverter : IValueConverter
{
public static readonly WaveProgressValueColorConverter Instance = new();
@@ -37,6 +45,10 @@ public class WaveProgressValueColorConverter : IValueConverter
}
}
[Mobius(
"""
Mobius.UI.Converters.WaveProgressValueTextConverter
""")]
public class WaveProgressValueTextConverter : IValueConverter
{
public static readonly WaveProgressValueTextConverter Instance = new();
@@ -54,6 +66,10 @@ public class WaveProgressValueTextConverter : IValueConverter
}
}
[Mobius(
"""
Mobius.UI.Converters.WaveProgressGradientOffsetConverter
""")]
public class WaveProgressGradientOffsetConverter : IValueConverter
{
public static readonly WaveProgressGradientOffsetConverter Instance = new();
@@ -2,6 +2,10 @@ namespace BD.WTTS.UI;
public static class ControlExtensions
{
[Mobius(
"""
Mobius.UI.ControlExtensions.SetViewModel
""")]
public static void SetViewModel<T>(this Control c, bool useCache = false) where T : ViewModelBase, new()
{
if (c.DataContext == null || c.DataContext.GetType() != typeof(T))
@@ -3,6 +3,10 @@ namespace BD.WTTS;
/// <summary>
/// <see cref="IEnumerable"/> extensions methods
/// </summary>
[Mobius(
"""
Mobius.IEnumerableExtensions
""")]
public static class IEnumerableExtensions
{
public static IEnumerable<IEnumerable> Batch(this IEnumerable source, int size)
@@ -1,6 +1,10 @@
// ReSharper disable once CheckNamespace
namespace Avalonia.Controls;
[BD.Mobius(
"""
Mobius.UI.WindowExtensions
""")]
public static partial class WindowExtensions
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -3,6 +3,10 @@ namespace BD.WTTS;
public static class WindowTransparencyLevelExtensions
{
[Mobius(
"""
Mobius.Enums.UI.WindowTransparencyLevelExtensions
""")]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static WindowTransparencyLevel ToWindowTransparencyLevel(
this WindowBackgroundMaterial value)
@@ -2,6 +2,10 @@ using BD.WTTS.Markup.Abstractions;
namespace BD.WTTS.Markup;
[Mobius(
"""
Mobius.UI.Markup.OnPlatformExtension
""")]
public sealed class OnPlatformExtension : MarkupExtension<bool>
{
public OnPlatformExtension(string member) : base(member)
@@ -1,5 +1,9 @@
namespace BD.WTTS.Services.Implementation;
[Mobius(
"""
BD.Common8.Essentials.Services.Implementation.AvaloniaMainThreadPlatformServiceImpl
""")]
sealed class MainThreadPlatformServiceImpl : IMainThreadPlatformService
{
public bool PlatformIsMainThread
@@ -4,10 +4,18 @@ using System.Collections.Immutable;
namespace BD.WTTS.Services.Implementation;
/// <inheritdoc cref="IWindowManager"/>
[Mobius(
"""
Mobius.Services.WindowManagerService
""")]
public sealed class AvaloniaWindowManagerImpl : IWindowManagerImpl
{
Type? IWindowManagerImpl.WindowType => typeof(Window);
[Mobius(
"""
Mobius.Services.WindowManagerService.GetWindowTopLevel
""")]
public static TopLevel? GetWindowTopLevel()
{
if (App.Instance.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
@@ -3,6 +3,10 @@ using static System.Net.Mime.MediaTypeNames;
namespace BD.WTTS.Services.Implementation;
[Mobius(
"""
BD.Common8.Essentials.Services.Implementation.AvaloniaClipboardPlatformServiceImpl
""")]
public sealed class AvaloniaClipboardPlatformService : IClipboardPlatformService
{
public bool PlatformHasText => !string.IsNullOrEmpty(PlatformGetTextAsync().GetAwaiter().GetResult());
@@ -5,6 +5,10 @@ using AvaNotificationType = Avalonia.Controls.Notifications.NotificationType;
namespace BD.WTTS.Services.Implementation;
[Mobius(
"""
Mobius.Services.ToastService
""")]
[TemplatePart("PART_Items", typeof(Panel))]
[PseudoClasses(":topleft", ":topright", ":bottomleft", ":bottomright")]
sealed class AvaloniaToastServiceImpl : IToastService
@@ -8,6 +8,10 @@ using WinUI = Windows.UI.StartScreen;
namespace BD.WTTS.Services.Implementation;
/// <inheritdoc cref="IJumpListService"/>
[Mobius(
"""
Mobius.Services.Platform.Windows.Abstractions.IJumpListService
""")]
internal sealed class JumpListServiceImpl : IJumpListService
{
#if WINDOWS
@@ -6,6 +6,10 @@ using System.Xml.Linq;
namespace BD.WTTS.Services.Implementation;
[Mobius(
"""
Mobius.Services.NavigationService
""")]
public sealed class NavigationService : INavigationService
{
public static NavigationService Instance { get; } = (NavigationService)Ioc.Get<INavigationService>();
@@ -14,6 +18,14 @@ public sealed class NavigationService : INavigationService
public Type? CurrnetPage => _frame?.CurrentSourcePageType;
[Mobius(
"""
isCreateInstance = true
Mobius.Services.NavigationService.GetViewModelToPageContent
isCreateInstance = false
Mobius.Services.NavigationService.GetViewModelToPageContentType
""")]
public object? GetViewModelToPageContent(object viewModel, bool isCreateInstance = true)
{
string name;
@@ -7,12 +7,28 @@ namespace BD.WTTS.UI;
partial class App
{
[Mobius(
"""
App.DefaultActualTheme
""")]
const AppTheme _DefaultActualTheme = AppTheme.FollowingSystem;
[Mobius(
"""
App.DefaultActualTheme
""")]
AppTheme IApplication.DefaultActualTheme => _DefaultActualTheme;
[Mobius(
"""
App.mTheme
""")]
AppTheme mTheme = _DefaultActualTheme;
[Mobius(
"""
App.Theme
""")]
public AppTheme Theme
{
get => mTheme;
@@ -50,6 +66,10 @@ partial class App
}
}
[Mobius(
"""
App.SetThemeNotChangeValue
""")]
public void SetThemeNotChangeValue(AppTheme value)
{
var mode = value switch
@@ -71,6 +91,10 @@ partial class App
}
}
[Mobius(
"""
App.SetThemeAccent
""")]
public static void SetThemeAccent(string? colorHex)
{
if (colorHex == null)
@@ -9,14 +9,34 @@ namespace BD.WTTS.UI;
partial class App
{
[Mobius(
"""
App.TrayMenus
""")]
public Dictionary<string, TrayMenuItem> TrayMenus { get; } = new Dictionary<string, TrayMenuItem>();
[Mobius(
"""
App.TrayIcons
""")]
public TrayIcons TrayIcons { get; init; } = new TrayIcons();
[Mobius(
"""
App.trayIconMenus
""")]
readonly Dictionary<string, ICommand> trayIconMenus = new();
[Mobius(
"""
App.TrayIconMenus
""")]
public IReadOnlyDictionary<string, ICommand> TrayIconMenus => trayIconMenus;
[Mobius(
"""
App.InitTrayIcon
""")]
void InitTrayIcon()
{
if (ApplicationLifetime is not
@@ -67,6 +87,10 @@ partial class App
}
}
[Mobius(
"""
App.UpdateMenuItems
""")]
public void UpdateMenuItems()
{
MainThread2.BeginInvokeOnMainThread(() =>
@@ -166,6 +190,10 @@ partial class App
});
}
[Mobius(
"""
App.UpdateMenuItems
""")]
public void UpdateMenuItems(string menuKey, TrayMenuItem trayMenuItem)
{
if (TrayMenus != null)
@@ -7,6 +7,10 @@ using System.Drawing.Drawing2D;
namespace BD.WTTS.UI;
[Mobius(
"""
Mobius.UI.App
""")]
public sealed partial class App : Application
{
const string TAG = "AvaApp";
@@ -233,6 +237,12 @@ public sealed partial class App : Application
public ICommand OpenBrowserCommand { get; }
[Mobius(
"""
Mobius.UI.App.OpenBrowserCommandCore
1. 不提示 打开链接失败
2. 使用统一的 OpenAuthUrl
""")]
public async void OpenBrowserCommandCore(object? url)
{
try
@@ -266,6 +276,11 @@ public sealed partial class App : Application
public ICommand CopyToClipboardCommand { get; }
[Mobius(
"""
Mobius.UI.App.OpenBrowserCommandCore
1. 不提示 复制内容失败
""")]
public async void CopyToClipboardCommandCore(object? text)
{
try
@@ -5,6 +5,10 @@ using Visual = Avalonia.Visual;
namespace BD.WTTS.UI;
[Mobius(
"""
Mobius.UI.Animations.Animations
""")]
public static class Animations
{
private static readonly Easing DefaultEasing = new LinearEasing();
@@ -3,6 +3,10 @@ using System.Windows.Input;
namespace BD.WTTS.UI;
[Mobius(
"""
Mobius.UI.Views.Controls.Stepper.DelegateInputCommand
""")]
internal class Command : ICommand
{
private readonly Action<object?> _onExecute;
@@ -3,6 +3,10 @@ using FluentAvalonia.UI.Media.Animation;
namespace BD.WTTS.UI;
[Mobius(
"""
Mobius.UI.Animations.FrameEffect
""")]
public static class FrameEffect
{
public static SlideNavigationTransitionEffect GetEffect(int oldIndex, int index)
@@ -6,6 +6,10 @@ using System.Collections.Specialized;
namespace BD.WTTS.UI;
[Mobius(
"""
Mobius.UI.Behaviors.ItemDragBehavior
""")]
public class ItemDragBehavior : Behavior<Control>
{
private bool _enableDrag;
@@ -87,7 +87,7 @@
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="Template">
<ControlTemplate>
<ui:FABorder
<Border
Name="Root"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
@@ -101,19 +101,19 @@
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
RecognizesAccessKey="True" />
</ui:FABorder>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
</Style>
</Style>
<Style Selector="^:pressed">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
@@ -122,7 +122,7 @@
</Style>
<Style Selector="^:disabled">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorDisabledBrush}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
@@ -131,7 +131,7 @@
</Style>
<Style Selector="^:checked">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundChecked}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
@@ -140,7 +140,7 @@
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundCheckedPointerOver}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
@@ -149,7 +149,7 @@
</Style>
<Style Selector="^:pressed">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundCheckedPressed}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
@@ -158,7 +158,7 @@
</Style>
<Style Selector="^:disabled">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorDisabledBrush}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
@@ -168,19 +168,19 @@
</Style>
<Style Selector="^:indeterminate">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTransparentBrush}" />
</Style>
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
</Style>
</Style>
<Style Selector="^:pressed">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
@@ -189,7 +189,7 @@
</Style>
<Style Selector="^:disabled">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorDisabledBrush}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
@@ -214,7 +214,7 @@
<Style Selector="Button.Plain:pointerover">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="Button.Plain:pointerover /template/ ui|FABorder#Root">
<Style Selector="Button.Plain:pointerover /template/ Border#Root">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="Button.Plain:pointerover /template/ ContentPresenter">
@@ -63,14 +63,13 @@
Height="10"
HorizontalAlignment="Center"
VerticalAlignment="Bottom">
<ItemsRepeater Name="Swiper" IsVisible="False">
<ItemsRepeater.Layout>
<StackLayout
DisableVirtualization="True"
Orientation="Horizontal"
Spacing="8" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<ItemsControl Name="Swiper" IsVisible="False">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="8" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<DataTemplate.DataType>
<x:Type x:TypeArguments="x:Int32, x:String" TypeName="generic:KeyValuePair" />
@@ -91,8 +90,8 @@
StrokeThickness="0" />
</Button>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Panel>
</Grid>
</Border>
@@ -46,19 +46,19 @@
<Setter Property="Template">
<ControlTemplate>
<StackPanel>
<ui:FABorder
<Border
Name="LayoutRoot"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<ui:FABorder.Transitions>
<Border.Transitions>
<Transitions>
<BrushTransition Property="Background" Duration="00:00:00.083" />
<BrushTransition Property="BorderBrush" Duration="00:00:00.083" />
</Transitions>
</ui:FABorder.Transitions>
</Border.Transitions>
<Grid MinHeight="{TemplateBinding MinHeight}" ColumnDefinitions="Auto,*,Auto,Auto">
<Viewbox
Name="IconHost"
@@ -113,7 +113,7 @@
VerticalAlignment="Center"
FontSize="18" />
</Grid>
</ui:FABorder>
</Border>
<ContentPresenter
Name="ExpandedContentPresenter"
@@ -144,10 +144,10 @@
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="spp|OptionsDisplayItem /template/ ui|FABorder#LayoutRoot:pointerover">
<Style Selector="spp|OptionsDisplayItem /template/ Border#LayoutRoot:pointerover">
<Setter Property="Background" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
</Style>
<Style Selector="spp|OptionsDisplayItem:pressed /template/ ui|FABorder#LayoutRoot:pointerover">
<Style Selector="spp|OptionsDisplayItem:pressed /template/ Border#LayoutRoot:pointerover">
<Setter Property="Background" Value="{DynamicResource ControlFillColorTertiaryBrush}" />
</Style>
@@ -179,7 +179,7 @@
<Setter Property="CornerRadius" Value="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BottomCornerRadiusFilterConverter}}" />
</Style>
<Style Selector="spp|OptionsDisplayItem:expanded /template/ ui|FABorder#LayoutRoot">
<Style Selector="spp|OptionsDisplayItem:expanded /template/ Border#LayoutRoot">
<Setter Property="CornerRadius" Value="{Binding CornerRadius, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource TopCornerRadiusFilterConverter}}" />
</Style>
@@ -195,19 +195,19 @@
<Style Selector="spp|OptionsDisplayItem.Vertical">
<Setter Property="Template">
<ControlTemplate>
<ui:FABorder
<Border
Name="LayoutRoot"
Padding="12"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<ui:FABorder.Transitions>
<Border.Transitions>
<Transitions>
<BrushTransition Property="Background" Duration="00:00:00.083" />
<BrushTransition Property="BorderBrush" Duration="00:00:00.083" />
</Transitions>
</ui:FABorder.Transitions>
</Border.Transitions>
<Grid RowDefinitions="*,*">
<Border
Width="72"
@@ -241,7 +241,7 @@
TextWrapping="Wrap" />
</StackPanel>
</Grid>
</ui:FABorder>
</Border>
</ControlTemplate>
</Setter>
</Style>
@@ -38,18 +38,18 @@
<Setter Property="MinHeight" Value="{DynamicResource SettingsExpanderItemMinHeight}" />
<Setter Property="Template">
<ControlTemplate>
<ui:FABorder
<Border
Name="Root"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ui:FABorder.Transitions>
<Border.Transitions>
<Transitions>
<BrushTransition Property="Background" Duration="00:00:00.083" />
<BrushTransition Property="BorderBrush" Duration="00:00:00.083" />
</Transitions>
</ui:FABorder.Transitions>
</Border.Transitions>
<Grid ColumnDefinitions="*,Auto,Auto" RowDefinitions="*,Auto">
<Viewbox
@@ -102,7 +102,7 @@
<ContentPresenter Name="ExpandChevronActionIconContainer" Content="{Binding TemplateSettings.ActionIcon, RelativeSource={RelativeSource TemplatedParent}}" />
</Viewbox>
</Grid>
</ui:FABorder>
</Border>
</ControlTemplate>
</Setter>
@@ -110,7 +110,7 @@
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^:nth-last-child(1) /template/ ui|FABorder#Root">
<Style Selector="^:nth-last-child(1) /template/ Border#Root">
<Setter Property="CornerRadius" Value="{Binding Source={StaticResource ControlCornerRadius}, Converter={StaticResource BottomCornerRadiusFilterConverter}}" />
</Style>
@@ -152,11 +152,11 @@
</Style>
<Style Selector="^:allowClick">
<Style Selector="^:pointerover /template/ ui|FABorder#Root">
<Style Selector="^:pointerover /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlFillColorSecondaryBrush}" />
</Style>
<Style Selector="^:pressed /template/ ui|FABorder#Root">
<Style Selector="^:pressed /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource ControlFillColorTertiaryBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
<Setter Property="TextElement.Foreground" Value="{DynamicResource TextFillColorSecondaryBrush}" />
@@ -164,7 +164,7 @@
</Style>
<Style Selector="^:disabled">
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource ControlFillColorDisabledBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}" />
<Setter Property="TextElement.Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" />
@@ -95,7 +95,7 @@
<Setter Property="Template">
<ControlTemplate>
<LayoutTransformControl Name="PART_LayoutTransformControl" UseRenderTransform="True">
<ui:FABorder
<Border
Name="ContentRoot"
VerticalAlignment="Top"
BorderBrush="{DynamicResource InfoBarBorderBrush}"
@@ -205,13 +205,13 @@
</Button>
</Grid>
</Panel>
</ui:FABorder>
</Border>
</LayoutTransformControl>
</ControlTemplate>
</Setter>
<Style Selector="^:informational">
<Style Selector="^ /template/ ui|FABorder#ContentRoot">
<Style Selector="^ /template/ Border#ContentRoot">
<!--<Setter Property="Background" Value="{DynamicResource InfoBarInformationalSeverityBackgroundBrush}" />-->
<Setter Property="Background" Value="{DynamicResource SolidBackgroundFillColorBaseBrush}" />
</Style>
@@ -226,7 +226,7 @@
</Style>
<Style Selector="^:error">
<Style Selector="^ /template/ ui|FABorder#ContentRoot">
<Style Selector="^ /template/ Border#ContentRoot">
<Setter Property="Background" Value="{DynamicResource InfoBarErrorSeverityBackgroundBrush}" />
</Style>
<Style Selector="^ /template/ Ellipse#IconBackground">
@@ -241,7 +241,7 @@
</Style>
<Style Selector="^:warning">
<Style Selector="^ /template/ ui|FABorder#ContentRoot">
<Style Selector="^ /template/ Border#ContentRoot">
<Setter Property="Background" Value="{DynamicResource InfoBarWarningSeverityBackgroundBrush}" />
</Style>
<Style Selector="^ /template/ Ellipse#IconBackground">
@@ -255,7 +255,7 @@
</Style>
<Style Selector="^:success">
<Style Selector="^ /template/ ui|FABorder#ContentRoot">
<Style Selector="^ /template/ Border#ContentRoot">
<Setter Property="Background" Value="{DynamicResource InfoBarSuccessSeverityBackgroundBrush}" />
</Style>
<Style Selector="^ /template/ Ellipse#IconBackground">
@@ -294,7 +294,7 @@
</Style>
<!-- Visible -->
<Style Selector="^:hidden /template/ ui|FABorder#ContentRoot">
<Style Selector="^:hidden /template/ Border#ContentRoot">
<Setter Property="IsVisible" Value="False" />
</Style>
@@ -75,7 +75,7 @@
<Setter Property="VerticalAlignment" Value="Stretch" />
<Setter Property="Template">
<ControlTemplate>
<ui:FABorder
<Border
Name="Root"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Background="{TemplateBinding Background}"
@@ -83,19 +83,19 @@
BorderThickness="1"
CornerRadius="{TemplateBinding CornerRadius}"
TemplatedControl.IsTemplateFocusTarget="True">
<ui:FABorder.Transitions>
<Border.Transitions>
<Transitions>
<BrushTransition Property="Background" Duration="00:00:00.083" />
</Transitions>
</ui:FABorder.Transitions>
</Border.Transitions>
<Panel>
<ui:FABorder
<Border
Name="Hover"
Margin="3"
Background="Transparent"
CornerRadius="{TemplateBinding CornerRadius}">
<ui:FABorder.Transitions>
<Border.Transitions>
<Transitions>
<BrushTransition Property="Background" Duration="00:00:00.083" />
<TransformOperationsTransition
@@ -103,8 +103,8 @@
Property="RenderTransform"
Duration="00:00:00.167" />
</Transitions>
</ui:FABorder.Transitions>
</ui:FABorder>
</Border.Transitions>
</Border>
<ContentPresenter
Name="PART_ContentPresenter"
@@ -139,19 +139,19 @@
</Rectangle>
</Panel>
</ui:FABorder>
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Style Selector="^ /template/ ui|FABorder#Hover">
<Style Selector="^ /template/ Border#Hover">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorSecondaryBrush}" />
</Style>
</Style>
<Style Selector="^:pressed">
<Style Selector="^ /template/ ui|FABorder#Hover">
<Style Selector="^ /template/ Border#Hover">
<Setter Property="Background" Value="{DynamicResource SubtleFillColorTertiaryBrush}" />
<Setter Property="RenderTransform" Value="scale(0.96)" />
</Style>
@@ -161,10 +161,10 @@
</Style>
<Style Selector="^:selected">
<Style Selector="^ /template/ ui|FABorder#Hover">
<Style Selector="^ /template/ Border#Hover">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource ControlFillColorDefaultBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlElevationBorderBrush}" />
</Style>
@@ -181,10 +181,10 @@
</Style>
<Style Selector="^:disabled">
<Style Selector="^ /template/ ui|FABorder#Hover">
<Style Selector="^ /template/ Border#Hover">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="^ /template/ ui|FABorder#Root">
<Style Selector="^ /template/ Border#Root">
<Setter Property="Background" Value="{DynamicResource ControlFillColorDisabledBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ControlAltFillColorSecondaryBrush}" />
</Style>
@@ -80,7 +80,7 @@
<Setter Property="Template">
<ControlTemplate>
<Panel Name="LayoutRoot" Background="{x:Null}">
<ui:FABorder
<Border
Name="ContentRoot"
MinWidth="{DynamicResource TaskDialogMinWidth}"
MinHeight="{DynamicResource TaskDialogMinHeight}"
@@ -216,7 +216,7 @@
</ItemsControl>
</Border>
</Grid>
</ui:FABorder>
</Border>
</Panel>
</ControlTemplate>
</Setter>
@@ -303,7 +303,7 @@
<Style Selector="^ /template/ Panel#LayoutRoot">
<Setter Property="Background" Value="{DynamicResource TaskDialogSmokeFill}" />
</Style>
<Style Selector="^ /template/ ui|FABorder#ContentRoot">
<Style Selector="^ /template/ Border#ContentRoot">
<Setter Property="BorderBrush" Value="{DynamicResource TaskDialogBorderBrush}" />
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource TaskDialogBorderWidth}" />
@@ -332,7 +332,7 @@
</Animation>
</Style.Animations>
</Style>
<Style Selector="^:hidden /template/ ui|FABorder#ContentRoot">
<Style Selector="^:hidden /template/ Border#ContentRoot">
<Style.Animations>
<Animation FillMode="Forward" Duration="00:00:00.167">
<KeyFrame Cue="0%">
@@ -368,7 +368,7 @@
</Animation>
</Style.Animations>
</Style>
<Style Selector="^:open /template/ ui|FABorder#ContentRoot">
<Style Selector="^:open /template/ Border#ContentRoot">
<Style.Animations>
<Animation FillMode="Forward" Duration="00:00:00.250">
<KeyFrame Cue="0%">
@@ -389,7 +389,7 @@
<Setter Property="Template">
<ControlTemplate>
<Panel Name="LayoutRoot" Background="{x:Null}">
<ui:FABorder
<Border
Name="ContentRoot"
MinWidth="{DynamicResource TaskDialogMinWidth}"
MinHeight="{DynamicResource TaskDialogMinHeight}"
@@ -521,7 +521,7 @@
</ItemsControl>
</Border>
</Grid>
</ui:FABorder>
</Border>
</Panel>
</ControlTemplate>
</Setter>
@@ -14,4 +14,5 @@
</Styles.Resources>
<StyleInclude Source="/UI/Styling/Controls.axaml" />
<StyleInclude Source="avares://AvaloniaEdit/Themes/Fluent/AvaloniaEdit.xaml" />
</Styles>
@@ -3,6 +3,10 @@ namespace BD.WTTS.UI.Styling;
/// <summary>
/// Includes the fluent theme in an application.
/// </summary>
[Mobius(
"""
Mobius.UI.Styling.CustomTheme
""")]
public class CustomTheme : Styles, IResourceProvider
{
public const string LightModeString = "Light";
@@ -5,6 +5,10 @@ using FluentAvalonia.UI.Navigation;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages.Abstractions.PageBase
""")]
public class PageBase : UserControl
{
public PageBase() : base()
@@ -321,6 +325,10 @@ public class PageBase : UserControl
private CompositeDisposable _disposables;
}
[Mobius(
"""
Mobius.UI.Views.Pages.Abstractions.PageBase<TViewModel>
""")]
public class PageBase<TViewModel> : PageBase, IViewFor<TViewModel> where TViewModel : class
{
public static readonly StyledProperty<TViewModel?> ViewModelProperty = AvaloniaProperty.Register<PageBase<TViewModel>, TViewModel?>(nameof(ViewModel));
@@ -7,6 +7,10 @@ namespace BD.WTTS.UI.Views.Windows;
/// and vice versa.
/// </summary>
/// <typeparam name="TViewModel">ViewModel type.</typeparam>
[Mobius(
"""
Mobius.UI.Views.Windows.Abstractions.ReactiveAppWindow<TViewModel>
""")]
public class ReactiveAppWindow<TViewModel> : AppWindow, IViewFor<TViewModel>, IViewFor, IActivatableView where TViewModel : class
{
public static readonly StyledProperty<TViewModel?> ViewModelProperty = ReactiveWindow<TViewModel>.ViewModelProperty.AddOwner<ReactiveAppWindow<TViewModel>>();
@@ -4,6 +4,10 @@ using FluentAvalonia.Core;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public partial class AdControl : UserControl
{
/// <summary>
@@ -4,6 +4,10 @@ using System.Numerics;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class AppItem : TemplatedControl
{
public static readonly StyledProperty<string> TitleProperty =
@@ -4,6 +4,10 @@ using FluentAvalonia.Core;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class ContentLoader : ContentControl
{
/// <summary>
@@ -2,6 +2,10 @@ using Avalonia.Input;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public sealed class CustomFilePicker : ContentControl
{
public static readonly StyledProperty<string?> FileNameProperty = AvaloniaProperty.Register<CustomFilePicker, string?>(nameof(FileName), null);
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum AlignContent
{
FlexStart,
@@ -1,6 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[SuppressMessage("Naming", "CA1717:Only FlagsAttribute enums should have plural names")]
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum AlignItems
{
FlexStart,
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public static class Flex
{
/// <summary>
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public readonly struct FlexBasis : IEquatable<FlexBasis>
{
public double Value { get; }
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum FlexBasisKind
{
Auto,
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum FlexDirection
{
Row,
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public sealed class FlexPanel : Panel
{
private static readonly Func<Layoutable, int> s_getOrder = x => x is { } y ? Flex.GetOrder(y) : 0;
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum FlexWrap
{
NoWrap,
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public enum JustifyContent
{
FlexStart,
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
internal readonly struct Uv(double u, double v)
{
public double U { get; } = u;
@@ -2,6 +2,10 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class OptionsDisplayItem : TemplatedControl
{
public static readonly StyledProperty<object?> HeaderProperty =
@@ -126,7 +130,7 @@ public class OptionsDisplayItem : TemplatedControl
{
base.OnApplyTemplate(e);
_layoutRoot = e.NameScope.Find<FABorder>("LayoutRoot");
_layoutRoot = e.NameScope.Find<Border>("LayoutRoot");
if (_layoutRoot != null)
{
_layoutRoot.PointerPressed += OnLayoutRootPointerPressed;
@@ -172,5 +176,5 @@ public class OptionsDisplayItem : TemplatedControl
private bool _isPressed;
private bool _isExpanded;
private FABorder? _layoutRoot;
private Border? _layoutRoot;
}
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class PureCircle : Control
{
public static readonly StyledProperty<double> DiameterProperty = AvaloniaProperty.Register<PureCircle, double>(
@@ -3,6 +3,10 @@ namespace BD.WTTS.UI.Views.Controls;
/// <summary>
/// Provide the most simplified shape implementation. This is a rectangle with a background, without border and corner radius.
/// </summary>
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class PureRectangle : Control
{
public static readonly StyledProperty<IBrush?> BackgroundProperty =
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class PureRing : PureCircle
{
public static readonly StyledProperty<double> InnerDiameterProperty = AvaloniaProperty.Register<PureRing, double>(
@@ -6,6 +6,10 @@ namespace BD.WTTS.UI.Views.Controls;
/// <summary>
/// An <see cref="INotificationManager"/> that displays notifications in a <see cref="Window"/>.
/// </summary>
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
[TemplatePart("PART_Items", typeof(Panel))]
[PseudoClasses(":topleft", ":topright", ":bottomleft", ":bottomright")]
public class SnackbarManager : TemplatedControl, IManagedNotificationManager
@@ -2,6 +2,10 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public partial class SplashScreen : UserControl
{
public SplashScreen()
@@ -3,6 +3,10 @@ using BD.Common.Models.Abstractions;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public partial class TitleBar : UserControl
{
public Image WindowIcon => BarIcon;
@@ -62,14 +62,13 @@
Margin="0,0,0,5"
HorizontalAlignment="Center"
VerticalAlignment="Bottom">
<ItemsRepeater Name="Swiper" IsVisible="False">
<ItemsRepeater.Layout>
<StackLayout
DisableVirtualization="True"
Orientation="Horizontal"
Spacing="8" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<ItemsControl Name="Swiper" IsVisible="False">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Spacing="8" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<DataTemplate.DataType>
<x:Type x:TypeArguments="x:Int32, x:String" TypeName="generic:KeyValuePair" />
@@ -110,8 +109,8 @@
</i:Interaction.Behaviors>-->
</Button>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Panel>
</Panel>
</Border>
@@ -3,6 +3,10 @@ using FluentAvalonia.Core;
namespace BD.WTTS.UI.Views.Controls
{
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public partial class CarouselBanner : UserControl
{
/// <summary>
@@ -5,6 +5,10 @@ using System.Reactive;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class CarouselItems : ItemsControl
{
/// <summary>
@@ -55,7 +59,7 @@ public class CarouselItems : ItemsControl
Carousel? _carouselControl;
Button? _leftButton;
Button? _rightButton;
ItemsRepeater? _swiper;
ItemsControl? _swiper;
Timer? _timer;
public ICommand? CarouselBannerIndexCommand { get; }
@@ -72,7 +76,7 @@ public class CarouselItems : ItemsControl
_carouselControl = e.NameScope.Find<Carousel>("CarouselControl");
_leftButton = e.NameScope.Find<Button>("Left");
_rightButton = e.NameScope.Find<Button>("Right");
_swiper = e.NameScope.Find<ItemsRepeater>("Swiper");
_swiper = e.NameScope.Find<Avalonia.Controls.ItemsControl>("Swiper");
if (_leftButton != null)
{
@@ -5,6 +5,10 @@ namespace BD.WTTS.UI.Views.Controls;
/// <summary>
/// 固定的 WrapPanel
/// </summary>
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class FixedWrapPanel : Panel, INavigableContainer
{
/// <summary>
@@ -3,6 +3,10 @@ using Avalonia.Controls.Shapes;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class Ripple : Ellipse
{
private static Easing _easing = new CircularEaseOut();
@@ -2,6 +2,10 @@ using Avalonia.Controls.Shapes;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class RippleEffect : ContentControl
{
// ReSharper disable once InconsistentNaming
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class Skeleton : ContentControl
{
public static readonly StyledProperty<bool> IsActiveProperty =
@@ -3,6 +3,10 @@ using Avalonia.Controls.Notifications;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public class Snackbar : InfoBar
{
private bool _isClosing;
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
[TemplatePart("PART_ItemsPresenter", typeof(ItemsPresenter))]
[TemplatePart("PART_ProgressBar", typeof(ProgressBar))]
public class Stepper : SelectingItemsControl
@@ -4,6 +4,10 @@ using Avalonia.Controls.Mixins;
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
[PseudoClasses(":pressed", ":selected")]
public class StepperItem : ContentControl, ISelectable
{
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public sealed class TaskDialogEx : TaskDialog
{
private Button? _closeButton;
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Controls;
[Mobius(
"""
Mobius.UI.Views.Controls
""")]
public sealed partial class WaveProgress : UserControl
{
public static readonly DirectProperty<WaveProgress, double> ValueProperty =
@@ -139,20 +139,24 @@
VerticalAlignment="Center"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{Binding Path=Res.Link, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
<ItemsRepeater Margin="0,0,6,6" ItemsSource="{Binding Hyperlinks, Mode=OneTime}">
<ItemsRepeater.Layout>
<UniformGridLayout MinItemWidth="166" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<ItemsControl Margin="0,0,6,6" ItemsSource="{Binding Hyperlinks, Mode=OneTime}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="spp:HyperlinkModel">
<Button
Command="{Binding Command, Mode=OneWay}"
Content="{Binding Text, Mode=OneWay}"
Cursor="Hand"
Theme="{StaticResource HyperlinkButton}" />
<Border MinWidth="166">
<Button
Command="{Binding Command, Mode=OneWay}"
Content="{Binding Text, Mode=OneWay}"
Cursor="Hand"
Theme="{StaticResource HyperlinkButton}" />
</Border>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Border
Height="1"
Margin="-50,0"
@@ -162,20 +166,24 @@
VerticalAlignment="Center"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{Binding Path=Res.OpenSourceLibrary, Mode=OneWay, Source={x:Static s:ResourceService.Current}}" />
<ItemsRepeater Margin="0,0,6,6" ItemsSource="{Binding OSL, Mode=OneTime}">
<ItemsRepeater.Layout>
<UniformGridLayout MinItemWidth="290" />
</ItemsRepeater.Layout>
<ItemsRepeater.ItemTemplate>
<ItemsControl Margin="0,0,6,6" ItemsSource="{Binding OSL, Mode=OneTime}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="spp:HyperlinkModel">
<Button
Command="{Binding Command, Mode=OneWay}"
Content="{Binding Text, Mode=OneWay}"
Cursor="Hand"
Theme="{StaticResource HyperlinkButton}" />
<Border MinWidth="290">
<Button
Command="{Binding Command, Mode=OneWay}"
Content="{Binding Text, Mode=OneWay}"
Cursor="Hand"
Theme="{StaticResource HyperlinkButton}" />
</Border>
</DataTemplate>
</ItemsRepeater.ItemTemplate>
</ItemsRepeater>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</spp:OptionsDisplayItem.Content>
</spp:OptionsDisplayItem>
@@ -3,6 +3,10 @@ using BD.WTTS.Services;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class AboutPage : ReactiveUserControl<AboutPageViewModel>
{
public AboutPage()
@@ -1,5 +1,9 @@
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class MessageBoxPage : ReactiveUserControl<MessageBoxWindowViewModel>
{
public MessageBoxPage()
@@ -2,6 +2,10 @@ using Avalonia.Markup.Xaml.MarkupExtensions;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class TextInputDialogPage : ReactiveUserControl<TextBoxWindowViewModel>
{
public TextInputDialogPage()
@@ -12,6 +12,7 @@
d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="spp:DebugPageViewModel"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
mc:Ignorable="d">
<Design.DataContext>
<spp:DebugPageViewModel />
@@ -176,7 +177,7 @@
CornerRadius="2"
IsActive="{Binding #active.IsChecked}"
IsLoading="{Binding #loading.IsChecked}">
<SelectableTextBlock Margin="0,2" Text="是先有鸡还是先有蛋" />
<SelectableTextBlock Margin="0,2" Text="不忘初心,方得始终" />
</spp:Skeleton>
<spp:Skeleton
Margin="0,0,100,0"
@@ -184,14 +185,14 @@
CornerRadius="2"
IsActive="{Binding #active.IsChecked}"
IsLoading="{Binding #loading.IsChecked}">
<SelectableTextBlock Margin="0,2" Text="什么是工匠精神" />
<SelectableTextBlock Margin="0,2" Text="---" />
</spp:Skeleton>
<spp:Skeleton
VerticalAlignment="Bottom"
CornerRadius="2"
IsActive="{Binding #active.IsChecked}"
IsLoading="{Binding #loading.IsChecked}">
<SelectableTextBlock Margin="0,2" Text="看山不是山,看水不是水,看山还是山,看水还是水" />
<SelectableTextBlock Margin="0,2" Text="路漫漫其修远兮,吾将上下而求索。" />
</spp:Skeleton>
</UniformGrid>
</Grid>
@@ -2,6 +2,10 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class DebugPage : PageBase<DebugPageViewModel>
{
public DebugPage()
@@ -2,6 +2,10 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class ErrorPage : UserControl
{
public ErrorPage()
@@ -2,6 +2,10 @@ using BD.WTTS.Client.Resources;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class HomePage : ReactiveUserControl<HomePageViewModel>
{
public HomePage()
@@ -6,6 +6,10 @@ using FluentAvalonia.UI.Navigation;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public sealed partial class MainView : ReactiveUserControl<MainWindowViewModel>
{
public MainView()
@@ -3,6 +3,10 @@ using FluentAvalonia.UI.Navigation;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class PluginStorePage : UserControl
{
public PluginStorePage()
@@ -2,6 +2,10 @@ using Avalonia;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class SettingsPage : PageBase<SettingsPageViewModel>
{
public SettingsPage()
@@ -2,6 +2,10 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class Settings_General : UserControl
{
public Settings_General()
@@ -2,6 +2,10 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class Settings_Plugin : ReactiveUserControl<SettingsPageViewModel>
{
public Settings_Plugin()
@@ -2,6 +2,10 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class Settings_Steam : UserControl
{
public Settings_Steam()
@@ -2,6 +2,10 @@ using Avalonia.Controls;
namespace BD.WTTS.UI.Views.Pages;
[Mobius(
"""
Mobius.UI.Views.Pages
""")]
public partial class Settings_UI : UserControl
{
public List<Color> PredefinedColors { get; } = new List<Color>

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