public SingleConceptView(SingleConceptViewModel viewModel) : this() { DataContext = viewModel; RegionContext.GetObservableContext(this).PropertyChanged += (s, e) => { }; }
public TerminologyVocabularyView(TerminologyVocabularyViewModel viewModel) : this() { DataContext = viewModel; RegionContext.GetObservableContext(this).PropertyChanged += (s, e) => { }; }
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; }
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; }
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(); }
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; }
public UserDetailsView(UserDetailsViewModel viewModel) { InitializeComponent(); this.DataContext = viewModel; RegionContext.GetObservableContext(this).PropertyChanged += (s, e) => viewModel.CurrentUser = RegionContext.GetObservableContext(this).Value as User; }
public PolicySearchResultsView() { this.InitializeComponent(); RegionContext.GetObservableContext(this).PropertyChanged += (s, e) => this.ViewModel.PolicySearchResult = RegionContext.GetObservableContext(this).Value as PolicySearchResult; }
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; }
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; }
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; } } }
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; }; }
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; } } }
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; } } }
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; }; }
public DetailsView() { InitializeComponent(); RegionContext.GetObservableContext(this).PropertyChanged += (s, e) => { var context = (ObservableObject <object>)s; var selectedMember = (TeamMember)context.Value; (DataContext as DetailsViewModel).Member = selectedMember; }; }
private void OnLoaded(RoutedEventArgs e) { var designerControl = e.OriginalSource as DesignerControl; var selectInfo = (TabSelectInfo)(RegionContext.GetObservableContext(designerControl).Value); if (selectInfo != null) { _fileGuid = selectInfo.Guid; } }
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; } } }
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; }
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; } } }
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; } } }
public DTSSearchView(DTSSearchViewModel dtsSearchViewModel) : this() { DataContext = dtsSearchViewModel; var regionContext = RegionContext.GetObservableContext(this); regionContext.PropertyChanged += (object source, PropertyChangedEventArgs args) => { dtsSearchViewModel.SearchCommunicater = ( SearchCommunicater )regionContext.Value; }; }
public LookupQuickPickerView(LookupQuickPickerViewModel lookupQuickPickerViewModel) : this() { DataContext = lookupQuickPickerViewModel; var regionContext = RegionContext.GetObservableContext(this); regionContext.PropertyChanged += (source, args) => { lookupQuickPickerViewModel.SearchCommunicater = ( LookupQuickPickerCommunicator )regionContext.Value; }; }
public QuotationDetailMenuView() { InitializeComponent(); RegionContext.GetObservableContext(this).PropertyChanged += (s, e) => ViewModel.MenuContext = (int)RegionContext.GetObservableContext(this).Value; id = Guid.NewGuid().ToString(); }