示例#1
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(Aankomsthal aankomsthal)
        {
            NieuweVluchtCommand = new RelayCommand(AddNieuweVlucht);
            WachtendeVluchten   = new ObservableCollection <VluchtViewModel>();


            NieuweVluchtAantalKoffers = 5;

            _aankomsthal = aankomsthal;
            _aankomsthal.WachtendeVluchten.CollectionChanged += (sender, e) =>
            {
                if (e.Action == NotifyCollectionChangedAction.Add)
                {
                    WachtendeVluchten.Add(new VluchtViewModel(e.NewItems[0] as Vlucht));
                }
                else if (e.Action == NotifyCollectionChangedAction.Remove)
                {
                    WachtendeVluchten.RemoveAt(e.OldStartingIndex);
                }
            };

            Band1 = new BaggagebandViewModel(_aankomsthal.Baggagebanden[0]);
            Band2 = new BaggagebandViewModel(_aankomsthal.Baggagebanden[1]);
            Band3 = new BaggagebandViewModel(_aankomsthal.Baggagebanden[2]);

            InitializeDefaultVluchten();
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(Aankomsthal aankomsthal)
        {
            NieuweVluchtCommand = new RelayCommand(AddNieuweVlucht);
            WachtendeVluchten   = new ObservableCollection <VluchtViewModel>();

            NieuweVluchtAantalKoffers = 5;

            _aankomsthal = aankomsthal;
            _aankomsthal.WachtendeVluchten.CollectionChanged += CollectionChanged;

            Band1 = new BaggagebandViewModel(_aankomsthal.Baggagebanden[0]);
            Band2 = new BaggagebandViewModel(_aankomsthal.Baggagebanden[1]);
            Band3 = new BaggagebandViewModel(_aankomsthal.Baggagebanden[2]);

            InitializeDefaultVluchten();
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(Aankomsthal aankomsthal)
        {
            NieuweVluchtCommand = new RelayCommand(AddNieuweVlucht);
            WachtendeVluchten   = new ObservableCollection <VluchtViewModel>();

            NieuweVluchtAantalKoffers = 5;

            _aankomsthal = aankomsthal;
            // TODO: Hier kijken naar _aankomsthal.WachtendeVluchten.CollectionChanged en verversWachtendeVluchten weghalen.
            _aankomsthal.WachtendeVluchten.CollectionChanged += new NotifyCollectionChangedEventHandler(VerversWachtendeVluchten);

            Band1 = new BagagebandViewModel(_aankomsthal.Bagagebanden[0]);
            Band2 = new BagagebandViewModel(_aankomsthal.Bagagebanden[1]);
            Band3 = new BagagebandViewModel(_aankomsthal.Bagagebanden[2]);

            InitializeDefaultVluchten();
        }