/// <summary> /// Set the text on the button /// </summary> /// <param name="text">the text value of the button</param> public void SetText(string text) { //Create the label which will show when _pushbutton focused. textVisualNormal = new PropertyMap(); textVisualNormal.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)); textVisualNormal.Add(TextVisualProperty.Text, new PropertyValue(text)); textVisualNormal.Add(TextVisualProperty.TextColor, new PropertyValue(Color.White)); //textVisualNormal.Add(TextVisualProperty.PointSize, new PropertyValue(8.0f)); textVisualNormal.Add(TextVisualProperty.PointSize, new PropertyValue(DeviceCheck.PointSize8)); textVisualNormal.Add(TextVisualProperty.FontFamily, new PropertyValue("SamsungOneUI_400")); textVisualNormal.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue("CENTER")); textVisualNormal.Add(TextVisualProperty.VerticalAlignment, new PropertyValue("CENTER")); //Create the label which will show when _pushbutton unfocused. textVisualFocused = new PropertyMap(); textVisualFocused.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)); textVisualFocused.Add(TextVisualProperty.Text, new PropertyValue(text)); textVisualFocused.Add(TextVisualProperty.FontFamily, new PropertyValue("SamsungOneUI_400")); textVisualFocused.Add(TextVisualProperty.TextColor, new PropertyValue(Color.Black)); //textVisualFocused.Add(TextVisualProperty.PointSize, new PropertyValue(8.0f)); textVisualFocused.Add(TextVisualProperty.PointSize, new PropertyValue(DeviceCheck.PointSize8)); textVisualFocused.Add(TextVisualProperty.HorizontalAlignment, new PropertyValue("CENTER")); textVisualFocused.Add(TextVisualProperty.VerticalAlignment, new PropertyValue("CENTER")); if (_pushbutton.HasFocus()) { _pushbutton.Label = textVisualFocused; } else { _pushbutton.Label = textVisualNormal; } }