コード例 #1
0
 private void ViewAwareStatusService_ViewLoaded()
 {
     if (!Designer.IsInDesignMode)
     {
         var             view          = viewAwareStatusService.View;
         IWorkSpaceAware workspaceData = (IWorkSpaceAware)view;
     }
 }
コード例 #2
0
 private void ViewAwareStatusService_ViewLoaded()
 {
     if (!Designer.IsInDesignMode)
     {
         var view = viewAwareStatusService.View;
         IWorkSpaceAware workspaceData = (IWorkSpaceAware)view;
         SQLScript = (string)workspaceData.WorkSpaceContextualData.DataValue;
     }
 }
コード例 #3
0
 private void ViewAwareStatusService_ViewLoaded()
 {
     if (!Designer.IsInDesignMode)
     {
         var             view          = viewAwareStatusService.View;
         IWorkSpaceAware workspaceData = (IWorkSpaceAware)view;
         DirectoryName = (String)workspaceData.WorkSpaceContextualData.DataValue;
     }
     LoadImages(DirectoryName);
 }
コード例 #4
0
        private void ViewAwareStatusService_ViewLoaded()
        {
            if (!Designer.IsInDesignMode)
            {
                var             view          = viewAwareStatusService.View;
                IWorkSpaceAware workspaceData = (IWorkSpaceAware)view;
                SelectedTrigger = (Trigger)workspaceData.WorkSpaceContextualData.DataValue;

                _backgroundWorker.RunWorkerAsync();
            }
        }
コード例 #5
0
 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;
         }
     }
 }
コード例 #6
0
        /// <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;
            }
        }