private void Choose(object sender, RoutedEventArgs e)
        {
            var card   = (Card)MainFrame.Content;
            var choose = new ChooseWindows(card.MObject, Config);

            choose.ShowDialog();

            MainFrame.Navigate(new Card(choose.Result, Config));
            var CardObject = CardList.IndexOf(CardList.Find(e => e.MObject.Name == choose.Result.Name));

            CardList[CardObject].MObject = choose.Result;
            new SaveSystem().Save(choose.Result);
        }
Example #2
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            var c = new Car()
            {
                Name          = CName.Text,
                LicenceNumber = CLP.Text,
                BuyDate       = CDate.SelectedDate.Value,
                Costs         = new CostGroups(),
            };

            result = c;
            var Choose = new ChooseWindows(c, Config);

            Choose.ShowDialog();
            result.Costs = Choose.Result.Costs;
            new SaveSystem().Save(result);
            mainWindow.Objects.Add(c);
            Parent.DialogResult = true;
            Parent.Close();
        }