Exemple #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();
            }
        }
Exemple #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();
            }
        }