Beispiel #1
0
 public void CloseDetached(string name)
 {
     foreach (IViewModel viewModel in DetachedItems.Where(v => v.Name == name).ToList())
     {
         CloseDetached(viewModel);
     }
 }
Beispiel #2
0
        public void PushDetached(Type viewModelType, Dictionary <string, object> data = null)
        {
            IViewModel viewModel = viewModelFactory.GetViewModel(viewModelType, data);

            viewModel.OnActivated();

            DetachedItems.Add(viewModel);
        }
Beispiel #3
0
        public void CloseAllDetached()
        {
            foreach (IViewModel viewModel in DetachedItems)
            {
                viewModel.Dispose();
            }

            DetachedItems.Clear();
        }
Beispiel #4
0
        public void ActivateDetached(string name)
        {
            foreach (IViewModel viewModel in DetachedItems.Where(v => v.Name == name))
            {
                viewModel.OnActivated();

                if (ActivateDetachedRequested != null)
                {
                    ActivateDetachedRequested(this, viewModel);
                }
            }
        }
Beispiel #5
0
        public void DetachActive()
        {
            IViewModel viewModel = Items.Last();

            Items.Remove(viewModel);

            if (Items.Any())
            {
                ActiveItem = Items.Last();
            }
            else
            {
                ActiveItem = null;
            }

            DetachedItems.Add(viewModel);
        }
Beispiel #6
0
 public bool DetachedExists(string name)
 {
     return(DetachedItems.Any(d => d.Name == name));
 }
Beispiel #7
0
 public void CloseDetached(IViewModel viewModel)
 {
     viewModel.Dispose();
     DetachedItems.Remove(viewModel);
 }