private void UpdateTemplate() { var color = Helper.GetColorByOffset(_linearGradientBrush.GradientStops, SldTheme.Value / 7); RadioButtonHelper.SetCornerRadius(RdbCustom1, SldCornerRadius.Value); RadioButtonHelper.SetCornerRadius(RdbCustom2, SldCornerRadius.Value); switch (RadioButtonHelper.GetRadioButtonStyle(RdbCustom1)) { case RadioButtonStyle.Standard: RdbCustom1.Background = new Color() { A = 50, R = color.R, G = color.G, B = color.B }.ToBrush(); RdbCustom2.Background = new Color() { A = 50, R = color.R, G = color.G, B = color.B }.ToBrush(); RadioButtonHelper.SetCheckedGlyphBrush(RdbCustom1, Colors.White.ToBrush()); RadioButtonHelper.SetCheckedGlyphBrush(RdbCustom2, Colors.White.ToBrush()); RadioButtonHelper.SetCheckedBackground(RdbCustom1, color.ToBrush()); RadioButtonHelper.SetCheckedBackground(RdbCustom2, color.ToBrush()); RadioButtonHelper.SetBoxHeight(RdbCustom1, SldSize.Value); RadioButtonHelper.SetBoxHeight(RdbCustom2, SldSize.Value); RadioButtonHelper.SetBoxWidth(RdbCustom1, SldSize.Value); RadioButtonHelper.SetBoxWidth(RdbCustom2, SldSize.Value); break; case RadioButtonStyle.Switch: RdbCustom1.Background = Colors.White.ToBrush(); RdbCustom2.Background = Colors.White.ToBrush(); RadioButtonHelper.SetCheckedGlyphBrush(RdbCustom1, Colors.Transparent.ToBrush()); RadioButtonHelper.SetCheckedGlyphBrush(RdbCustom2, Colors.Transparent.ToBrush()); RadioButtonHelper.SetCheckedBackground(RdbCustom1, color.ToBrush()); RadioButtonHelper.SetCheckedBackground(RdbCustom2, color.ToBrush()); RadioButtonHelper.SetBoxHeight(RdbCustom1, SldSize.Value); RadioButtonHelper.SetBoxHeight(RdbCustom2, SldSize.Value); RadioButtonHelper.SetBoxWidth(RdbCustom1, SldSize.Value * 1.5); RadioButtonHelper.SetBoxWidth(RdbCustom2, SldSize.Value * 1.5); break; case RadioButtonStyle.Button: RdbCustom1.Background = Colors.White.ToBrush(); RdbCustom2.Background = Colors.White.ToBrush(); RadioButtonHelper.SetCheckedGlyphBrush(RdbCustom1, Colors.White.ToBrush()); RadioButtonHelper.SetCheckedGlyphBrush(RdbCustom2, Colors.White.ToBrush()); RadioButtonHelper.SetCheckedBackground(RdbCustom1, color.ToBrush()); RadioButtonHelper.SetCheckedBackground(RdbCustom2, color.ToBrush()); break; } }