public ImportSapOneviewDataDialogViewModel()
 {
     ImporterStack = new Stack<CommonUtils.ExecuteImporterType>();
     ImportButtonCommand = new DelegateCommand<object>(ImportButtonHandler, CanImport);
     ExportButtonCommand = new DelegateCommand<object>(ExportButtonHandler, CanImport);
     CancelButtonCommand = new DelegateCommand<object>(CancelButtonHandler, CanImport);
 }
        public AddEditDocumentDisciplineModel()
        {
            mDocumentDiscipline = new DocumentDiscipline();

            OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanExecuteOkButtonHandler);
            CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);
        }
        public IssueSystemReferencesViewModel(Issue issue)
        {
            CompositionInitializer.SatisfyImports(this);
            mIssue = issue;

            var getSystemReferencesTask = DatabaseLoader.GetSystemReferences(mIssue.Id);

            List<Task> tasks = new List<Task> {getSystemReferencesTask};

            Task.Factory.ContinueWhenAll(tasks.ToArray(), x =>
            {
                CMS.UiFactory.StartNew(() =>
                {
                    //SystemReferences
                    mIssue.SystemReferences = getSystemReferencesTask.Result;
                    mIssue.ModifiedObjects.SystemReferenceModified = true;
                    Utils.SetUpChangeEvents(View, EventAggregator, mIssue);
                    RaisePropertyChanged("SystemReferences");

                    mDictionary = Utils.BuildDictionaryForCollection(mIssue.SystemReferences.Select(r => r.Id).ToList());

                    if (DataLoaded != null) { DataLoaded(); }
                });
            });

            AddButton = new DelegateCommand<object>(AddHandler, CanAdd);
            DeleteButton = new DelegateCommand<object>(DeleteHandler, CanDelete);
            EditButton = new DelegateCommand<object>(EditHandler, CanModify);
            SelectButton = new DelegateCommand<object>(SelectHandler, CanModify);
        }
Esempio n. 4
0
        public LoggedInUserViewModel()
        {
            EventServiceFactory.EventService.GetEvent<GenericEvent<User>>().Subscribe(x =>
            {
                if (x.Topic == EventTopicNames.UserLoggedIn) UserLoggedIn(x.Value);
                if (x.Topic == EventTopicNames.UserLoggedOut) UserLoggedOut(x.Value);
            });
            LoggedInUser = AppServices.CurrentLoggedInUser;

            LogoutUserCommand = new DelegateCommand<User>(x =>
            {
                if (AppServices.CanNavigate())
                {
                    if (AppServices.IsUserPermittedFor(PermissionNames.OpenNavigation))
                    {
                        EventServiceFactory.EventService.PublishEvent(EventTopicNames.ActivateNavigation);
                    }
                    else
                    {
                        AppServices.CurrentLoggedInUser.PublishEvent(EventTopicNames.UserLoggedOut);
                        AppServices.LogoutUser();
                    }
                }
            });
        }
 public MainViewModel()
 {
     SearchItemCommand = new DelegateCommand(SearchItem);
     UpdateHire1Command = new DelegateCommand(UpdateHire1);
     UpdateHire2Command = new DelegateCommand(UpdateHire2);
    
 }
 public DetailPageViewModel()
 {
     //注册消息
     Messenger.Default.Register<string>(this, StaticMsgToken.NavigationA, InitData);
     GoBackCommand = new DelegateCommand();
     GoBackCommand.ExecuteAction = new Action<object>(GoBack);
 }
Esempio n. 7
0
        public CalendarViewModel(ICalendarService calendarService, IRegionManager regionManager)
        {
            this.synchronizationContext = SynchronizationContext.Current ?? new SynchronizationContext();

            this.openMeetingEmailCommand = new DelegateCommand<Meeting>(this.OpenMeetingEmail);

            this.meetings = new ObservableCollection<Meeting>();

            this.calendarService = calendarService;
            this.regionManager = regionManager;

            this.calendarService.BeginGetMeetings(
                r =>
                {
                    var meetings = this.calendarService.EndGetMeetings(r);

                    this.synchronizationContext.Post(
                        s =>
                        {
                            foreach (var meeting in meetings)
                            {
                                this.Meetings.Add(meeting);
                            }
                        },
                        null);
                },
                null);
        }
        public DocumentManagerViewModel()
        {
            TaxPayerList = new ObservableCollection<TaxPayerEntity>();
            TaxPayerTypeList = new ObservableCollection<TaxPayerTypeEntity>();
            TaxPayerTypeEntityDictionary = new Dictionary<int, TaxPayerTypeEntity>();
            FileTypeList = new ObservableCollection<FileTypeEntity>();
            FileTypeDictionary = new Dictionary<int, FileTypeEntity>();
            UserEntityDictionary = new Dictionary<int, UserEntity>();

            DocumentViewModel = new DocumentViewModel();
            DocumentViewModel.BeginLoadings += BeginLoading;
            DocumentViewModel.FinishLoadings += FinishLoading;

            documentManagerContext = new DocumentManager.Web.DocumentManagerDomainContext();
            OnAddTaxPayer = new DelegateCommand(onAddTaxPayer);
            OnAddProject = new DelegateCommand(onAddProject, canAddProject);
            OnModifyTaxPayer = new DelegateCommand(onModifyTaxPayer, canModifyTaxPayer);
            OnDeleteTaxPayer = new DelegateCommand(onDeleteTaxPayer, canDeleteTacPayer);

            OnRefresh = new DelegateCommand(onRefresh);
            OnDoubleClickList = new DelegateCommand(onDoubleClickList);

            taxPayerDocumentSource = new EntityList<Web.Model.taxpayerdocument>(documentManagerContext.taxpayerdocuments);
            taxPayerDocumentLoader = new DomainCollectionViewLoader<Web.Model.taxpayerdocument>(
                LoadTaxPayerDocument,
                LoadTaxPayerDocument_Complete
                );
            taxPayerDocumentView = new DomainCollectionView<Web.Model.taxpayerdocument>(taxPayerDocumentLoader, taxPayerDocumentSource);
        }
        public InfoLinkDecal()
        {
            MetaData = new InfoLinkMetaData() { Source = "http://" };
            Stretch = System.Windows.Media.Stretch.Uniform;
            Size = 1;
            CanResize = false;
            Stretch = System.Windows.Media.Stretch.None;
            Center = new System.Windows.Point(1, 1);
            PinPoint = new System.Windows.Point(1, 1);
            CanMove = false;

            OpenUrl = new DelegateCommand(() =>
            {
                if (!MetaData.Source.StartsWith("http://"))
                {
                    MetaData.Source = "http://" + MetaData.Source;
                }
            #if WINDOWS_PHONE
                Microsoft.Phone.Controls.PhoneApplicationFrame frame = Application.Current.RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame;
                frame.Navigate(new Uri(MetaData.Source));
            #elif SILVERLIGHT

                HtmlPage.Window.Navigate(new Uri(MetaData.Source), "_blank");
            #else
                Process.Start(MetaData.Source);
            #endif
            }, CanOpenUrl);
        }
 /// <summary>
 /// Creates the OpenMapControl.
 /// </summary>
 public MyMapsControl()
 {
     DefaultStyleKey = typeof(MyMapsControl);
     OwnerCommand = new DelegateCommand(OwnerButton_Click);
     DetailsCommand = new DelegateCommand(MoreDetailsButton_Click);
     OpenCommand = new DelegateCommand(OpenButton_Click);
 }
 public RenameAccountDialogViewModel(ShellViewModel shell, Account account, string currentName)
     : base(shell)
 {
     _account = account;
     _rename = new DelegateCommand(RenameAction);
     CurrentAccountName = currentName;
 }
 public DebugWindowViewModel(IEventAggregator eventAggregator) {
   _eventAggregator = eventAggregator;
   DebugStrings = new ObservableCollection<string>();
   _eventAggregator.GetEvent<SetDebugMessageEvent>().Subscribe(SetMessage);
   SendCloseMessageCommand = new DelegateCommand(SendCloseMessage);
   ExportListCommand = new DelegateCommand(ExportList);
 }
        public GeoRegionMaintenanceViewModel(IModuleController moduleController, IDataRepository repository, IEventAggregator eventAggregator)
        {
            _moduleController = moduleController;
            _repository = repository;
            _eventAggregator = eventAggregator;

            ShowView = _moduleController.ShowViewCommand;
            NavigationDetails = _moduleController.NavigationDetails;

            ChangeMetaPanel = new DelegateCommand<bool?>(ChangeMetaViewPanel);
            ChangeGeoPanel = new DelegateCommand<bool?>(ChangeGeoViewPanel);

            DeleteMetaRegionCommand = new DelegateCommand(DeleteMetaRegion);
            EditMetaRegionCommand = new DelegateCommand(EditMetaRegion);
            AddNewMetaRegionCommand = new DelegateCommand(AddNewMetaRegion);
            DeleteMetaRegionMappingCommand = new DelegateCommand(DeleteMetaRegionMapping);
            AddMetaRegionMappingCommand = new DelegateCommand(AddMetaRegionMapping);
            DeleteGeoRegionCommand = new DelegateCommand(DeleteGeoRegion);
            EditGeoRegionCommand = new DelegateCommand(EditGeoRegion);
            CreateNewGeoRegionCommand = new DelegateCommand(CreateNewGeoRegion);

            _metaRegions = new ObservableCollection<t033_meta_region>();
            _metaRegionMappings = new ObservableCollection<t031_geo_code>();
            _geoRegions = new ObservableCollection<GeoRegionViewModel>();

            _moduleController.SwitchPanel(MaintenanceRegionNames.MetaRegionRegion, MaintenanceViewNames.MetaRegionView);
            _moduleController.SwitchPanel(MaintenanceRegionNames.GeoRegionRegion, MaintenanceViewNames.GeoRegionView);
            _moduleController.SwitchPanel(MaintenanceRegionNames.MetaRegionMappingRegion, MaintenanceViewNames.MetaRegionMappingView);

            _eventAggregator.GetEvent<RefreshRegionsEvent>().Subscribe(InitializeData);
        }
 public CustomizeablePropertyViewModel(EditablePropertyViewModel PropertyViewModel)
 {
     this.PropertyViewModel = PropertyViewModel;
     Name = this.PropertyViewModel.Name;
     Value = this.PropertyViewModel.Value.ToString();
     Customize = new DelegateCommand(CustomizeAction);
 }
 public ConfigService()
 {       
     LoadAdminInfo();
     LoadConfig();
     SaveAdminInfoCommand = new DelegateCommand(SaveAdminInfo);
     SaveConfigCommand = new DelegateCommand(SaveConfig);
 }
        public AddClassificationViewModel(List<IssueClassification> selectedIssueSubTypes, IEnumerable<IssueType> issueTypes)
        {
            mSelectedClassifications = selectedIssueSubTypes;

            var ids = (from x in issueTypes select x.Id).ToList();

            var cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
            cmsWebServiceClient.GetIssueClassificationsAvailableForIssueTypesCompleted += (s1, e1) =>
            {
                IssueClassifications = e1.Result;

                foreach (IssueClassification classification in IssueClassifications)
                {
                    if ((from x in mSelectedClassifications where x.Id == classification.Id select x).FirstOrDefault() != null)
                    {
                        classification.Checked = true;
                    }
                }
                mLoaded = true;
                RaiseLoaded();
            };
            cmsWebServiceClient.GetIssueClassificationsAvailableForIssueTypesAsync(ids);

            OkButtonCommand = new DelegateCommand<object>(OkButtonHandler, CanExecuteOkButtonHandler);
            CancelButtonCommand = new DelegateCommand<object>(CanelButtonHandler, CanExecuteOkButtonHandler);
        }
Esempio n. 17
0
        public RiskAnalyserViewModel(ICustomerService customerService)
        {
            _customerService = customerService;

            try
            {
                _customerService.Init();
                cutSettledBets = new ObservableCollection<CustomerBet>(_customerService.CustomerSettledBets);
                cutUnSettledBets = new ObservableCollection<CustomerBet>(_customerService.CustomerUnSettledBets);
            }
            catch (Exception e)
            {
                Header = e.Message;
            }

            SettleBets = new ObservableCollection<Bet>(cutSettledBets.SelectMany(d => d.Bet).ToList());
            UnSettleBets = new ObservableCollection<Bet>(cutUnSettledBets.SelectMany(d => d.Bet).ToList());

            ShowSettled = new DelegateCommand(VisibleSettled);

            ShowUnSettled = new DelegateCommand(VisibleUnSettled);

            ShowUnusalWinning = new DelegateCommand(UnsualWinning);

            ShowUnusalStake = new DelegateCommand(UnusalStake);

            ShowHighlyUnusalStake = new DelegateCommand(HighlyUnusalStake);

            ShowBigWin = new DelegateCommand(BigWin);

            Header = "Settled Bets";
        }
        public AddEditExistingControlSystemComponentAlarmPropertyViewModel(int componentTypePropertyId)
        {
            //edit

            OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanModify);
            CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, x => true);

            CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint);
            Properties = new List<ControlSystemAlarmProperty>();

            //Load ControlSystem Properties types
            EventHandler<GetAllControlSystemAlarmPropertiesCompletedEventArgs>
                fetchCompleted = (s, e) =>
                                     {
                                         Properties = e.Result;
                                         cmsWebServiceClient.GetControlSystemComponentTypeAlarmPropertyCompleted +=
                                             (s2, e2) =>
                                             {
                                                 if (Properties.Count > 0)
                                                 {
                                                     SelectedProperty = (from x in Properties
                                                                         where x.Id == e2.Result.ComponentTypeId
                                                                         select x).FirstOrDefault();
                                                 }

                                                 mControlSystemComponentTypeAlarmProperty = e2.Result;
                                                 Loaded();
                                             };
                                         cmsWebServiceClient.GetControlSystemComponentTypeAlarmPropertyAsync(componentTypePropertyId);
                                     };

            cmsWebServiceClient.GetAllControlSystemAlarmPropertiesCompleted += fetchCompleted;
            cmsWebServiceClient.GetAllControlSystemAlarmPropertiesAsync();
        }
        public StreamConfigurationViewModel(
            IApplicationSettingsProvider applicationSettingsProvider,
            IGlobalExcludeSettings globalExcludeSettings,
            IAccountSettingsProvider accountSettingsProvider,
            IColumnsSettingsProvider columnsSettingsProvider,
            IContactService contactService)
        {
            _applicationSettingsProvider = applicationSettingsProvider;
            _accountSettingsProvider = accountSettingsProvider;
            _globalExcludeSettings = globalExcludeSettings;
            _columnsSettingsProvider = columnsSettingsProvider;
            _contactService = contactService;
            _scriptLibrary = CompositionManager.Get<IScriptingLibrarian>();

            ShowConfiguration = false;

            Filters = new StreamModel {Direction = ListSortDirection.Descending};
            FilterBefore = DateTime.Now.Subtract(new TimeSpan(365, 0, 0, 0, 0));

            ScriptFilters = _scriptLibrary.ScriptFilters;

            EditCommand = new DelegateCommand(SetEdit);
            CancelCommand = new DelegateCommand(CancelChanges);
            SaveCommand = new DelegateCommand(SaveChanges);
        }
        public AddEditIssueMilestoneDelayTypeModel()
        {
            mIssueMilestoneDelayType = new IssueMilestoneDelayType();

            OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanExecuteOkButtonHandler);
            CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, CanExecuteOkButtonHandler);
        }
 public FileTypeWindowViewModel(ChildWindow aChildWindow, FileTypeEntity aFileTypeEntity)
 {
     childWindow = aChildWindow;
     FileTypeEntity = aFileTypeEntity;
     OnOK = new DelegateCommand(OnOKCommand);
     OnCancel = new DelegateCommand(OnCancelCommand);
 }
Esempio n. 22
0
        public SongsPageViewModel(
            ILibraryCollectionService libraryCollectionService,
            ILibraryService libraryService,
            ISettingsUtility settingsUtility,
            IPlayerService playerService)
        {
            _libraryCollectionService = libraryCollectionService;
            _settingsUtility = settingsUtility;
            _playerService = playerService;
            LibraryService = libraryService;

            SortItems =
                Enum.GetValues(typeof (TrackSort))
                    .Cast<TrackSort>()
                    .Select(sort => new ListBoxItem { Content = sort.GetEnumText(), Tag = sort })
                    .ToList();
            SortChangedCommand = new DelegateCommand<ListBoxItem>(SortChangedExecute);
            ShuffleAllCommand = new DelegateCommand(ShuffleAllExecute);

            var defaultSort = _settingsUtility.Read(ApplicationSettingsConstants.SongSort,
                TrackSort.DateAdded,
                SettingsStrategy.Roam);
            DefaultSort = SortItems.IndexOf(SortItems.FirstOrDefault(p => (TrackSort)p.Tag == defaultSort));
            ChangeSort(defaultSort);
        }
Esempio n. 23
0
 public NodeMasterViewModel(NodeConfig config)
 {
     m_Config = config;
     Name = m_Config.Name;
     ConnectCommand = new DelegateCommand(ExecuteConnectCommand);
     ThreadPool.QueueUserWorkItem((c) => InitializeWebSocket((NodeConfig)c), config);
 }
Esempio n. 24
0
 public LoginViewModel(IEventAggregator messageBus)
 {
     _messageBus = messageBus;
     LoginCommand = new DelegateCommand<object>(Login);
     _serviceFacade = ((ServiceLocator)App.Current.Resources["ServiceLocator"]).ServiceFacade;
     _serviceFacade.LoginCompletedEvent += new EventHandler<HsrOrderApp.UI.Silverlight.AuthenticationService.LoginCompletedEventArgs>(LoginViewModel_LoginCompletedEvent);
 }
Esempio n. 25
0
        public ActionTriggerViewModel(BindableNetworkValueBag<string> networkValueCollection)
        {
            _networkValueCollection = networkValueCollection;

            PullItemsAgainCommand = new DelegateCommand(ExecutePullItemsAgain, CanExecutePullItemsAgain);
            ClearCommand = new DelegateCommand(ExecuteClear, CanExecuteClear);
        }
 public ProcessingDialogViewModel()
 {
     LoadParameters = new DelegateCommand<MassSpecStudio.Core.Domain.Algorithm>(OnLoadParameters);
     _algorithms = ServiceLocator.Current.GetAllInstances<IAlgorithm>().ToList();
     _selectedAlgorithm = _algorithms.FirstOrDefault();
     _recentAlgorithmsUsed = RecentAlgorithms.Read();
 }
Esempio n. 27
0
        public MyDayViewModel(
            [Import] IEventAggregator aggregator,
            [Import] ITasksService tasksService,
            [Import] IProjectsService projectsService,
            [Import] ITeamService teamService,
            [Import] IBackgroundExecutor executor,
            [Import] IAuthorizationService authorizator)
            : base(aggregator, tasksService, projectsService, teamService, executor, authorizator)
        {
            aggregator.Subscribe<MemberProfile>(ScrumFactoryEvent.SignedMemberChanged, OnSignedMemberChanged);

            aggregator.Subscribe<Task>(ScrumFactoryEvent.TaskAdded, t => { UpdateTasks(); });
            aggregator.Subscribe<Task>(ScrumFactoryEvent.TaskAssigneeChanged, t => { UpdateTasks(); });
            aggregator.Subscribe<Task>(ScrumFactoryEvent.TaskChanged, t => { UpdateTasks(); });

            aggregator.Subscribe<ICollection<ProjectInfo>>(ScrumFactoryEvent.RecentProjectChanged, prjs => {
                List<ProjectInfo> prjs2 = new List<ProjectInfo>(prjs);
                if (MemberEngagedProjects != null)
                    prjs2.RemoveAll(p => MemberEngagedProjects.Any(ep => ep.ProjectUId == p.ProjectUId));
                RecentProjects = prjs2.Take(8).ToList();
                OnPropertyChanged("RecentProjects");
            });

            OnLoadCommand = new DelegateCommand(OnLoad);
            RefreshCommand = new DelegateCommand(Load);
            ShowMemberDetailCommand = new DelegateCommand<MemberProfile>(ShowMemberDetail);
            CreateNewProjectCommand = new DelegateCommand(CreateNewProject);

            eventsViewSource = new System.Windows.Data.CollectionViewSource();
        }
        public MechanicalNavigationViewModel(SearchFilterControl searchFilterControl)
        {
            CompositionInitializer.SatisfyImports(this);

            mSearchFilterControl = searchFilterControl;

            mGridRefreshTimer.Interval = TimeSpan.FromMilliseconds(500);
            mGridRefreshTimer.Tick += (sender, eventArgs) => { mGridRefreshTimer.Stop(); ProcessSearchFilter(); };

            ImportNewMechanicalsCommand = new DelegateCommand<object>(ImportNewMechanicalsHandler, CanImport);
            ImportNewMechanicalComponentsCommand = new DelegateCommand<object>(ImportNewMechanicalComponentsHandler, CanImport);

            ImportNewRelatedDocumentsCommand = new DelegateCommand<object>(ImportNewRelatedDocumentsHandler, CanImport);
            ImportExistingMechanicalsCommand = new DelegateCommand<object>(ImportExistingMechanicalsHandler, CanImport);
            ImportExistingMechanicalComponentsCommand = new DelegateCommand<object>(ImportExistingMechanicalComponentsHanlder, CanImport);

            CreateAttachmentsCommand = new DelegateCommand<object>(CreateAttachmentsHandler, CanImport);
            PreferredEquipmentCommand = new DelegateCommand<object>(PreferredEquipmentHandler, x => (CMS.EffectivePrivileges.AdminTab.CanView || CMS.EffectivePrivileges.MechanicalTab.CanView));

            ClearFilterCommand = new DelegateCommand<object>(x => { ClearControls(); ProcessSearchFilter(); searchFilterControl.SetFilterIsOn(false); }, x => true);
            SearchCommand = new DelegateCommand<object>(x => ProcessSearchFilter(), x => true);
            KeywordKeyCommand = new DelegateCommand<object>(x => ProcessSearchFilter(), x => true);
            MaintSysIdKeyCommand = new DelegateCommand<object>(x => ProcessSearchFilter(), x => true);

            LoadData();
        }
Esempio n. 29
0
        public dynNodeViewModel(dynNodeModel logic)
        {
            nodeLogic = logic;

            //respond to collection changed events to sadd
            //and remove port model views
            logic.InPorts.CollectionChanged += inports_collectionChanged;
            logic.OutPorts.CollectionChanged += outports_collectionChanged;

            logic.PropertyChanged += logic_PropertyChanged;
            dynSettings.Controller.DynamoViewModel.Model.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(Model_PropertyChanged);

            DeleteCommand = new DelegateCommand(DeleteNodeAndItsConnectors, CanDeleteNode);
            SetLacingTypeCommand = new DelegateCommand<string>(new Action<string>(SetLacingType), CanSetLacingType);
            SetStateCommand = new DelegateCommand<object>(SetState, CanSetState);
            SelectCommand = new DelegateCommand(Select, CanSelect);
            ViewCustomNodeWorkspaceCommand = new DelegateCommand(ViewCustomNodeWorkspace, CanViewCustomNodeWorkspace);
            SetLayoutCommand = new DelegateCommand<object>(SetLayout, CanSetLayout);
            SetupCustomUIElementsCommand = new DelegateCommand<dynNodeView>(SetupCustomUIElements, CanSetupCustomUIElements);
            ValidateConnectionsCommand = new DelegateCommand(ValidateConnections, CanValidateConnections);

            //Do a one time setup of the initial ports on the node
            //we can not do this automatically because this constructor
            //is called after the node's constructor where the ports
            //are initially registered
            SetupInitialPortViewModels();

            dynSettings.Controller.RequestNodeSelect += new NodeEventHandler(Controller_RequestNodeSelect);
        }
        public TypeViewModel(TypeInfo typeInfo)
        {
            _isExpanded = true;
            _typeInfo = typeInfo;
            if (_typeInfo.BaseType != null)
            {
                BaseType = new TypeViewModel(_typeInfo.BaseType);
            }

            _fields = _typeInfo.Fields
                .OrderBy(f => f.Name)
                .Select(f => new FieldViewModel(f))
                .OfType<MemberViewModel>()
                .ToArray();
            _properties = _typeInfo.Properties
                .OrderBy(p => p.Name)
                .Select(p => new PropertyViewModel(p))
                .OfType<MemberViewModel>()
                .ToArray();
            _events = _typeInfo.Events
                .OrderBy(e => e.Name)
                .Select(e => new EventViewModel(e))
                .OfType<MemberViewModel>()
                .ToArray();
            _methods = _typeInfo.Methods
                .OrderBy(m => m.Name)
                .Select(m => new MethodViewModel(m))
                .OfType<MemberViewModel>()
                .ToArray();

            NavigateCommand = new DelegateCommand(NavigateCommandHandler);
            BrowseInteractionsCommand = new DelegateCommand(BrowseInteractionsCommandHandler);
        }
Esempio n. 31
0
 public DetalleProductoViewModel(INavigationService navigationService)
     : base(navigationService)
 {
     ComprarProducto  = new DelegateCommand(EjecutarComprarProducto);
     FacturarProducto = new DelegateCommand(EjecutarFacturarProducto);
 }
 private void InitSaveCommand()
 {
     SaveCommand = new DelegateCommand <object>(OnSave);
     SaveCommand.ObservesCanExecute(() => IsNotBusy);
 }
 private void InitSelectTimeCommand()
 {
     SelectTimeCommand = new DelegateCommand <string>(OnSelectTime);
     SelectTimeCommand.ObservesCanExecute(() => IsNotBusy);
 }
Esempio n. 34
0
 public OrderedListViewModel()
 {
     dataService   = new OrderService();
     SearchCommand = new DelegateCommand(SearchOrderList);
 }
Esempio n. 35
0
 public HumanViewModel() : base()
 {
     this.PlayMarkCommand = new DelegateCommand <string>(this.PlayMark, this.CanPlayMark).ObservesProperty(() => this.Board);
     this.HideGameEndMessages();
 }
Esempio n. 36
0
        public SearchVM(MainVM mainVM)
        {
            this.mainVM = mainVM;
            model       = new SearchModel();

            resource = new ResourceDictionary
            {
                Source = new Uri("pack://application:,,,/CustomColors.xaml")
            };

            AdvancedSearchVM = new AdvancedSearchVM();

            AdvancedSearchVM.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == "StartSearch")
                {
                    Search.Execute();
                }
            };

            GotFocus = new DelegateCommand(() =>
            {
                var basePath = "pack://application:,,,/Resources/Icon";

                SearchImage = new BitmapImage(new Uri($"{basePath}/search_black.png", UriKind.Absolute));
                MenuImage   = new BitmapImage(new Uri($"{basePath}/menu_black.png", UriKind.Absolute));
                Background  = "#FFDDDDDD";
                Foreground  = "#FF666666";

                RaisePropertyChanged(nameof(SearchImage));
                RaisePropertyChanged(nameof(MenuImage));
                RaisePropertyChanged(nameof(Background));
                RaisePropertyChanged(nameof(Foreground));

                if (Query == defaultText)
                {
                    Query = "";
                    RaisePropertyChanged(nameof(Query));
                }
            });

            LostFocus = new DelegateCommand(() =>
            {
                var basePath = "pack://application:,,,/Resources/Icon";

                SearchImage = new BitmapImage(new Uri($"{basePath}/search_white.png", UriKind.Absolute));
                MenuImage   = new BitmapImage(new Uri($"{basePath}/menu_white.png", UriKind.Absolute));

                Background = resource["SearchBarColor"].ToString();
                Foreground = resource["DeactiveTextColor"].ToString();

                RaisePropertyChanged(nameof(SearchImage));
                RaisePropertyChanged(nameof(MenuImage));
                RaisePropertyChanged(nameof(Background));
                RaisePropertyChanged(nameof(Foreground));

                if (Query == "")
                {
                    Query = defaultText;
                    RaisePropertyChanged(nameof(Query));
                }
            });

            Search = new DelegateCommand(() =>
            {
                if (isLoading)
                {
                    return;
                }

                if (AdvancedSearchVM.SelectedCity != null)
                {
                    // city selected

                    RaisePropertyChanged("AdvancedSearchSelected");

                    isLoading = true;
                    RaisePropertyChanged(nameof(LoadingVis));
                }
                else
                {
                    if (!IsValidQuery())
                    {
                        return;
                    }

                    // search by query

                    RaisePropertyChanged("QueryValid");

                    isLoading = true;
                    RaisePropertyChanged(nameof(LoadingVis));
                }
            });

            Menu = new DelegateCommand(() =>
            {
                IsShowDetailSearch = !IsShowDetailSearch;

                RaisePropertyChanged(nameof(IsShowDetailSearch));
            });

            mainVM.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == "SearchLoadingCompleted")
                {
                    isLoading = false;
                    RaisePropertyChanged(nameof(LoadingVis));
                }
            };

            LostFocus.Execute();
        }
Esempio n. 37
0
 public RootPageViewModel()
 {
     FillUser();
     ImgArrow = ImageSource.FromFile("down.png");
     ShowHideCompaniesList = new DelegateCommand(ShowHideListOfCompanies);
 }
Esempio n. 38
0
        /// <summary>
        /// 생성자
        /// </summary>
        public WtlPipeListViewModel()
        {
            LoadedCommand = new DelegateCommand <object>(OnLoaded);
            SearchCommand = new DelegateCommand <object>(SearchAction);
            ResetCommand  = new DelegateCommand <object>(ResetAction);
            ExcelCmd      = new DelegateCommand <object>(ExcelDownAction);

            // 시설물 지도상 위치찾아가기
            cellPosCmd = new DelegateCommand <object>(delegate(object obj) {
                DataRowView row    = obj as DataRowView;
                string FTR_IDN     = row["FTR_IDN"].ToString();
                string FTR_CDE     = row["FTR_CDE"].ToString();
                string IS_GEOMETRY = row["IS_GEOMETRY"].ToString();

                //MessageBox.Show("지도상 위치찾아가기..FTR_IDN - " + FTR_IDN + ", FTR_CDE - " + FTR_CDE);

                if ("IS_GEOMETRY".Equals(IS_GEOMETRY))
                {
                    Messages.ShowInfoMsgBox("시설물 위치정보가 없습니다.");
                    return;
                }


                IRegionManager regionManager = FmsUtil.__regionManager;
                ViewsCollection views        = regionManager.Regions["ContentRegion"].ActiveViews as ViewsCollection;

                //MapMainViewMocel 인스턴스불러오기
                foreach (var v in views)
                {
                    MapArcObjView mapMainView = v as MapArcObjView;
                    MapArcObjViewModel vm     = mapMainView.DataContext as MapArcObjViewModel;

                    //Find 메소드수행
                    vm.findFtr(FTR_CDE, FTR_IDN);
                    break;
                }
            });



            // 조회데이터 초기화
            this.PagedCollection = new ObservableCollection <DataTable>();
            // 프로퍼티변경이벤트 처리핸들러 등록
            PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
            {
                switch (e.PropertyName)
                {
                case "PageIndex":
                    if (PageIndex < 0)     //초기이벤트는 걸른다
                    {
                        this.pageIndex = 0;
                    }
                    else
                    {
                        SearchAction(PageIndex);
                    }
                    break;

                default:
                    break;
                }
            };
        }
        public void Initialize()
        {
            MessageBus.Default.Subscribe("RebuildFirstBPV_Tibia", RebuildFirst);
            MessageBus.Default.Subscribe("RebuildLegSectionViewModel", Rebuild);


            SavePanelCommand = new DelegateCommand(() =>
            {
                var panel = CurrentPanelViewModel;
                if (!string.IsNullOrWhiteSpace(panel.Text1) || !string.IsNullOrWhiteSpace(panel.Text2))
                {
                    CurrentLegSide = CurrentLegSide;
                    if (IsStructEdited(CurrentPanelViewModel.LegPrt) && testOnUnique(CurrentPanelViewModel.LegPrt))
                    {
                        var newStruct    = GetPanelStructure();
                        newStruct.Custom = false;
                        Data.BPV_Tibia.Add((BPV_TibiaStructure)newStruct);
                        Data.Complete();
                        _lastSender.StructureSource.Add(newStruct);
                        _lastSender.SelectedValue         = newStruct;
                        CurrentPanelViewModel.PanelOpened = false;
                        handled = false;
                    }
                    if (!IsStructEdited(CurrentPanelViewModel.LegPrt))
                    {
                        CurrentPanelViewModel.PanelOpened = false;
                        handled = false;
                    }
                }
                else
                {
                    MessageBox.Show("Не все поля заполнены");
                }

                //_lastSender.DeleteCustom();
            });

            SaveCommand = new DelegateCommand(
                () =>
            {
                if (LegSections[0].SelectedValue != null)
                {
                    bool isValid = Validate();
                    if (isValid)
                    {
                        IsEmpty = false;

                        List <int?> ids = new List <int?>();

                        foreach (var leg in LegSections)
                        {
                            //никогда так не делайте
                            if (leg.IsVisible == Visibility.Visible && leg.ListNumber != 1 && leg.SelectedValue != null && leg.SelectedValue.Id != 0)
                            {
                                ids.Add(leg.SelectedValue.Id);
                            }
                        }

                        var combo = Data.BPV_TibiaCombos.FindCombo(LegSections[0].SelectedValue.Id, ids);
                        //если комбо не нашлось - значит оно кастомное, мы его запомним и отправим в базу на радость будущим пользователям
                        if (combo == null)
                        {
                            var newCombo = new BPV_TibiaCombo();

                            commentSave = Comment; for (int i = 0; i < LegSections.Count; i++)
                            {
                                var currentStructure = LegSections[i].SelectedValue;
                                //ничего не было выбрано
                                if (currentStructure == null)
                                {
                                    continue;
                                }
                                //добавляем структуры, которые встретились впервые, чтобы потом добавить комбо
                                if (currentStructure.Id == 0
                                    //потому что переход к след.разделу в комбо добавлять не надо, это излишняя информация
                                    && !currentStructure.ToNextPart)
                                {
                                    //currentStructure.Level = i + 1;
                                    //Data.BPV_Tibias.Add((BPV_TibiaStructure)currentStructure);
                                    //Data.Complete();
                                    //((BPV_TibiaEntry)LegSections[i].CurrentEntry).Structure = (BPV_TibiaStructure)currentStructure;
                                    //(LegSections[i].CurrentEntry).StructureID = currentStructure.Id;
                                    // Data.BPV_TibiaEntries.Add((BPV_TibiaEntry)LegSections[i].CurrentEntry);
                                    //Data.Complete();
                                    //if (i == 0) newCombo.IdStr1 = currentStructure.Id;
                                    ////там гда раньше был ноль теперь будет актуальный айдишник
                                    //else ids[i - 2] = currentStructure.Id;
                                }
                            }

                            newCombo.IdStr1 = LegSections[0].SelectedValue.Id;
                            //if()
                            //заполняем комбо
                            Data.BPV_TibiaCombos.AddCombo(newCombo, ids);
                            Data.Complete();
                            MessageBus.Default.Call("RebuildFirstBPV_Tibia", this, LegSections[0]);
                            MessageBus.Default.Call("RebuildLegSectionViewModel", this, LegSections[0]);
                            MessageBus.Default.Call("RebuildLegSectionViewModel", this, LegSections[1]);
                            MessageBus.Default.Call("RebuildLegSectionViewModel", this, LegSections[2]);
                            MessageBus.Default.Call("RebuildLegSectionViewModel", this, LegSections[3]);
                        }

                        MessageBus.Default.Call("LegDataSaved", this, this.GetType());
                        Controller.NavigateTo <ViewModelAddPhysical>();
                    }
                }
                else
                {
                    MessageBus.Default.Call("LegDataSaved", this, this.GetType());
                    Controller.NavigateTo <ViewModelAddPhysical>();
                }
            }
                );

            LevelCount = 4;
            _sections  = new ObservableCollection <LegSectionViewModel>();
            for (int i = 0; i < LevelCount; i++)
            {
                if (i != 0)
                {
                    LegSections.Add(new BPVTibiaSectionViewModel(Controller, _sections[i - 1], i + 1));
                }
                else
                {
                    LegSections.Add(new BPVTibiaSectionViewModel(Controller, null, i + 1));
                }
            }
            _title = "Большая подкожная вена на голени";
        }
Esempio n. 40
0
 public ViewImageViewModel()
 {
     CloseCommand = new DelegateCommand(Close);
 }
Esempio n. 41
0
 public MainWindowViewModel(IRegionManager regionManager)
 {
     _regionManager      = regionManager;
     NavigateCommandMain = new DelegateCommand <string>(Navigate);
 }
        public ProgramsPageViewModel(INavigationService navigationService, IPageDialogService dialog) : base(navigationService, dialog)
        {
            ProgramSelectedCommand = new DelegateCommand <Program>(ProcessProgramSelected);

            LoadSource();
        }
Esempio n. 43
0
 //************************************************************************************* command
 #region commandExecute
 void initDelegateCommand()
 {
     commandExecute = new DelegateCommand <Object>(execute);
 }
        /// <summary>
        /// Constructeur
        /// </summary>
        /// <param name="nav"></param>
        public PopupPageProduitViewModel(INavigation nav)
        {
            _Navigation = nav;

            _AjouterCommand = new DelegateCommand(ExecuteAjouterCommand);
        }
Esempio n. 45
0
 public TestViewModel()
 {
     RefreshCommand = new DelegateCommand(() => OnPropertyChanged("DataTable"));
 }
 public FilterDialogViewModel()
 {
     ApplyFilterCommand = new DelegateCommand(ApplyFilter);
 }
Esempio n. 47
0
 public DefaultViewModel()
 {
     DefaultCommand  = new DelegateCommand(Default);
     DefaultCommandT = new DelegateCommand <object>(DefaultT);
 }
Esempio n. 48
0
 public MainWindowViewModel(IRegionManager regionManager)
 {
     Title           = "MahApps Demo Programm";
     _regionManager  = regionManager;
     NavigateCommand = new DelegateCommand <string>(Navigate);
 }
 public LoginViewModel()
 {
     LoginCommand = new DelegateCommand(DoLogin);
 }
 public EditDeliveryInformationMV(ManagerDispatchMob managerDispatchMob, Shipping shipping)
 {
     this.managerDispatchMob = managerDispatchMob;
     Shipping = shipping;
     SavePikedUpCommand = new DelegateCommand(SaveDelivery);
 }
Esempio n. 51
0
 public SampleViewModel()
 {
     SampleCommand = new DelegateCommand(Sample);
     SampleCommandT = new DelegateCommand<object>(SampleT);
 }
 public ShellViewModel(INavigationService navigationServiceInstance)
 {
     _navigationService = navigationServiceInstance;
     ItemInvokedCommand = new DelegateCommand <NavigationViewItemInvokedEventArgs>(OnItemInvoked);
 }
Esempio n. 53
0
        public MainWindowVM()
        {
            _model.PropertyChanged += (sender, args) => { RaisePropertyChanged(args.PropertyName); };

            RefreshCitizenTable = new DelegateCommand(() =>
            {
                _model.RefreshTables();
            });

            AddCitizen = new DelegateCommand(() =>
            {
                AddCitizenWindow acw = new AddCitizenWindow();
                acw.ShowDialog();
                _model.RefreshTables();
            });

            EditCitizen = new DelegateCommand(() =>
            {
                EditCitizenWindow ecw = new EditCitizenWindow();
                ecw.DataContext       = SelectedCitizen;
                Citizen ctz           = SelectedCitizen;
                if (ecw.ShowDialog() == true)
                {
                    using (var db = new CitizenDbContext())
                    {
                        var citizen      = (from i in db.Citizens where i.Id == ctz.Id select i).First();
                        citizen.Name     = ctz.Name;
                        citizen.Surname  = ctz.Surname;
                        citizen.Patronym = ctz.Patronym;
                        db.SaveChanges();
                    }
                    _model.RefreshTables();
                }
            });

            DeleteCitizen = new DelegateCommand(() =>
            {
                using (var db = new CitizenDbContext())
                {
                    var citizen = (from i in db.Citizens where i.Id == SelectedCitizen.Id select i).First();
                    db.Citizens.Remove(citizen);
                    db.SaveChanges();
                }
                _model.RefreshTables();
            });

            AddPerson = new DelegateCommand(() =>
            {
                AddPersonWindow apw = new AddPersonWindow();
                apw.ShowDialog();
                _model.RefreshTables();
            });

            EditPerson = new DelegateCommand(() =>
            {
                EditPersonWindow epw = new EditPersonWindow();
                Person prs           = SelectedPerson;
                epw.DataContext      = prs;
                if (epw.ShowDialog() == true)
                {
                    using (var db = new CitizenDbContext())
                    {
                        var person       = (from i in db.Persons where i.Id == prs.Id select i).First();
                        person.Cypher    = prs.Cypher;
                        person.Inn       = prs.Inn;
                        person.Type      = prs.Type;
                        person.Date      = prs.Date;
                        person.CitizenId = prs.CitizenId;
                        db.SaveChanges();
                    }
                    _model.RefreshTables();
                }
            });

            DeletePerson = new DelegateCommand(() =>
            {
                using (var db = new CitizenDbContext())
                {
                    var person = (from i in db.Persons where i.Id == SelectedPerson.Id select i).First();
                    db.Persons.Remove(person);
                    db.SaveChanges();
                }
                _model.RefreshTables();
            });

            AddDocument = new DelegateCommand(() =>
            {
                AddDocumentWindow adw = new AddDocumentWindow();
                adw.ShowDialog();
                _model.RefreshTables();
            });

            EditDocument = new DelegateCommand(() =>
            {
                EditDocumentWindow edw = new EditDocumentWindow();
                Document doc           = SelectedDocument;
                edw.DataContext        = doc;
                if (edw.ShowDialog() == true)
                {
                    using (var db = new CitizenDbContext())
                    {
                        var document         = (from i in db.Documents where i.Id == doc.Id select i).First();
                        document.Name        = doc.Name;
                        document.Serial      = doc.Serial;
                        document.WhereIssued = doc.WhereIssued;
                        document.DateIssued  = doc.DateIssued;
                        document.CitizenId   = doc.CitizenId;
                        db.SaveChanges();
                    }
                    _model.RefreshTables();
                }
            });

            DeleteDocument = new DelegateCommand(() =>
            {
                using (var db = new CitizenDbContext())
                {
                    var document = (from i in db.Documents where i.Id == SelectedDocument.Id select i).First();
                    db.Documents.Remove(document);
                    db.SaveChanges();
                }
                _model.RefreshTables();
            });

            FindByCypher = new DelegateCommand(() =>
            {
                FindByCypherWindow fbc = new FindByCypherWindow();
                fbc.Show();
            });

            SaveToJSON = new DelegateCommand(() =>
            {
                _model.SaveToJSON(Citizens, Persons, Documents);
                MessageBox.Show("Все сохранено");
            });
        }
Esempio n. 54
0
 protected SettingsItemViewModel()
 {
     CloseHelpCommand = new DelegateCommand(o => CloseHelp());
 }
Esempio n. 55
0
 public PageGrafikViewModel()
 {
     Console.WriteLine("pobiera grafik");
     listaGrafik             = CzytajXML.ReadLG("grafik.xml");
     DodajUczestnikowCommand = new DelegateCommand(DodajUczestnikowdoGrafiku);
 }
 public DetailsTumblrTagSearchViewModel([Import("TumblrTagSearchView", typeof(IDetailsView))] IDetailsView view, IClipboardService clipboardService) : base(view)
 {
     this.clipboardService             = clipboardService;
     copyUrlCommand                    = new DelegateCommand(CopyUrlToClipboard);
     browseFileDownloadLocationCommand = new DelegateCommand(BrowseFileDownloadLocation);
 }
Esempio n. 57
0
 public IndexViewModel()
 {
     AddProductCommand = new DelegateCommand(executeAddProduct);
     EditProductCommand = new DelegateCommand(executeEditProduct);
     loadProducts();
 }
 public MainViewModel()
 {
     ChangeFileName = new DelegateCommand(OnChangeFileName);
 }
Esempio n. 59
0
 protected override void SetObservableProperties(DelegateCommand command)
 {
 }
 public UserAccountControlViewModel()
 {
     RestartElevatedCommand = new DelegateCommand(RestartElevated, CanRestartElevated);
     RaisePropertyChanged("IsProcessAdmin");
 }