Пример #1
0
        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.
        }
Пример #2
0
 public KoszWindow(MainWindow mainWindow)
 {
     InitializeComponent();
     MainWindow WinGl = mainWindow;
     MyClient = mainWindow.GetClient;
     MyBasket = mainWindow.GetBasket;
     ArticlesItem.ItemsSource = MyBasket.GetArticlesFromBasket();
 }
Пример #3
0
 private void btnDoShop_Click(object sender, RoutedEventArgs e)
 {
     MainWindow myMainwindow = new MainWindow(this);
     this.Hide();
     myMainwindow.ShowDialog();
 }