예제 #1
0
        private void buttonSave_Click(object sender, RoutedEventArgs e)
        {
            List <Figuur> GewijzigdeFiguren = new List <Figuur>();

            foreach (Figuur f in figuren)
            {
                if (f.Changed)
                {
                    GewijzigdeFiguren.Add(f);
                }
                f.Changed = false;
            }
            if (GewijzigdeFiguren.Count != 0)
            {
                try
                {
                    FiguurManager manager = new FiguurManager();
                    manager.SchrijfWijzigingen(GewijzigdeFiguren);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            GewijzigdeFiguren.Clear();
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            figuurViewSource = ((CollectionViewSource)(this.FindResource("figuurViewSource")));
            var manager = new FiguurManager();

            figuren = manager.getFiguren();
            figuurViewSource.Source = figuren;
        }
예제 #3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            figuurViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("figuurViewSource")));
            // Load data by setting the CollectionViewSource.Source property:
            // figuurViewSource.Source = [generic data source]
            FiguurManager manager = new FiguurManager();

            figuren = manager.GetFiguren();
            figuurViewSource.Source = figuren;
        }