void OnNotifyDataRecieved(WorkspaceData workspaceToRemove)
 {
     if (this.Views.Contains(workspaceToRemove))
     {
         this.Views.Remove(workspaceToRemove);
     }
 }
 public void SetActiveWorkspace(WorkspaceData viewnav)
 {
     if (collectionView != null)
     {
         collectionView.MoveCurrentTo(viewnav);
     }
 }
 void OnNotifyDataRecieved(WorkspaceData workspaceToRemove)
 {
     if (this.Views.Contains(workspaceToRemove))
     {
         this.Views.Remove(workspaceToRemove);
     }
 }
Beispiel #4
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;
            }
        }
 public void SetActiveWorkspace(WorkspaceData viewnav)
 {
     if (collectionView != null)
         collectionView.MoveCurrentTo(viewnav);
 }
Beispiel #6
0
 /// <summary>
 /// Sets the ViewCreator property.
 /// </summary>
 public static void SetViewCreator(DependencyObject d, WorkspaceData value)
 {
     d.SetValue(ViewCreatorProperty, value);
 }
Beispiel #7
0
 /// <summary>
 /// Sets the ViewCreator property.  
 /// </summary>
 public static void SetViewCreator(DependencyObject d, WorkspaceData value)
 {
     d.SetValue(ViewCreatorProperty, value);
 }