예제 #1
0
        public SingleConceptView(SingleConceptViewModel viewModel)
            : this()
        {
            DataContext = viewModel;

            RegionContext.GetObservableContext(this).PropertyChanged += (s, e) => { };
        }
예제 #2
0
        public TerminologyVocabularyView(TerminologyVocabularyViewModel viewModel)
            : this()
        {
            DataContext = viewModel;

            RegionContext.GetObservableContext(this).PropertyChanged += (s, e) => { };
        }
예제 #3
0
        public ModuleBWorkspace(IStringCopyService stringCopyService)/*IEventAggregator eventAggregator*/
        {
            // código exclusivo para la recepción de un string a traves de un agregador de eventos.
            var eventAggregator = ServiceLocator.Current.GetInstance <IEventAggregator>();
            // eventAggregator.GetEvent<MyCopyDataAddedEvent>().Subscribe(OnCopyDataReceived, ThreadOption.UIThread);

            var evento = eventAggregator.GetEvent <MyCopyDataAddedEvent>();

            if (subscriptionToken != null)
            {
                evento.Unsubscribe(subscriptionToken);
            }
            subscriptionToken = evento.Subscribe(OnCopyDataReceived, ThreadOption.UIThread, true);

            InitializeComponent();

            //código exclusivo para recepción de un string a traves de un servicio compartido
            stringCopyService.CopyStringEvent += TheStringCopyService_CopyStringEvent;

            //código exclusivo para la recepción de datos atraves del regioncontext.
            // get the region context from the current view
            // (which is plugged into the region)
            Microsoft.Practices.Prism.ObservableObject <object> regionContexto =
                RegionContext.GetObservableContext(this);

            // set an event handler to run when PropertyChanged event is fired
            regionContexto.PropertyChanged += regionContext_PropertyChanged;
        }
예제 #4
0
 public PersonDetail()
 {
     InitializeComponent();
     #region RegionContext-使用RegionContext将数据传递给嵌套区域
     RegionContext.GetObservableContext(this).PropertyChanged += PersonDetail_PropertyChanged;
     #endregion
 }
        public SalesView(SalesVM salesVM)
        {
            InitializeComponent();
            DataContext        = salesVM;
            salesvm            = salesVM;
            SalesPad.SalesVM   = salesVM;
            SalesPad.SalesView = this;



            ((INotifyCollectionChanged)SalesLst.Items).CollectionChanged += SalesView_CollectionChanged;


            SalesLst.SelectionChanged += SalesLst_SelectionChanged;
            SalesLst.LayoutUpdated    += SalesLst_LayoutUpdated;

            HideReceipt();
            ShowTransaction();

            SetUpSalesPad();
            ObservableObject <object> viewRegionContext =
                RegionContext.GetObservableContext(this);

            viewRegionContext.PropertyChanged += this.ViewRegionContext_OnPropertyChangedEvent;
        }
예제 #6
0
        public static void UseRegionContext <TViewModel, TRegionContext>(this UserControl userControl,
                                                                         Action <TViewModel, TRegionContext> initializeAction)
        {
            var regionContext = RegionContext.GetObservableContext(userControl);

            void UpdateRegionContext()
            {
                if (regionContext.Value == null)
                {
                    return;
                }
                if (userControl.DataContext == null)
                {
                    return;
                }

                var context   = (TRegionContext)regionContext.Value;
                var viewModel = (TViewModel)userControl.DataContext;

                initializeAction(viewModel, context);
            }

            regionContext.PropertyChanged  += (_, __) => UpdateRegionContext();
            userControl.DataContextChanged += (_, __) => UpdateRegionContext();
        }
예제 #7
0
 private static void OnRegionContextChanged(BindableObject bindable, object oldValue, object newValue)
 {
     if (oldValue != newValue && bindable is VisualElement view)
     {
         RegionContext.GetObservableContext(view).Value = newValue;
     }
 }
        public StaffView(StaffViewModel viewModel)
        {
            InitializeComponent();
            DataContext = viewModel;
            var regionContext = RegionContext.GetObservableContext(this);

            regionContext.PropertyChanged += RegionContextOnPropertyChanged;
        }
예제 #9
0
 public UserDetailsView(UserDetailsViewModel viewModel)
 {
     InitializeComponent();
     this.DataContext = viewModel;
     RegionContext.GetObservableContext(this).PropertyChanged +=
         (s, e) => viewModel.CurrentUser =
             RegionContext.GetObservableContext(this).Value as User;
 }
예제 #10
0
        public PolicySearchResultsView()
        {
            this.InitializeComponent();

            RegionContext.GetObservableContext(this).PropertyChanged +=
                (s, e) =>
                this.ViewModel.PolicySearchResult = RegionContext.GetObservableContext(this).Value as PolicySearchResult;
        }
예제 #11
0
        void SendParamRegionContext_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            // get the region context from the region defining control
            Microsoft.Practices.Prism.ObservableObject <object> regionContext =
                RegionContext.GetObservableContext(WorkspaceRegion);

            // set the region context's value to the string we want to copy
            regionContext.Value = ShellParameter1.Text;
        }
예제 #12
0
        public PolicyDetailMenuView()
        {
            InitializeComponent();

            RegionContext.GetObservableContext(this).PropertyChanged += (s, e)
                                                                        =>
                                                                        ViewModel.MenuContext =
                (int)RegionContext.GetObservableContext(this).Value;
        }
        public EmployeeDetailsView(EmployeeDetailsViewModel employeeDetailsViewModel)
        {
            InitializeComponent();

            DataContext = employeeDetailsViewModel;

            RegionContext.GetObservableContext(this).PropertyChanged += (sender, e) =>
                                                                        employeeDetailsViewModel.CurrentEmployee = RegionContext.GetObservableContext(this).Value as Employee;
        }
예제 #14
0
        public CreateBillingOfficeButtonView(CreateBillingOfficeButtonViewModel createBillingOfficeButtonViewModel)
            : this()
        {
            DataContext = createBillingOfficeButtonViewModel;

            var regionContext = RegionContext.GetObservableContext(this);

            regionContext.PropertyChanged += (s, e) => { createBillingOfficeButtonViewModel.AgencyKey = ( long )regionContext.Value; };
        }
 private void DetachNotifyChangeEvent(IEnumerable views)
 {
     foreach (var view in views)
     {
         if (view is VisualElement visualElement)
         {
             ObservableObject <object> viewRegionContext = RegionContext.GetObservableContext(visualElement);
             viewRegionContext.PropertyChanged -= ViewRegionContext_OnPropertyChangedEvent;
         }
     }
 }
예제 #16
0
        public PatientsListView(IPatientsListViewModel viewModel) : base(viewModel)
        {
            InitializeComponent();

            RegionContext.GetObservableContext(this).PropertyChanged += (s, e) =>
            {
                var context       = (ObservableObject <object>)s;
                var moduleContext = (PatientModuleRegionContext)context.Value;
                (ViewModel as IPatientsListViewModel).ModuleRegionContext = moduleContext;
            };
        }
예제 #17
0
 static void SetContextToViews(IEnumerable views, object context)
 {
     foreach (var view in views)
     {
         if (view is DependencyObject dependencyObjectView)
         {
             var contextWrapper = RegionContext.GetObservableContext(dependencyObjectView);
             contextWrapper.Value = context;
         }
     }
 }
예제 #18
0
 void DetachNotifyChangeEvent(IEnumerable views)
 {
     foreach (var view in views)
     {
         if (view is DependencyObject dependencyObject)
         {
             var viewRegionContext = RegionContext.GetObservableContext(dependencyObject);
             viewRegionContext.PropertyChanged -= this.ViewRegionContext_OnPropertyChangedEvent;
         }
     }
 }
 private static void SetContextToViews(IEnumerable views, object context)
 {
     foreach (var view in views)
     {
         if (view is VisualElement visualElement)
         {
             ObservableObject <object> contextWrapper = RegionContext.GetObservableContext(visualElement);
             contextWrapper.Value = context;
         }
     }
 }
예제 #20
0
        public PersonDetailsView(IPersonDetailsViewViewModel viewModel) : base(viewModel)
        {
            InitializeComponent();

            RegionContext.GetObservableContext(this).PropertyChanged += (s, e) =>
            {
                var context        = (ObservableObject <object>)s;
                var selectedPerson = (Person)context.Value;
                (ViewModel as IPersonDetailsViewViewModel).SelectedPerson = selectedPerson;
            };
        }
예제 #21
0
        public DetailsView()
        {
            InitializeComponent();

            RegionContext.GetObservableContext(this).PropertyChanged += (s, e) =>
            {
                var context        = (ObservableObject <object>)s;
                var selectedMember = (TeamMember)context.Value;
                (DataContext as DetailsViewModel).Member = selectedMember;
            };
        }
예제 #22
0
        private void OnLoaded(RoutedEventArgs e)
        {
            var designerControl = e.OriginalSource as DesignerControl;

            var selectInfo = (TabSelectInfo)(RegionContext.GetObservableContext(designerControl).Value);

            if (selectInfo != null)
            {
                _fileGuid = selectInfo.Guid;
            }
        }
예제 #23
0
 private void DetachNotifyChangeEvent(IEnumerable views)
 {
     foreach (var view in views)
     {
         var dependencyObject = view as DependencyObject;
         if (dependencyObject != null)
         {
             ObservableObject <object> viewRegionContext = RegionContext.GetObservableContext(dependencyObject);
             viewRegionContext.PropertyChanged -= this.ViewRegionContext_OnPropertyChangedEvent;
         }
     }
 }
예제 #24
0
        public TransactionView(TransactionVM transactionVM)
        {
            InitializeComponent();

            // Setup the view model context
            DataContext = transactionVM;
            tvm         = transactionVM;
            ObservableObject <object> viewRegionContext =
                RegionContext.GetObservableContext(this);

            viewRegionContext.PropertyChanged += this.ViewRegionContext_OnPropertyChangedEvent;
        }
예제 #25
0
 private static void SetContextToViews(IEnumerable views, object context)
 {
     foreach (var view in views)
     {
         DependencyObject dependencyObjectView = view as DependencyObject;
         if (dependencyObjectView != null)
         {
             ObservableObject <object> contextWrapper = RegionContext.GetObservableContext(dependencyObjectView);
             contextWrapper.Value = context;
         }
     }
 }
예제 #26
0
        public PayorCacheQuickPickerView(PayorCacheQuickPickerViewModel payorCacheQuickPickerViewModel)
            : this()
        {
            DataContext = payorCacheQuickPickerViewModel;
            var regionContext = RegionContext.GetObservableContext(this);

            regionContext.PropertyChanged += (source, args) =>
            {
                payorCacheQuickPickerViewModel.SearchCommunicater =
                    ( QuickPickerCommunicator )regionContext.Value;
            };
        }
 private void AttachNotifyChangeEvent(IEnumerable views)
 {
     foreach (var view in views)
     {
         var AvaloniaObject = view as AvaloniaObject;
         if (AvaloniaObject != null)
         {
             ObservableObject <object> viewRegionContext = RegionContext.GetObservableContext(AvaloniaObject);
             viewRegionContext.PropertyChanged += this.ViewRegionContext_OnPropertyChangedEvent;
         }
     }
 }
예제 #28
0
        public DTSSearchView(DTSSearchViewModel dtsSearchViewModel)
            : this()
        {
            DataContext = dtsSearchViewModel;
            var regionContext = RegionContext.GetObservableContext(this);

            regionContext.PropertyChanged += (object source, PropertyChangedEventArgs args) =>
            {
                dtsSearchViewModel.SearchCommunicater =
                    ( SearchCommunicater )regionContext.Value;
            };
        }
예제 #29
0
        public LookupQuickPickerView(LookupQuickPickerViewModel lookupQuickPickerViewModel)
            : this()
        {
            DataContext = lookupQuickPickerViewModel;
            var regionContext = RegionContext.GetObservableContext(this);

            regionContext.PropertyChanged += (source, args) =>
            {
                lookupQuickPickerViewModel.SearchCommunicater =
                    ( LookupQuickPickerCommunicator )regionContext.Value;
            };
        }
예제 #30
0
        public QuotationDetailMenuView()
        {
            InitializeComponent();

            RegionContext.GetObservableContext(this).PropertyChanged += (s, e)
                                                                        =>
                                                                        ViewModel.MenuContext =

                (int)RegionContext.GetObservableContext(this).Value;

            id = Guid.NewGuid().ToString();
        }