コード例 #1
0
        public MainNavigationViewModel(IEventAggregator eventAggregator
                                       , IMessageDialogService messageDialogService
                                       , SearchEngineViewModel searchEngineViewModel
                                       , MainViewModel mainViewModel)
        {
            _eventAggregator       = eventAggregator;
            _mainViewModel         = mainViewModel;
            _searchEngineViewModel = searchEngineViewModel;
            _messageDialogService  = messageDialogService;
            cancelTokenSource      = new CancellationTokenSource();
            token = cancelTokenSource.Token;
            NewDestinationCommand = new Prism.Commands.DelegateCommand(OnNewDestinationExecute);

            NewDestinationCommandX = new Prism.Commands.DelegateCommand(OnNewDestinationExecuteX);

            OpenAdminPanelCommand = new Prism.Commands.DelegateCommand(OnOpenAdminPanelExecute);
            CompareFileCommand    = new Prism.Commands.DelegateCommand(OnCompareFileExecute);
            GoToMainPageCommand   = new Prism.Commands.DelegateCommand(OnGoToMainPageExecute);
            SearchCommand         = new Prism.Commands.DelegateCommand(OnSearchExecute);
            //PrincipalPermission principalPerm = new PrincipalPermission(null, "Administrator");
            //CustomPrincipal wp = Thread.CurrentPrincipal as CustomPrincipal;
            //if (wp != null)
            //    if (wp.IsInRole(@"administrator") == true)
            //    {
            //        //  messagebox.show("accessed");

            //    }
            //        Debug.WriteLine("accessed");
            // MessageBox.Show(principalPerm.ToString());

            SearchCommand     = new Prism.Commands.DelegateCommand(OnSearchExecute);
            ShowHiddenCommand = new Prism.Commands.DelegateCommand(OnShowHiddenExecute);
        }
コード例 #2
0
        public NavigationViewModel(ILookupDataService lookupDataService
                                   , ICategoryLookupDataService categoryLookupDataService
                                   , IEventAggregator eventAggregator)
        {
            _eventAggregator   = eventAggregator;
            _lookupDataService = lookupDataService;

            _categoryLookupDataService = categoryLookupDataService;
            Categories = new ObservableCollection <NavigationItemViewModel>();

            Drives = new ObservableCollection <NavigationDriveItemViewModel>();
            _eventAggregator.GetEvent <AfterSaveEvent>().Subscribe(AfterSaved);
            _eventAggregator.GetEvent <AfterDeletedEvent>().Subscribe(AfterDeleted);
            _eventAggregator.GetEvent <ShowHiddenEvent>().Subscribe(OnShowHidden);



            FirstPageCommand = new Prism.Commands.DelegateCommand(FirstPageCommandExecute);
            PrevPageCommand  = new Prism.Commands.DelegateCommand(PrevPageCommandExecute);
            NextPageCommand  = new Prism.Commands.DelegateCommand(NextPageCommandExecute);
            LastPageCommand  = new Prism.Commands.DelegateCommand(LastPageCommandExecute);

            _currentPage = 1;
            _filterText  = "";
        }
コード例 #3
0
 public FacilityEpiMainViewModel(IRegionManager regionManager)
 {
     this._regionManager    = regionManager;
     this.LoadModuleCommand = new Prism.Commands.DelegateCommand <string>(this.LoadModuleHandler);
     this.OnLoadedCommand   = new Prism.Commands.DelegateCommand(this.OnLoadedHandler);
     this.LoadModuleHandler(AppViews.WelcomeView);
 }
コード例 #4
0
 public CountryViewModel(IDataServices dataServices, IRegionManager region, IEventManager manager, IDialogService dialogService, IConfigurationService config) : base(
         String.Empty, dataServices, region, manager, dialogService, config)
 {
     AssistCommand       = new Prism.Commands.DelegateCommand <object>(OnAssistCommand);
     GridIdentifier      = KarveCommon.Generic.GridIdentifiers.HelperCountry;
     _helperDataServices = DataServices.GetHelperDataServices();
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the ConfigurationDataEditorViewModel class.
 /// </summary>
 public ConfigurationDataEditorViewModel()
 {
     b_Title           = $"OPC UA Application Configuration Editor Rel: {Assembly.GetExecutingAssembly().GetName().Version}";
     SaveCommand       = new Prism.Commands.DelegateCommand(() => { });
     HelpDocumentation = new WebDocumentationCommand(Properties.Resources.HelpDocumentationUrl);
     ReadMe            = new  OpenFileCommand(Properties.Resources.ReadMeFileName);
     ViewLicense       = new WebDocumentationCommand(Properties.Resources.ViewLicenseUrl);
 }
コード例 #6
0
 public ProductSalesMainViewModel(IRegionManager regionManager)
 {
     this._regionManager    = regionManager;
     this.LoadModuleCommand = new Prism.Commands.DelegateCommand <string>(this.LoadModuleHandler);
     this.OnLoadedCommand   = new Prism.Commands.DelegateCommand(this.OnLoadedHandler);
     this.LoadModuleHandler(AppViews.WelcomeView);
     this.SetAvailable();
 }
コード例 #7
0
        public MainWindowViewModel()
        {
            portNameList = new List <string>();
            for (int i = 1; i <= 16; i++)
            {
                portNameList.Add($"COM{i}");
            }
            portName = portNameList[0];

            dataToSend = "=0005.000-";

            currentDateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            startDataSendingEnabled = true;

            clockTimer          = new System.Timers.Timer();
            clockTimer.Interval = 1000;
            clockTimer.Elapsed += TimeTickTimer_Elapsed;
            clockTimer.Start();

            dataSendingIntervalList = new List <int>();
            for (int i = 1; i <= 6; i++)
            {
                dataSendingIntervalList.Add(i * 10);
            }

            dataSendingInterval = 20;

            StartDataSendingCommand = new Prism.Commands.DelegateCommand(() =>
            {
                try
                {
                    serialPortReader = new Utilities.SerialPortReader(portName);
                    serialPortReader.StartDataSending(dataToSend);
                    IsStartDataSendingEnabled = false;
                }
                catch (Exception ex)
                {
                    System.Windows.MessageBox.Show(ex.Message);
                }
            });

            StopDataSendingCommand = new Prism.Commands.DelegateCommand(() =>
            {
                try
                {
                    serialPortReader.StopDataSending();
                }
                catch (Exception ex)
                {
                    System.Windows.MessageBox.Show(ex.Message);
                }
                finally
                {
                    IsStartDataSendingEnabled = true;
                }
            });
        }
コード例 #8
0
 public HomeViewModel(IInteractionInvoker interactionInvoker, IFileConversionHandler fileConversionHandler, ITranslationUpdater translationUpdater, IPrinterHelper printerHelper, ISettingsProvider settingsProvider)
     : base(translationUpdater)
 {
     _interactionInvoker    = interactionInvoker;
     _fileConversionHandler = fileConversionHandler;
     _printerHelper         = printerHelper;
     _settingsProvider      = settingsProvider;
     ConvertFileCommand     = new DelegateCommand(ConvertFileExecute);
 }
コード例 #9
0
        public MainWindowViewModel()
        {
            UrlEncodeCommand = new Prism.Commands.DelegateCommand(() =>
            {
                string encodedResult = UrlEncode(RawText);
                System.Windows.MessageBox.Show(encodedResult);
            });

            rawText = "/=";
        }
コード例 #10
0
        public MainWindowViewModel()
        {
            SingletonSalesClass.Instance.PropertyChanged += Instance_PropertyChanged;
            ClearFilterCommand = new Prism.Commands.DelegateCommand(() =>
            {
                Init2();
            });

            Init2();
            System.Diagnostics.Debug.WriteLine("【Constructor】AreaPageViewModel");
        }
コード例 #11
0
        public AppMVVM()
        {
            System.Threading.Tasks.Task.Run(_AsyncUpdateBitmap);

            MemoryBitmapTypeless.AsSpanBitmap().SetPixels(System.Drawing.Color.Green);
            MemoryBitmapBGRA32.AsSpanBitmap().AsTypeless().SetPixels(System.Drawing.Color.Red);

            OnPaintMemoryBitmapCmd = new Prism.Commands.DelegateCommand(_PaintOnBitmap);

            BindableBitmap.Bitmap = MemoryBitmapBGRA32;
        }
コード例 #12
0
 public UC7ViewModel(IStudentService studentService, INotificationService notificationService, IEventAggregator ea)
 {
     //var a = PersonsData;
     _ea = ea;
     _CustomtNotificationService = notificationService;
     _studentService             = studentService;
     DeleteDelegateComand        = new DelegateCommand <Student>(DeleteStudent);
     UpdateDelegateComand        = new DelegateCommand(UpdateStudent);
     UpdateButtonDelegateComand  = new DelegateCommand <Student>(UpdateButton);
     DeleteCommandPopup          = new DelegateCommand(DeleteCommandPopup1);
     PersonList = _studentService.FindAll().ToList();
 }
コード例 #13
0
 public Prueva1ViewModel()
 {
     comando = new Prism.Commands.DelegateCommand(() =>
     {
         Observables.Add(new Item
         {
             A = "primero",
             B = "segundo"
         });
     });
     Observables = new ObservableCollection <Item>();
     Observables.CollectionChanged += Observables_CollectionChanged;
 }
コード例 #14
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public HeaderBarViewModel()
 {
     MoveCommand = new Prism.Commands.DelegateCommand(executeMoveCommand);
 }
コード例 #15
0
 /// <summary>
 /// 初始化命令
 /// </summary>
 private void initCommand()
 {
     ModifyPasswordCommand = new Prism.Commands.DelegateCommand(OnExecuteModifyPasswordCommand);
     SettingCommand        = new Prism.Commands.DelegateCommand(OnExecuteSettingCommand);
     HelperCommand         = new Prism.Commands.DelegateCommand(OnExecuteHelperCommand);
 }
コード例 #16
0
 public CategoryMainViewModel(IRegionManager regionManager)
 {
     this._regionManager          = regionManager;
     this.LoadCategoryViewCommand = new Prism.Commands.DelegateCommand <string>(this.LoadCategoryViewHandler);
 }
コード例 #17
0
        /// <summary>
        /// InvoiceInfoViewModel.
        /// </summary>
        /// <param name="dataServices">DataServices</param>
        /// <param name="dialogServices"></param>
        /// <param name="manager"></param>
        /// <param name="container"></param>
        /// <param name="regionManager"></param>
        /// <param name="controller"></param>

        public InvoiceInfoViewModel(IDataServices dataServices,
                                    IDialogService dialogServices,
                                    IEventManager manager,
                                    IConfigurationService configurationService,
                                    IRegionManager regionManager,
                                    IInteractionRequestController controller) : base(dataServices,
                                                                                     controller,
                                                                                     dialogServices,
                                                                                     manager, configurationService)
        {
            _dataServices       = dataServices;
            _regionManager      = regionManager;
            _invoiceDataService = _dataServices.GetInvoiceDataServices();
            LineVisible         = true;
            CollectionView      = new ObservableCollection <InvoiceSummaryViewObject>();
            AssistMapper        = _dataServices.GetAssistDataServices().Mapper;
            ItemChangedCommand  = new Prism.Commands.DelegateCommand <IDictionary <string, object> >(OnChangedCommand);
            NavigateCommand     = new DelegateCommand <object>(OnNavigate);
            AssistCommand       = new DelegateCommand <object>(OnAssistCommand);
            AddNewClientCommand = new DelegateCommand <object>(OnAddNewClientCommand);
            OpenContractCommand = new DelegateCommand <object>(OnOpenContract);
            OpenVehiclesCommand = new DelegateCommand <object>(OnOpenVehicles);

            AssistExecuted += OnAssistExecuted;
            CompanyName     = String.Empty;
            AddressName     = String.Empty;
            List <string> colList;
            var           genericInovice = new InvoiceSummaryViewObject();

            colList = genericInovice.GetType().GetProperties().Select(value => value.Name).ToList();

            GridColumns = new List <string>()
            {
                "AgreementCode", "VehicleCode", "Opciones", "Description", "Quantity", "Price", "Discount", "Subtotal",
                "Unity", "Iva"
            };

            /*
             * This is a cell grid presentation item
             */
            var presenter = new ObservableCollection <CellPresenterItem>()
            {
                new NavigationAwareItem()
                {
                    DataTemplateName = "NavigateInvoiceItem", MappingName = "AgreementCode", RegionName = RegionNames.LineRegion
                },
                new NavigationAwareItem()
                {
                    DataTemplateName = "NavigateVehicleItem", MappingName = "VehicleCode", RegionName = RegionNames.LineRegion
                }
            };

            CellGridPresentation = presenter;
            EventManager.RegisterObserverSubsystem(InvoiceModule.InvoiceSubSystem, this);
            var gid = Guid.NewGuid();

            GridIdentifier  = GridIdentifiers.InvoiceLineGrids;
            ViewModelUri    = new Uri("karve://invoice/viewmodel?id=" + gid.ToString());
            MailBoxHandler += IncomingMailBox;
            SubSystem       = DataSubSystem.InvoiceSubsystem;
            RegisterMailBox(ViewModelUri.ToString());
        }
コード例 #18
0
 public UserManagmentViewModel(IRegionManager regionManager)
 {
     this._regionManager        = regionManager;
     this.LoadUserManagmentView = new Prism.Commands.DelegateCommand <string>(this.LoadUserManagmentViewHandler);
 }
コード例 #19
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public PageableViewModelBase()
        {
            PageChangedCommand = new Prism.Commands.DelegateCommand <PageChangedEventArgs>(OnExecutePageChangedCommand);

            int.TryParse(Utility.ConfigHelper.GetAppSetting("PageSize"), out pageSize);
        }
コード例 #20
0
 private void InitiialzeCommands()
 {
     SelectPolicySearchLegalCommand = new DelegateCommand(OnSelectPolicySearchLegalExecute, CanSelectPolicySearchLegalExecute);
 }