Exemplo n.º 1
0
        private void Image_Drop(object sender, DragEventArgs e)
        {
            var data = e.Data.GetData(typeof(PostItView));

            if (data is PostItView postItView && postItView.DataContext is PostItViewModel context)
            {
                if (MessageBox.Show("Êtes-vous sûr ?", "Suppression", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
                {
                    PostItContext.DeletePostIt(context.Model);
                }
            }
        }
Exemplo n.º 2
0
        protected void InitializeModel()
        {
            PostItContext.Migrate();
            Categories = PostItContext.GetCategories();

            if (Categories.Count() <= 0)
            {
                PostItContext.AddCategories(new Category()
                {
                    Title = "Aujourd'hui"
                });

                PostItContext.AddCategories(new Category()
                {
                    Title = "Cette semaine"
                });

                PostItContext.AddCategories(new Category()
                {
                    Title = "Ce mois"
                });
            }
            Categories = PostItContext.GetCategories();
        }
Exemplo n.º 3
0
 internal void Drop(PostItViewModel postItViewModel)
 {
     PostItContext.ChangePostItCategory(postItViewModel.Model, Category);
 }