public ToppingCombinationsUserControl()
        {
            ViewModel = new ToppingCombinationsViewModel();

            InitializeComponent();
            DataContext = ViewModel;
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            var pizzaDataAccessLayer = new PizzaDataAccess();

            pizzaDataAccessLayer.OnPizzaOrdersReceived += HandlePizzaOrdersReceived;

            ViewModel = new MainWindowViewModel(pizzaDataAccessLayer);

            InitializeComponent();
            DataContext = ViewModel;


            var toppingCombinationsUserControl = new ToppingCombinationsUserControl();

            combosViewModel = toppingCombinationsUserControl.ViewModel;
            ToppingCombinationsTab.Content = toppingCombinationsUserControl;


            var toppingsUserControl = new ToppingsUserControl();

            toppingsViewModel   = toppingsUserControl.ViewModel;
            ToppingsTab.Content = toppingsUserControl;
        }