コード例 #1
0
 private void Add_Tour_Button_Click(object sender, RoutedEventArgs e)
 {
     if (!AddPlaceOpen && !AddTourOpen && !AddEventOpen)
     {
         AddTour addTour = new AddTour(window);
         addTour.Show();
         Delete_Button.IsEnabled = false;
         AddTourOpen             = true;
     }
 }
コード例 #2
0
        public TourPlannerVM()
        {
            this.Tours          = new ObservableCollection <Tour>();
            this.AddCommand     = new AsyncCommand(OpenAddTourWindow);
            this.RemoveCommand  = new AsyncCommand(async() => Tours.RemoveAt(Tours.Count - 1));
            this.AddTourCommand = new AsyncCommand(AddTour);

            this.DataAccess      = new InMemoryDB();//Better solution with Dependency injection
            this._addTour        = new AddTour();
            _addTour.DataContext = this;
        }