* UISymbolButton: 设置完图片即可更新

This commit is contained in:
Sunny 2022-01-25 19:22:58 +08:00
parent 56221eef7d
commit 9989447771
4 changed files with 16 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@ -344,8 +344,11 @@ namespace Sunny.UI
get => image; get => image;
set set
{ {
image = value; if (image != value)
Invalidate(); {
image = value;
Invalidate();
}
} }
} }

View File

@ -150,11 +150,21 @@ namespace Sunny.UI
base.SetStyleColor(uiColor); base.SetStyleColor(uiColor);
} }
private Image image;
[DefaultValue(null)] [DefaultValue(null)]
[Description("图片"), Category("SunnyUI")] [Description("图片"), Category("SunnyUI")]
public Image Image public Image Image
{ {
get; set; get => image;
set
{
if (image != value)
{
image = value;
Invalidate();
}
}
} }
private ContentAlignment imageAlign = ContentAlignment.MiddleCenter; private ContentAlignment imageAlign = ContentAlignment.MiddleCenter;