public MonitoringInstancesViewModelFactory(IViewModelFactory innerViewModelFactory, TimeSpan time)
        {
            if (innerViewModelFactory == null)
            {
                throw new ArgumentNullException("innerViewModelFactory");
            }
            _innerViewModelFactory = innerViewModelFactory;

            _instanceMonitor         = InstanceTracker.MonitorByType <IViewModel>(time);
            _instanceMonitor.Update += _instanceMonitor_Update;
        }
 public void ReleaseViewModel(IViewModel viewModel)
 {
     _innerViewModelFactory.ReleaseViewModel(viewModel);
     InstanceTracker.Track(viewModel);
 }
Exemple #3
0
 public static IInstanceMonitor MonitorByType <T>(TimeSpan time)
 {
     return(new InstanceMonitor(() => InstanceTracker.GetAllInstancesByType <T>(), time));
 }
Exemple #4
0
 public static IInstanceMonitor MonitorByTag(string tag, TimeSpan time)
 {
     return(new InstanceMonitor(() => InstanceTracker.GetAllInstancesByTag(tag), time));
 }