public MainWindow()
        {
            InitializeComponent();
            ViewModelMaxLayout vmLayout = maxlayout.DataContext as ViewModelMaxLayout;

            DataContext = new ViewModelMain(vmLayout);
        }
        public DesignEditor(ArduinoDriver arduino)
        {
            InitializeComponent();
            ViewModelMaxLayout vmLayout = maxlayout.DataContext as ViewModelMaxLayout;

            vmLayout.DesignMode = true;
            ViewModelDesignEditor vm = new ViewModelDesignEditor(vmLayout, arduino);

            DataContext = vm;
            vm.view     = this;
        }
        public MaxLayout()
        {
            InitializeComponent();

            var tmp = new List <ViewModelMax7219>
            {
                this.max1.DataContext as ViewModelMax7219,
                this.max2.DataContext as ViewModelMax7219,
                this.max3.DataContext as ViewModelMax7219,
                this.max4.DataContext as ViewModelMax7219,
                this.max5.DataContext as ViewModelMax7219,
                this.max6.DataContext as ViewModelMax7219,
                this.max7.DataContext as ViewModelMax7219,
                this.max8.DataContext as ViewModelMax7219,
                this.max9.DataContext as ViewModelMax7219,
                this.max10.DataContext as ViewModelMax7219
            };

            DataContext = new ViewModelMaxLayout(tmp);
        }