Ejemplo n.º 1
0
 public static void DeactivateWorkitemInRegion(this IRegionManagerExtension regionManager, IRegion region, IWorkItem workItem)
 {
     foreach (DependencyObject view in region.Views.OfType <DependencyObject>())
     {
         IWorkItem owner = WorkitemManager.GetOwner(view);
         if (workItem.Equals(owner))
         {
             region.Deactivate(view);
         }
     }
 }
Ejemplo n.º 2
0
 public static void ActivateWorkitemInRegion(this IRegionManagerExtension regionManager, IRegion region, IWorkItem workItem)
 {
     foreach (DependencyObject view in region.Views.OfType <DependencyObject>())
     {
         CommonServiceLocator.ServiceLocator.Current.GetInstance <ITaskManager>()
         .RunUIThread(() =>
         {
             IWorkItem owner = WorkitemManager.GetOwner(view);
             if (workItem.Equals(owner) && region.Views.Contains(view))
             {
                 region.Activate(view);
             }
         });
     }
 }