public ColorPicker(Corel.Interop.VGCore.Palette palette)
 {
     InitializeComponent();
     colorManager     = new ColorManager(palette);
     this.DataContext = colorManager;
     btn_ok.Click    += (s, e) => { this.DialogResult = true; };
 }
 public ColorManager(Corel.Interop.VGCore.Palette palette)
 {
     if (palette == null)
     {
         return;
     }
     PaletteName = palette.Name;
     colorArray  = new ColorSystem[palette.ColorCount];
     for (int i = 1; i < palette.ColorCount; i++)
     {
         Corel.Interop.VGCore.Color color = palette.Color[i];
         colorArray[i - 1] = new ColorSystem(color.HexValue, color.Name, color);
     }
 }