コード例 #1
0
 private void colorRect_MouseDown(object sender, MouseButtonEventArgs e)
 {
     var dia = new ColorPickerFullDialog();
     dia.InitialColor =((SolidColorBrush ) colorRect.Fill).Color ; //set the initial color
     if (dia.ShowDialog() == true)
     {
         colorRect.Fill = new SolidColorBrush(dia.SelectedColor); //do something with the selected color
     }
 }
コード例 #2
0
ファイル: ColorChip.xaml.cs プロジェクト: jameshy/else
 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;
 }