From d6fb0646531172f23648441c224cdcccd721b894 Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期一, 14 十二月 2020 09:59:01 +0800 Subject: [PATCH] 请合并代码,完成晾衣架最终功能。 --- ZigbeeApp/Shared/Phone/SmartSound/Widget/MyButton.cs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 49 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/SmartSound/Widget/MyButton.cs b/ZigbeeApp/Shared/Phone/SmartSound/Widget/MyButton.cs new file mode 100755 index 0000000..e9528ff --- /dev/null +++ b/ZigbeeApp/Shared/Phone/SmartSound/Widget/MyButton.cs @@ -0,0 +1,49 @@ +锘縰sing System; +namespace Shared.Phone.UserCenter.SmartSound +{ + public class MyButton:Button + { + //榛樿瀛椾綋澶у皬 + private float textSize = 15; + + public MyButton() + { + base.TextSize = textSize; + } + + public new float TextSize + { + get => base.TextSize; + set + { + textSize = value; + base.TextSize = textSize; + } + } + + public new string Text { + get { + return base.Text; + } + set { + base.Text = value; + recalculateWidth(); + } + } + + public override uint BackgroundColor + { + get { return base.BackgroundColor; } + set + { + base.BackgroundColor = value; + recalculateWidth(); + } + } + + private void recalculateWidth() { + + this.Width = this.GetTextWidth()+Application.GetRealWidth(50); + } + } +} -- Gitblit v1.8.0