Beispiel #1
0
 public MainWindowViewModel(Grid grid)
 {
     FigureGrid = grid;
     Figures    = SingletonFigures.GetSingletonFigures().Figures;
     shapes     = new Shape[11, 11];
     MyColors   = new ObservableCollection <MyColor>
     {
         new MyColor {
             Name = "Yellow", Color = Brushes.Yellow
         },
         new MyColor {
             Name = "Black", Color = Brushes.Black
         },
         new MyColor {
             Name = "Blue", Color = Brushes.Blue
         },
         new MyColor {
             Name = "Red", Color = Brushes.Red
         },
         new MyColor {
             Name = "White", Color = Brushes.White
         },
         new MyColor {
             Name = "HotPink", Color = Brushes.HotPink
         }
     };
 }
Beispiel #2
0
 public static SingletonFigures GetSingletonFigures()
 {
     if (figures == null)
     {
         figures = new SingletonFigures();
     }
     return(figures);
 }