예제 #1
0
 private void alphaColorRect_MouseDown(object sender, MouseButtonEventArgs e)
 {
     var dia = new ColorPickerFullWithAlphaDialog();
     dia.InitialColor = ((SolidColorBrush)alphaColorRect.Fill).Color; //set the initial color
     if (dia.ShowDialog() == true)
     {
         alphaColorRect.Fill = new SolidColorBrush(dia.SelectedColor); //do something with the selected color
     }
 }
예제 #2
0
 private IColorDialog CreateDialog()
 {
     IColorDialog dialog = null;
     switch (ColorDialog)
     {
         case EColorDialog.Full:
            dialog = new ColorPickerFullDialog();
             break;
         case EColorDialog.FullWithAlpha:
             dialog = new ColorPickerFullWithAlphaDialog();
             break;
         case EColorDialog.Standard:
             dialog = new ColorPickerStandardDialog();
             break;
         case EColorDialog.StandardWithAlpha :
             dialog = new ColorPickerStandardWithAlphaDialog();
             break;
     }
     return dialog;
 }