Beispiel #1
0
        public static void UpdateThumbColor(this ToggleSwitch toggleSwitch, ISwitch view)
        {
            if (toggleSwitch == null)
            {
                return;
            }

            if (view.ThumbColor == null)
            {
                return;
            }

            if (view.ThumbColor != null)
            {
                toggleSwitch.TryUpdateResource(
                    view.ThumbColor.ToPlatform(),
                    "ToggleSwitchKnobFillOnPointerOver",
                    "ToggleSwitchKnobFillOn",
                    "ToggleSwitchKnobFillOnPressed",
                    "ToggleSwitchKnobFillOnDisabled",
                    "ToggleSwitchKnobFillOffPointerOver",
                    "ToggleSwitchKnobFillOff",
                    "ToggleSwitchKnobFillOffPressed",
                    "ToggleSwitchKnobFillOffDisabled");
            }
        }
Beispiel #2
0
        public static void UpdateThumbColor(this ToggleSwitch toggleSwitch, ISwitch view, WResourceDictionary?originalResources = null)
        {
            if (toggleSwitch == null)
            {
                return;
            }

            if (view.ThumbColor == null)
            {
                return;
            }

            if (view.ThumbColor != null)
            {
                toggleSwitch.TryUpdateResource(
                    view.ThumbColor.ToPlatform() ?? originalResources?["ToggleSwitchKnobFillOff"] as WSolidColorBrush ?? new WSolidColorBrush(),
                    "ToggleSwitchKnobFillOnPointerOver",
                    "ToggleSwitchKnobFillOn",
                    "ToggleSwitchKnobFillOnPressed",
                    "ToggleSwitchKnobFillOnDisabled",
                    "ToggleSwitchKnobFillOffPointerOver",
                    "ToggleSwitchKnobFillOff",
                    "ToggleSwitchKnobFillOffPressed",
                    "ToggleSwitchKnobFillOffDisabled");
            }
        }