private void MenuItemClick(object sender, RoutedEventArgs e) { int index = int.Parse(((Button)e.Source).Uid); MenuUnderline.Margin = new Thickness(10 + (150 * index), 0, 0, 0); menuItem_grid.Children.Clear(); switch (index) { case 0: SiteMgmtView siteMgmtView = new SiteMgmtView(this); menuItem_grid.Children.Add(siteMgmtView); break; case 1: ClientMgmtView clientMgmtView = new ClientMgmtView(this); menuItem_grid.Children.Add(clientMgmtView); break; case 2: OrderMgmtView orderMgmtView = new OrderMgmtView(this); menuItem_grid.Children.Add(orderMgmtView); break; case 3: SiteCautationView siteCautationView = new SiteCautationView(this); menuItem_grid.Children.Add(siteCautationView); break; } }
public PlaceOrderView(string action, MODEL.OrderModel orderModel, OrderMgmtView parent) { this.parent = parent; placeOrderViewModel = new VIEWMODEL.PlaceOrderViewModel(this, action, orderModel); this.DataContext = placeOrderViewModel; InitializeComponent(); this.Activate(); }