コード例 #1
0
        private async void ColorPointRadioButton_DoubleTapped(object sender, RoutedEventArgs e)
        {
            ContentDialog dialog = GetCurrentContentDialog();

            if (dialog != null)
            {
                dialog.Hide();
            }

            ColorPickerDialog colorPickerDialog = new ColorPickerDialog(m_ColorPointModel.Color);
            await colorPickerDialog.ShowAsync();

            if (colorPickerDialog.ColorPickerResult)
            {
                m_ColorPointModel.Color = colorPickerDialog.CurrentColor;
                ColorPatternViewModel.Self.OnCustomizeChanged();
            }

            if (dialog != null)
            {
                await dialog.ShowAsync();
            }
            else
            {
                MainPage.Self.ShowDeviceUpdateDialogOrNot();
            }
        }
コード例 #2
0
        public async Task <bool> CreateNewColor()
        {
            var dialog = new ColorPickerDialog(Model.Color);

            if (await dialog.ShowAsync() != ContentDialogResult.Secondary)
            {
                return(false);
            }

            Model.SetColor(dialog.Color.R, dialog.Color.G, dialog.Color.B, dialog.Color.A);
            return(true);
        }
コード例 #3
0
        public async Task <Color> OpenColorPickerWindow(Color c)
        {
            ColorPickerDialog colorPickerDialog = new ColorPickerDialog(c);
            await colorPickerDialog.ShowAsync();

            if (colorPickerDialog.ColorPickerResult)
            {
                return(colorPickerDialog.CurrentColor);
            }
            else
            {
                return(colorPickerDialog.PreColor);
            }
        }
コード例 #4
0
ファイル: EffectInfoPage.xaml.cs プロジェクト: jcsbmwxyha/UWP
        public async Task <Color> OpenColorPickerWindow(Color c, string ColorBgName)
        {
            ColorPickerDialog colorPickerDialog = new ColorPickerDialog(c);
            await colorPickerDialog.ShowAsync();

            if (colorPickerDialog.ColorPickerResult)
            {
                ReUndoManager.Store(new ColorChangeCommand(LayerPage.Self.CheckedEffect, ColorBgName, colorPickerDialog.PreColor, colorPickerDialog.CurrentColor));
                return(colorPickerDialog.CurrentColor);
            }
            else
            {
                return(colorPickerDialog.PreColor);
            }
        }