Example #1
0
        public TWindow()
        {
            InitializeComponent();
            this.DataContext = this;

            Button1.IsEnabled = false;

            novi = new TModel();
        }
Example #2
0
        private void SaveB_Click(object sender, RoutedEventArgs e)
        {
            TModel novi = new TModel {
                Oznaka = OznakaTB.Text, Ime = ImeTB.Text, Opis = OpisTB.Text
            };

            novi.Ikonica = slika;

            MainWindow.Tipovi.Add(novi);

            MessageBox.Show("Tip dodat");
            this.Close();
        }
Example #3
0
        public TWindow(TModel model)
        {
            InitializeComponent();
            this.DataContext = this;

            Button1.IsEnabled = false;

            novi = model;

            OznakaTB.Text = model.Oznaka;
            ImeTB.Text    = model.Ime;
            OpisTB.Text   = model.Opis;

            if (!model.Ikonica.Equals(""))
            {
                Slika.Source = new BitmapImage(new Uri(model.Ikonica));
                slika        = model.Ikonica;
            }

            MainWindow.Tipovi.Remove(model);
        }