fixes
This commit is contained in:
59
Pilz.UI.AvaloniaUI/Controls/ImageDropDownButton.axaml.cs
Normal file
59
Pilz.UI.AvaloniaUI/Controls/ImageDropDownButton.axaml.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Pilz.UI.AvaloniaUI.Controls;
|
||||
|
||||
public partial class ImageDropDownButton : DropDownButton
|
||||
{
|
||||
protected override Type StyleKeyOverride => typeof(SplitButton);
|
||||
|
||||
public ImageDropDownButton()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string? Text
|
||||
{
|
||||
get => ButtonText.Text;
|
||||
set => ButtonText.Text = value;
|
||||
}
|
||||
|
||||
public IImage? ImageSource
|
||||
{
|
||||
get => ButtonImage.Source;
|
||||
set
|
||||
{
|
||||
ButtonImage.Source = value;
|
||||
ButtonImage.IsVisible = value != null;
|
||||
}
|
||||
}
|
||||
|
||||
public double ImageWidth
|
||||
{
|
||||
get => ButtonImage.Width;
|
||||
set => ButtonImage.Width = value;
|
||||
}
|
||||
|
||||
public double ImageHeight
|
||||
{
|
||||
get => ButtonImage.Height;
|
||||
set => ButtonImage.Height = value;
|
||||
}
|
||||
|
||||
public double ImageWeight
|
||||
{
|
||||
get => ButtonImage.Width;
|
||||
set => ButtonImage.Width = ButtonImage.Height = value;
|
||||
}
|
||||
|
||||
public Size ImageSize
|
||||
{
|
||||
get => new(ButtonImage.Width, ButtonImage.Height);
|
||||
set
|
||||
{
|
||||
ButtonImage.Width = value.Width;
|
||||
ButtonImage.Height = value.Height;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user