예제 #1
0
        private void UpdateCode()
        {
            var radioButtonStyle = RadioButtonHelper.GetRadioButtonStyle(RdbCustom1);
            var cornerRadius     = SldCornerRadius.Value;
            var checkedContent   = RadioButtonHelper.GetCheckedContent(RdbCustom1);

            TbCode.Text = "<RadioButton  Height=\"30\"" +
                          $"\nContent=\"{RdbCustom1.Content}\"" +
                          (radioButtonStyle == RadioButtonStyle.Standard ? "" : $"\npu:RadioButtonHelper.RadioButtonStyle=\"{radioButtonStyle}\"") +
                          (radioButtonStyle == RadioButtonStyle.Standard ? $"\nBackground=\"{RdbCustom1.Background.ToColor().ToHexString(true)}\"" : "") +
                          (radioButtonStyle == RadioButtonStyle.Button ? "" : $"\npu:RadioButtonHelper.BoxHeight=\"{RadioButtonHelper.GetBoxHeight(RdbCustom1)}\"") +
                          (radioButtonStyle == RadioButtonStyle.Button ? "" : $"\npu:RadioButtonHelper.BoxWidth=\"{RadioButtonHelper.GetBoxWidth(RdbCustom1)}\"") +
                          $"\npu:RadioButtonHelper.CheckedBackground=\"{RadioButtonHelper.GetCheckedBackground(RdbCustom1).ToColor().ToHexString(false)}\"" +
                          (cornerRadius == 2 ? "" : $"\npu:RadioButtonHelper.CornerRadius=\"{cornerRadius}\"") +
                          (checkedContent == null ? "" : $"\npu:RadioButtonHelper.CheckedContent=\"{checkedContent}\"") +
                          " />";
        }