/// <summary> /// Loading the UserControl of the add review to the main screen and logging its events /// </summary> public void LoadAddProduct() { MessageArea.IsOpen = false; AddProductUserControl addProduct = new AddProductUserControl(); addProduct.GoBack += (sender, e) => { GoBackEventArgs args = e as GoBackEventArgs; if (!args.IsWorkDone) { MessageAreaText.Text = args.Message; MessageArea.IsOpen = true; } else { LoadSearch(); } }; CurrnetUserConrol = addProduct; }
private void MenuAddProduct_Click(object sender, RoutedEventArgs e) { //If found tab was AddProduct, selected for Tabcontrol var index = TabControlManagement.GetIndexByTitle(MainTabControl, UsecaseStringContants.addProduct); if (index >= 0) { MainTabControl.SelectedIndex = index; } //If not found tab was ListSuplier, add and selected else { AddProductUserControl addProductUserControl = new AddProductUserControl(); CustomTabItem customTabItem = new CustomTabItem() { Title = UsecaseStringContants.addProduct, Content = addProductUserControl }; MainTabControl.Items.Add(customTabItem); MainTabControl.SelectedItem = customTabItem; } CurrenTabTitle.Content = UsecaseStringContants.addProduct; this.Title = UsecaseStringContants.addProduct; }