public TransWindow(MainWindow sklepWin, Article article, string message,DoShoping doShoping, bool isLearning) { this.InitializeComponent(); shopWin = sklepWin; actualArticle = article; shoping = doShoping; Info.Text = message; // BitmapImage btn = new BitmapImage(); // btn.BeginInit(); // btn.UriSource = new Uri(article.ImagePath, UriKind.Relative); // btn.EndInit(); try { InfoImage.Source = new BitmapImage(new Uri(article.ImagePath)); }catch(Exception ex) { string path = AppDomain.CurrentDomain.BaseDirectory + "images\\png\\noimage.png"; InfoImage.Source = new BitmapImage(new Uri(path)); } if(!article.IsForShooping && isLearning) { btnGet.Visibility = System.Windows.Visibility.Hidden; ///////////// btnCancel.IsDefault = true; } if ( shopWin.MyBasket.InBasket==null || (!shopWin.MyBasket.InBasket.ContainsKey(article))) { btnOut.Visibility=Visibility.Hidden; } // Insert code required on objsect creation below this point. }
public KoszWindow(MainWindow mainWindow) { InitializeComponent(); MainWindow WinGl = mainWindow; MyClient = mainWindow.GetClient; MyBasket = mainWindow.GetBasket; ArticlesItem.ItemsSource = MyBasket.GetArticlesFromBasket(); }
private void btnDoShop_Click(object sender, RoutedEventArgs e) { MainWindow myMainwindow = new MainWindow(this); this.Hide(); myMainwindow.ShowDialog(); }