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

            viewModel.OnActivated();

            DetachedItems.Add(viewModel);
        }
Пример #3
0
        public void CloseAllDetached()
        {
            foreach (IViewModel viewModel in DetachedItems)
            {
                viewModel.Dispose();
            }

            DetachedItems.Clear();
        }
Пример #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);
                }
            }
        }
Пример #5
0
        public void DetachActive()
        {
            IViewModel viewModel = Items.Last();

            Items.Remove(viewModel);

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

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