1
0

feat: introduce new button style

This commit is contained in:
2026-04-11 21:23:13 +08:00
parent 847aa6b238
commit 1f07be07ba
4 changed files with 89 additions and 4 deletions

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace BallanceTasEditor.Frontend.Widgets {
public class IconButton : Button {
static IconButton() {
DefaultStyleKeyProperty.OverrideMetadata(typeof(IconButton), new FrameworkPropertyMetadata(typeof(IconButton)));
}
public string ButtonText {
get { return (string)GetValue(ButtonTextProperty); }
set { SetValue(ButtonTextProperty, value); }
}
// Using a DependencyProperty as the backing store for ButtonText. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ButtonTextProperty =
DependencyProperty.Register("ButtonText", typeof(string), typeof(IconButton));
public ImageSource ButtonIcon {
get { return (ImageSource)GetValue(ButtonIconProperty); }
set { SetValue(ButtonIconProperty, value); }
}
// Using a DependencyProperty as the backing store for ButtonIcon. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ButtonIconProperty =
DependencyProperty.Register("ButtonIcon", typeof(ImageSource), typeof(IconButton));
}
}