Beispiel #1
0
        private void UpdateCode()
        {
            var style          = SliderHelper.GetSliderStyle(SldCustom);
            var thumbSize      = SliderHelper.GetThumbSize(SldCustom);
            var trackThickness = SliderHelper.GetTrackThickness(SldCustom);
            var valueVisible   = SliderHelper.GetIsTickValueVisible(SldCustom);
            var tickBarVisible = SldCustom.TickPlacement == System.Windows.Controls.Primitives.TickPlacement.Both;

            TbCode.Text = $"<Slider  Width=\"{SldCustom.Width}\"" +
                          (style == SliderStyle.Standard ? "" : $"\npu:SliderHelper.SliderStyle=\"{style}\"") +
                          (thumbSize == 18 ? "" : $"\npu:SliderHelper.ThumbSize=\"{thumbSize}\"") +
                          (trackThickness == 3 ? "" : $"\npu:SliderHelper.TrackThickness=\"{trackThickness}\"") +
                          $"\npu:SliderHelper.ThemeBrush=\"{SliderHelper.GetThemeBrush(SldCustom).ToColor().ToHexString(false)}\"" +
                          $"\nBackground=\"{SldCustom.Background.ToColor().ToHexString()}\"" +
                          (valueVisible ?  "" : "\npu:SliderHelper.IsTickValueVisible=\"True\"") +
                          (tickBarVisible ? "\nTickPlacement=\"Both\"" : "") +

                          " />";
        }