Exemple #1
0
        public StaffDetailsViewModel(IManageStaff managerStaff, AllCommandProxy commandProxy)
        {
            _manageStaff  = managerStaff;
            ChangeView    = new DelegateCommand(LodeViewfromModule);
            LoadChild     = new DelegateCommand(LoadChildCommand);
            ThumbnailPath = "WIN_20150804_135055.JPG";
            StaffList     = new ObservableCollection <Model.Models.Staff>(_manageStaff.GetStaffsTest());
            _CommandProxy = commandProxy;
            _CommandProxy.FireCompositeCommand.RegisterCommand(LoadChild);

            IUnityContainer unityContainer = ServiceLocator.Current.GetInstance <IUnityContainer>();
            var             regionManager  = unityContainer.Resolve <IRegionManager>();

            Microsoft.Practices.Prism.Regions.IRegion rgn = regionManager.Regions["MainRegion"];
            rgn.Context = Guid.NewGuid();;
        }
 public StaffViewModel(IManageStaff manageStaff, IEventAggregator eventAggregator, AllCommandProxy commandProxy)
 {
     regionManager = Microsoft.Practices.ServiceLocation.ServiceLocator.Current.GetInstance <Microsoft.Practices.Prism.Regions.IRegionManager>();
     _manageStaff  = manageStaff;
     SubmitCommand = new DelegateCommand <object>(OnSubmit);
     LoadWindow    = new DelegateCommand(LoadWindowCommand);
     this.confirmExitInteractionRequest = new InteractionRequest <Confirmation>();
     _eventAggregator   = eventAggregator;
     LoadAccountCommand = new DelegateCommand <object>(LoadAccount);
     _CommandProxy      = commandProxy;
     _CommandProxy.FireCompositeCommand.RegisterCommand(LoadWindow);
     StartProgress  = new DelegateCommand(StartProgressComand);
     StudentCommand = new DelegateCommand(GetStudent);
     AsyncCommand   = new DelegateCommand(AsyncCall);
     //add RoutedEventArgs remove TriggerParameterPath
     ButtonClickCommand = new DelegateCommand <RoutedEvent>(ClickCommand);
     ////var staffobj = RegionManager.Regions["MainRegion"].Context;
     ////int staffIdId = (int)RegionContext.GetObservableContext(StaffView).Value;
     ////RegionManager.Regions["MainRegion"].Context = regionManager.Regions["MainRegion"].Context;
 }