Esempio n. 1
0
 public CustomObjects()
 {
     InitResources();
     InitAppointments();
     SearchControl              = new SearchControl();
     PreviewKeyDownCommand      = new DevExpress.Mvvm.DelegateCommand <KeyEventArgs>(PreviewKeyDown);
     SearchControlLoadedCommand = new DevExpress.Mvvm.DelegateCommand <RoutedEventArgs>(SearchControlLoaded);
     ResetSearchTextCommand     = new DevExpress.Mvvm.DelegateCommand <SelectionChangedEventArgs>(ResetSearchText);
 }
 public MainPageViewModel()
 {
     _previewModel = new ReportServicePreviewModel()
     {
         ServiceUri = "../NorthwindReportService.svc",
         ReportName = "Reports.ProductReport"
     };
     _categorySubmitCommand = new DelegateCommand <object>(CategorySubmitted);
     _categories            = new ReadOnlyCollection <string>(new string[] { "Beverages", "Condiments", "Seafood" });
 }
        public SchedulerViewModel()
        {
            Appointments = new ObservableCollection <ModelAppointment>();
            Resources    = new ObservableCollection <ModelResource>();

            SelectedAppointments      = new ObservableCollection <Appointment>();
            SelectedModelAppointments = new ObservableCollection <ModelAppointment>();

            SelectedAppointments.CollectionChanged      += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedAppointments_CollectionChanged);
            SelectedModelAppointments.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedModelAppointment_CollectionChanged);

            SchedulerLoadedCommand = new DevExpress.Mvvm.DelegateCommand <RoutedEventArgs>(SchedulerLoadedCommandExecute);
            FilterChangedCommand   = new DevExpress.Mvvm.DelegateCommand <GridEventArgs>(FilterChangedCommandExecute);
            ShowEditFormCommand    = new DevExpress.Mvvm.DelegateCommand <RowDoubleClickEventArgs>(ShowEditFormCommandExecute);

            DataProvider.AddTestData(Resources, Appointments);
        }
Esempio n. 4
0
        public ViewModelHarmonogramDzienny()
        {
            lastFetchedInterval = new TimeInterval();

            _poehandler         = new PersistentObjectsEventHandler(Storage_AppointmentsModified);
            _addnewroutecommand = new RelayCommand(SaveExecute_Execute, CanExecuteTrasa);
            _refreshcommand     = new RelayCommand(Refresh, CanRefrest);

            //SelectedListHarmonogram = new ObservableCollection<ARIT_HARMONOGRAM>();
            //SelectedListHarmonogram.CollectionChanged += SelectedListHarmonogram_CollectionChanged;
            //_selectedAppointments = new ObservableCollection<ModelAppointment>();

            AppointmentsModifiedCommand = new DelegateCommand <DevExpress.XtraScheduler.PersistentObjectsEventArgs>(AppointmentsModifiedExecute);
            //      AppointmentsDeletedCommand = new DelegateCommand<DevExpress.XtraScheduler.PersistentObjectsEventArgs>(AppointmentsDeletedExecute);
            AppointmentsDeletedCommand = new DelegateCommand <DevExpress.XtraScheduler.PersistentObjectCancelEventArgs>(AppointmentsDeletedExecute2);
            FetchAppointmentsCommand   = new DelegateCommand <DevExpress.XtraScheduler.FetchAppointmentsEventArgs>(FetchAppointmentsExecute);
            SchedulerLoadedCommand     = new DevExpress.Mvvm.DelegateCommand <RoutedEventArgs>(SchedulerLoadedCommandExecute);
            RemoveRouteCommand         = new DelegateCommand(RemoveMachine);
            AddRouteCommand            = new DelegateCommand(AddMachine);
            //     ZamDostCommand = new RelayCommand(GenZam,CanGenZam);
            //    ZamDostDel = new RelayCommand(DelZam, CanDelZam);
            //    ListHarmonogramDzienny = new ObservableCollection<ARIT_HARMONOGRAM>();
            Appointments              = new ObservableCollection <IHP_HARMONOGRAM_DZIENNY>();
            SelectedAppointments      = new ObservableCollection <Appointment>();
            SelectedModelAppointments = new ObservableCollection <IHP_HARMONOGRAM_DZIENNY>();

            SelectedAppointments.CollectionChanged      += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedAppointments_CollectionChanged);
            SelectedModelAppointments.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(SelectedModelAppointment_CollectionChanged);

            ///    Resources = new ObservableCollection<ModelResource>();
            Machines    = new ObservableCollection <IHP_MASZYNA>();
            MachinesLst = new ObservableCollection <IHP_MASZYNA>();
            Refresh();
            GetMachines();
            Messenger.Default.Register <int>(this, OnMessageUpdate);
        }