public void CloseDetached(string name) { foreach (IViewModel viewModel in DetachedItems.Where(v => v.Name == name).ToList()) { CloseDetached(viewModel); } }
public void PushDetached(Type viewModelType, Dictionary <string, object> data = null) { IViewModel viewModel = viewModelFactory.GetViewModel(viewModelType, data); viewModel.OnActivated(); DetachedItems.Add(viewModel); }
public void CloseAllDetached() { foreach (IViewModel viewModel in DetachedItems) { viewModel.Dispose(); } DetachedItems.Clear(); }
public void ActivateDetached(string name) { foreach (IViewModel viewModel in DetachedItems.Where(v => v.Name == name)) { viewModel.OnActivated(); if (ActivateDetachedRequested != null) { ActivateDetachedRequested(this, viewModel); } } }
public void DetachActive() { IViewModel viewModel = Items.Last(); Items.Remove(viewModel); if (Items.Any()) { ActiveItem = Items.Last(); } else { ActiveItem = null; } DetachedItems.Add(viewModel); }
public bool DetachedExists(string name) { return(DetachedItems.Any(d => d.Name == name)); }
public void CloseDetached(IViewModel viewModel) { viewModel.Dispose(); DetachedItems.Remove(viewModel); }