Example #1
0
        void Color_Click(object sender, RoutedEventArgs e)
        {
            PushButton push = sender as PushButton;

            switch (push.Tag)
            {
            case "Add":
                Color item = colorPicker.SelectedColor;
                VM.UsedColors.Add(new PadColor(item.ToString()));
                break;

            case "Remove":
                if (lstColor.SelectedItem != null)
                {
                    PadColor removeitem = (PadColor)lstColor?.SelectedItem;
                    VM.UsedColors.Remove(removeitem);
                }
                break;

            case "Clear":
                TabDialog.Show("Clear Color", "Do you want to clear your Colors?", "Clear", "Cancel", () =>
                {
                    //Clear your notes
                    VM.UsedColors.Clear();
                });
                break;
            }
        }
Example #2
0
        void AddRemoveCancel_Click(object sender, RoutedEventArgs e)
        {
            PushButton push = sender as PushButton;

            switch (push.Tag)
            {
            case "Remove":
                //Remove Color
                PadColor color = (PadColor)lstArtBoard?.SelectedItem;
                VM.UsedColors.Remove(color);
                break;

            case "Clear":
                //Clear the list
                TabDialog.Show("Clearing", "Do you want clear all your sizes?", "Clear", "Cancel", () =>
                {
                    VM.DrawSizes.Clear();
                });
                break;
            }
        }
Example #3
0
 void lstUsedColors_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (lstUsedColors.SelectedItem != null)
     {
         PadColor        item  = (PadColor)lstUsedColors.SelectedItem;
         SolidColorBrush brush = new SolidColorBrush(item.Color);
         if (optBrushColor.IsChecked == true)
         {
             drawCanvas.BrushColor           = item.Color;
             optBrushColor.Background        = brush;
             optBrushColor.BackgroundChecked = brush;
             optBrushColor.BorderBrush       = brush;
             VM.Message("Brush Color Changed", false);
         }
         else if (optBackColor.IsChecked == true)
         {
             drawCanvas.Background          = brush;;
             optBackColor.Background        = brush;
             optBackColor.BackgroundChecked = brush;
             optBackColor.BorderBrush       = brush;
             VM.Message("Background Color Changed", false);
         }
     }
 }
Example #4
0
 public void SetColor(PadColor color)
 {
     currentColor = color;
 }