diff --git a/BallanceTasEditor/App.xaml b/BallanceTasEditor/App.xaml index 68810c0..8bc34c9 100644 --- a/BallanceTasEditor/App.xaml +++ b/BallanceTasEditor/App.xaml @@ -6,26 +6,11 @@ - - - - - - - - - - - - - - - diff --git a/BallanceTasEditor/BallanceTasEditor.csproj b/BallanceTasEditor/BallanceTasEditor.csproj index 172ed9f..b003af1 100644 --- a/BallanceTasEditor/BallanceTasEditor.csproj +++ b/BallanceTasEditor/BallanceTasEditor.csproj @@ -40,37 +40,10 @@ App.ico - - ..\packages\CommunityToolkit.Mvvm.8.2.1\lib\netstandard2.0\CommunityToolkit.Mvvm.dll - - - ..\packages\DotNetZip.1.9.1.8\lib\net20\Ionic.Zip.dll - - - ..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll - - - ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - - - ..\packages\System.ComponentModel.Annotations.5.0.0\lib\net461\System.ComponentModel.Annotations.dll - - - ..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll - - - ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll - - - ..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll - - - ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll - @@ -89,7 +62,6 @@ MSBuild:Compile Designer - AboutDialog.xaml @@ -114,10 +86,6 @@ Designer MSBuild:Compile - - Designer - MSBuild:Compile - Designer MSBuild:Compile @@ -177,7 +145,6 @@ ResXFileCodeGenerator Resources.Designer.cs - SettingsSingleFileGenerator Settings.Designer.cs @@ -236,12 +203,13 @@ + + + 8.2.1 + + + 1.9.1.8 + + - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - \ No newline at end of file diff --git a/BallanceTasEditor/Styles/AccessoryIcon.cs b/BallanceTasEditor/Styles/AccessoryIcon.cs index 06adb63..4bc0877 100644 --- a/BallanceTasEditor/Styles/AccessoryIcon.cs +++ b/BallanceTasEditor/Styles/AccessoryIcon.cs @@ -10,40 +10,42 @@ using System.Windows.Media; namespace BallanceTasEditor.Styles { public class AccessoryIcon { - public static Object GetAccessoryIcon(DependencyObject obj) { - return (Object)obj.GetValue(AccessoryIconProperty); + public static ImageSource GetIcon(DependencyObject obj) { + return (ImageSource)obj.GetValue(IconProperty); } - public static void SetAccessoryIcon(DependencyObject obj, Object value) { - obj.SetValue(AccessoryIconProperty, value); + public static void SetIcon(DependencyObject obj, ImageSource value) { + obj.SetValue(IconProperty, value); } - public static readonly DependencyProperty AccessoryIconProperty = - DependencyProperty.RegisterAttached("AccessoryIcon", typeof(Object), typeof(AccessoryIcon), new PropertyMetadata(null)); - } + // Using a DependencyProperty as the backing store for Icon. This enables animation, styling, binding, etc... + public static readonly DependencyProperty IconProperty = + DependencyProperty.RegisterAttached("Icon", typeof(ImageSource), typeof(AccessoryIcon), new PropertyMetadata(null)); - public class AccessoryIconContentTemplateSelector : DataTemplateSelector { - private static ImageSourceConverter Converter = new ImageSourceConverter(); - - /// - /// 给定的图标是已经加载的数据。 - /// - public DataTemplate LoadedIconTemplate { get; set; } - /// - /// 给定的图标是来源字符串。 - /// - public DataTemplate SourceIconTemplate { get; set; } - - public override DataTemplate SelectTemplate(object item, DependencyObject container) { - var ctl = VisualTreeHelper.GetParent(container); - var accessoryIcon = ctl.GetValue(AccessoryIcon.AccessoryIconProperty); - - if (accessoryIcon is null || !Converter.CanConvertFrom(accessoryIcon.GetType())) { - return LoadedIconTemplate; - } else { - return SourceIconTemplate; - } + public static double GetIconWidth(DependencyObject obj) { + return (double)obj.GetValue(IconWidthProperty); } + + public static void SetIconWidth(DependencyObject obj, double value) { + obj.SetValue(IconWidthProperty, value); + } + + // Using a DependencyProperty as the backing store for IconWidth. This enables animation, styling, binding, etc... + public static readonly DependencyProperty IconWidthProperty = + DependencyProperty.RegisterAttached("IconWidth", typeof(double), typeof(AccessoryIcon), new PropertyMetadata(0.0)); + + public static double GetIconHeight(DependencyObject obj) { + return (double)obj.GetValue(IconHeightProperty); + } + + public static void SetIconHeight(DependencyObject obj, double value) { + obj.SetValue(IconHeightProperty, value); + } + + // Using a DependencyProperty as the backing store for IconHeight. This enables animation, styling, binding, etc... + public static readonly DependencyProperty IconHeightProperty = + DependencyProperty.RegisterAttached("IconHeight", typeof(double), typeof(AccessoryIcon), new PropertyMetadata(0.0)); + } } diff --git a/BallanceTasEditor/Styles/AccessoryIconControl.xaml b/BallanceTasEditor/Styles/AccessoryIconControl.xaml index af0d7b2..49c11e7 100644 --- a/BallanceTasEditor/Styles/AccessoryIconControl.xaml +++ b/BallanceTasEditor/Styles/AccessoryIconControl.xaml @@ -1,41 +1,19 @@  - - - - - + + \ No newline at end of file diff --git a/BallanceTasEditor/Styles/GenericButton.xaml b/BallanceTasEditor/Styles/GenericButton.xaml index 6c2e409..ccb1640 100644 --- a/BallanceTasEditor/Styles/GenericButton.xaml +++ b/BallanceTasEditor/Styles/GenericButton.xaml @@ -8,7 +8,8 @@ - + @@ -23,7 +24,8 @@ - + diff --git a/BallanceTasEditor/Views/AboutDialog.xaml b/BallanceTasEditor/Views/AboutDialog.xaml index 9500264..c42fdef 100644 --- a/BallanceTasEditor/Views/AboutDialog.xaml +++ b/BallanceTasEditor/Views/AboutDialog.xaml @@ -15,8 +15,8 @@ - + diff --git a/BallanceTasEditor/Views/MainWindow.xaml b/BallanceTasEditor/Views/MainWindow.xaml index 5cce750..943ec8a 100644 --- a/BallanceTasEditor/Views/MainWindow.xaml +++ b/BallanceTasEditor/Views/MainWindow.xaml @@ -6,61 +6,8 @@ xmlns:local="clr-namespace:BallanceTasEditor.Views" xmlns:styles="clr-namespace:BallanceTasEditor.Styles" mc:Ignorable="d" WindowStartupLocation="CenterScreen" - RenderOptions.BitmapScalingMode="HighQuality" Title="Ballance TAS Editor" Height="600" Width="800" Icon="/Assets/App.ico"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -70,38 +17,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - + + + - - + + - - + + - - - - - + + + + + - - - + + + - + - + - - + + @@ -112,68 +84,60 @@ - - - - + + - + +