コード例 #1
0
        public FlightManagerViewModel()
        {
            _dataSet = new AirlinesDataSet();
            _adapter = new FlightSetTableAdapter();
            _adapter.Fill(_dataSet.FlightSet);
            FlightsDataView = _dataSet.FlightSet.DefaultView;
          

            _updateViewTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(700) };

            Messenger.Default.Register<Message>(this, RefreshDataSet, Context.AddContext);
        }
コード例 #2
0
        public AdministratorViewModel(User administrator)
        {
            _dataSet = new AirlinesDataSet();
            _adapter = new UserSetTableAdapter();
            _adapter.Fill(_dataSet.UserSet);
            UsersDataView = _dataSet.UserSet.DefaultView;
            CurrentUser = administrator;

            _updateViewTimer       = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(700) };
            _updateViewTimer.Tick += async (sender, args) => await ApplyFilter();

            Messenger.Default.Register<Message>(this, RefreshDataSet, Context.AddContext);
        }