Esempio n. 1
0
        private void uxFileChange_Click(object sender, RoutedEventArgs e)
        {
            var window = new CatWindow();

            window.Cat   = selectedCat.Clone();
            window.Title = "Update Cat";

            if (window.ShowDialog() == true)
            {
                App.CatRepository.Update(window.Cat.ToRepositoryModel());
                LoadCats();
            }
        }
Esempio n. 2
0
        private void uxFileNew_Click(object sender, RoutedEventArgs e)
        {
            var window = new CatWindow();

            if (window.ShowDialog() == true)
            {
                var uiCatModel = window.Cat;

                var repositoryCatModel = uiCatModel.ToRepositoryModel();

                App.CatRepository.Add(repositoryCatModel);

                LoadCats();
            }
        }