Ejemplo n.º 1
0
 private void ActivateTab(SelectionChangedEventArgs e)
 {
     if (e.AddedItems != null)
     {
         foreach (TabItem tabItem in e.AddedItems)
         {
             if (tabItem != null)
             {
                 IWakable wakable = tabItem.Content as IWakable;
                 if (wakable != null)
                 {
                     wakable.WakeUp();
                 }
             }
         }
     }
     if (e.RemovedItems != null)
     {
         foreach (TabItem tabItem in e.RemovedItems)
         {
             if (tabItem != null)
             {
                 IWakable wakable = tabItem.Content as IWakable;
                 if (wakable != null)
                 {
                     wakable.Sleep();
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
        public void WakeUp()
        {
            IWakable wakable = tabControl.SelectedContent as IWakable;

            if (wakable != null)
            {
                wakable.WakeUp();
            }
        }