private void ViewAwareStatusService_ViewLoaded() { if (!Designer.IsInDesignMode) { var view = viewAwareStatusService.View; IWorkSpaceAware workspaceData = (IWorkSpaceAware)view; } }
private void ViewAwareStatusService_ViewLoaded() { if (!Designer.IsInDesignMode) { var view = viewAwareStatusService.View; IWorkSpaceAware workspaceData = (IWorkSpaceAware)view; SQLScript = (string)workspaceData.WorkSpaceContextualData.DataValue; } }
private void ViewAwareStatusService_ViewLoaded() { if (!Designer.IsInDesignMode) { var view = viewAwareStatusService.View; IWorkSpaceAware workspaceData = (IWorkSpaceAware)view; DirectoryName = (String)workspaceData.WorkSpaceContextualData.DataValue; } LoadImages(DirectoryName); }
private void ViewAwareStatusService_ViewLoaded() { if (!Designer.IsInDesignMode) { var view = viewAwareStatusService.View; IWorkSpaceAware workspaceData = (IWorkSpaceAware)view; SelectedTrigger = (Trigger)workspaceData.WorkSpaceContextualData.DataValue; _backgroundWorker.RunWorkerAsync(); } }
private void ViewAwareStatusService_ViewLoaded() { if (!Designer.IsInDesignMode) { var view = viewAwareStatusService.View; IWorkSpaceAware workspaceData = (IWorkSpaceAware)view; ViewsLocal = workspaceData.WorkSpaceContextualData.DataValue as ObservableCollection <WorkspaceData>; MainWindowViewModel vm = workspaceData.WorkSpaceContextualData.ViewModelInstance as MainWindowViewModel; if (vm != null) { SelectedDB = vm.SelectedDB; } } }
/// <summary> /// Handles changes to the ViewCreator property. /// </summary> private static void OnViewCreatorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ItemsControl itemsControl = null; if (e.NewValue == null) { itemsControl = TreeHelper.TryFindParent <ItemsControl>(d); bool shouldHideHostWhenNoItems = (bool)itemsControl.GetValue(NavProps.ShouldHideHostWhenNoItemsProperty); if (shouldHideHostWhenNoItems) { if (itemsControl != null) { itemsControl.Visibility = Visibility.Collapsed; } } return; } Border contPresenter = (Border)d; WorkspaceData viewNavData = (WorkspaceData)e.NewValue; var theView = ViewResolver.CreateView(viewNavData.ViewLookupKey); viewNavData.ViewModelInstance = ((FrameworkElement)theView).DataContext; IWorkSpaceAware dataAwareView = theView as IWorkSpaceAware; if (dataAwareView == null) { throw new InvalidOperationException( "NavProps attached property is only designed to work with Views that implement the IWorkSpaceAware interface"); } else { dataAwareView.WorkSpaceContextualData = viewNavData; contPresenter.Child = (UIElement)dataAwareView; } itemsControl = TreeHelper.TryFindParent <ItemsControl>(d); if (itemsControl != null) { itemsControl.Visibility = Visibility.Visible; } }