private void OnViewModelDeactivated(object sender, Caliburn.Micro.DeactivationEventArgs e)
 {
     if (e.WasClosed)
     {
         _viewModel.Deactivated -= OnViewModelDeactivated;
         _viewModel              = null;
     }
 }
Exemplo n.º 2
0
 //Juries TODO improve (remove typing tied to contentfactory)
 private void ViewModelDeactivated(object sender, Caliburn.Micro.DeactivationEventArgs e)
 {
     if (e.WasClosed)
     {
         var container = _target as TabGroupPane;
         if (container != null)
         {
             WorkSurfaceContextViewModel model = sender as WorkSurfaceContextViewModel;
             if (model != null)
             {
                 var vm       = model.WorkSurfaceViewModel;
                 var toRemove = container.Items.Cast <ContentPane>().ToList()
                                .FirstOrDefault(p => p.Content != null && p.Content == vm);
                 RemovePane(toRemove);
                 if (toRemove != null &&
                     Application.Current != null &&
                     !Application.Current.Dispatcher.HasShutdownStarted)
                 {
                     container.Items.Remove(toRemove);
                 }
             }
         }
     }
 }
Exemplo n.º 3
0
 void _addCriteria_Deactivated(object sender, Caliburn.Micro.DeactivationEventArgs e)
 {
     ReloadList();
 }