Exemplo n.º 1
0
        public ColorPage()
        {
            InitializeComponent();

            redSlider.Minimum = greenSlider.Minimum = blueSlider.Minimum = minColorValue;
            redSlider.Maximum = greenSlider.Maximum = blueSlider.Maximum = maxColorValue;

            redSlider.ValueChanged += (object sender, ValueChangedEventArgs e) => {
                var currentColor = ColorBox.Color;
                ColorBox.Color = new Color(e.NewValue / maxColorValue, currentColor.G, currentColor.B);
                ChangeColor();
            };

            blueSlider.ValueChanged += (object sender, ValueChangedEventArgs e) => {
                var currentColor = ColorBox.Color;
                ColorBox.Color = new Color(currentColor.R, currentColor.G, e.NewValue / maxColorValue);
                ChangeColor();
            };

            greenSlider.ValueChanged += (object sender, ValueChangedEventArgs e) => {
                var currentColor = ColorBox.Color;
                ColorBox.Color = new Color(currentColor.R, e.NewValue / maxColorValue, currentColor.B);
                ChangeColor();
            };

            greenSlider.Value = 123;
            redSlider.Value   = 123;
            blueSlider.Value  = 123;

            SaveButton.Clicked += async(sender, e) => {
                SaveColor();
                await SaveButton.AnimateButton();
            };
        }