diff --git a/KitopiaAvalonia/App.axaml.cs b/KitopiaAvalonia/App.axaml.cs index 456aa76..47237dc 100644 --- a/KitopiaAvalonia/App.axaml.cs +++ b/KitopiaAvalonia/App.axaml.cs @@ -13,6 +13,7 @@ using Core.ViewModel.Pages.customScenario; using Core.ViewModel.Pages.plugin; using Core.ViewModel.TaskEditor; +using HotAvalonia; using Kitopia.Services; using KitopiaAvalonia.Pages; using KitopiaAvalonia.Services; @@ -33,7 +34,7 @@ public partial class App : Application public override void Initialize() { - //this.EnableHotReload(); + this.EnableHotReload(); AvaloniaXamlLoader.Load(this); } diff --git a/KitopiaAvalonia/Converter/ControlContentSize.cs b/KitopiaAvalonia/Converter/ControlContentSize.cs new file mode 100644 index 0000000..8c5390a --- /dev/null +++ b/KitopiaAvalonia/Converter/ControlContentSize.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using Avalonia; +using Avalonia.Data.Converters; + +namespace KitopiaAvalonia.Converter; + +public class ControlContentSize : IMultiValueConverter +{ + public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + public object? Convert(IList values, Type targetType, object? parameter, CultureInfo culture) + { + var control = values[0] as double? ?? 0; + var parent = values[1] as Thickness? ?? new Thickness(0); + return control - parent.Left - parent.Right; + } +} \ No newline at end of file diff --git a/KitopiaAvalonia/KitopiaAvalonia.csproj b/KitopiaAvalonia/KitopiaAvalonia.csproj index 6679349..9bc45e2 100644 --- a/KitopiaAvalonia/KitopiaAvalonia.csproj +++ b/KitopiaAvalonia/KitopiaAvalonia.csproj @@ -53,8 +53,8 @@ - - + + diff --git a/KitopiaAvalonia/Pages/CustomScenariosManagerPage.axaml b/KitopiaAvalonia/Pages/CustomScenariosManagerPage.axaml index 8acb30d..7c510b0 100644 --- a/KitopiaAvalonia/Pages/CustomScenariosManagerPage.axaml +++ b/KitopiaAvalonia/Pages/CustomScenariosManagerPage.axaml @@ -12,21 +12,20 @@ - + - +