protected virtual void OnGoBack(GoBackEventArgs e) { if (GoBack != null) { GoBack(this, e); } }
/// <summary> /// Loading the ProductsManagementUserControl /// </summary> public void LoadProductsManagement(List <Product> products = null) { MessageArea.IsOpen = false; ProductsManagementUserControl productsManagement; if (products == null) { productsManagement = new ProductsManagementUserControl(); } else { productsManagement = new ProductsManagementUserControl(products); } productsManagement.GoBack += (sender, e) => { GoBackEventArgs args = e as GoBackEventArgs; if (!args.IsWorkDone) { MessageAreaText.Text = args.Message; MessageArea.IsOpen = true; } else { LoadSearch(); } }; CurrnetUserConrol = productsManagement; }
private GoBackEventArgs OnGoBack() { GoBackEventArgs args = new GoBackEventArgs(); OnGoBack(args); return(args); }
public void OnGoBackClicked() { GoBackEventArgs args; string message = "האם אתה בטוח שאתה רוצה לחזור?\nאם לא השינויים האחרונים לא נשמרו הם יאבדו"; args = new GoBackEventArgs() { IsWorkDone = false, Message = message }; GoBack?.Invoke(this, args); }
/// <summary> /// A function that triggers the event of a backward move /// </summary> public void OnGoBackClicked() { GoBackEventArgs args; string message = null; if (!IsWorkDone) { message = "האם אתה בטוח שאתה רוצה לחזור?\nהנתונים שמילאת על החנות ילכו לאיבוד אם תחזור עכשיו"; } args = new GoBackEventArgs() { IsWorkDone = this.IsWorkDone, Message = message }; GoBack.Invoke(this, args); }
/// <summary> /// A function that triggers the event of a backward move /// </summary> public void OnGoBackClicked() { GoBackEventArgs args; string message = null; if (!IsWorkDone) { message = "האם אתה בטוח שאתה רוצה לחזור?\nלא שמרת את הביקורת שלך, כל מה שכתבת ילך לאיבוד"; } args = new GoBackEventArgs() { IsWorkDone = this.IsWorkDone, Message = message }; GoBack?.Invoke(this, args); }
/// <summary> /// A function that triggers the event of a backward move /// </summary> public void OnGoBackClicked() { GoBackEventArgs args; string message = null; if (!IsWorkDone) { message = "לא שמרת את המוצר עדיין\nהאם את רוצה לחזור בכל זאת?"; } args = new GoBackEventArgs() { IsWorkDone = this.IsWorkDone, Message = message }; GoBack?.Invoke(this, args); }
/// <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; }
/// <summary> /// Loading the UserControl of the add review to the main screen and logging its events /// </summary> internal void LoadAddReview(Product product) { MessageArea.IsOpen = false; AddReviewUserControl addReview = new AddReviewUserControl(product); addReview.GoBack += (sender, e) => { GoBackEventArgs args = e as GoBackEventArgs; if (!args.IsWorkDone) { MessageAreaText.Text = args.Message; MessageArea.IsOpen = true; } else { LoadSearchResult(null); } }; CurrnetUserConrol = addReview; }
/// <summary> /// Loading the UserControl of the add shop to the main screen and logging its events /// </summary> internal void LoadAddShop() { MessageArea.IsOpen = false; AddShopUserControl search = new AddShopUserControl(); search.GoBack += (sender, e) => { GoBackEventArgs args = e as GoBackEventArgs; if (!args.IsWorkDone) { MessageAreaText.Text = args.Message; MessageArea.IsOpen = true; } else { LoadSearch(); } }; CurrnetUserConrol = search; this.Background = new ImageBrush(new BitmapImage(new Uri(BaseUriHelper.GetBaseUri(this), "Images/background.jpg"))); }
/// <summary> /// Loading the ShopsManagementUserControl /// </summary> public void LoadShopsManagement() { MessageArea.IsOpen = false; ShopsManagementUserControl shopsManagement = new ShopsManagementUserControl(); shopsManagement.GoBack += (sender, e) => { GoBackEventArgs args = e as GoBackEventArgs; if (!args.IsWorkDone) { MessageAreaText.Text = args.Message; MessageArea.IsOpen = true; } else { LoadSearch(); } }; shopsManagement.LoadProducts += (sender, args) => { LoadProductsManagement((args as ListTransferEventArgs).Products); }; CurrnetUserConrol = shopsManagement; }