Пример #1
0
 /// <summary>
 ///     Close and Deactivate this View
 /// </summary>
 public virtual void Close()
 {
     IsActive = false;
     RegionNavigationService.Close(this);
     //if (!RegionInfo.IsEmpty() && RegionInfo.RegionName.IsNotNullOrEmpty())
     //    RegionManager?.Regions[RegionInfo.RegionName].Deactivate(RegionInfo.View);
 }
Пример #2
0
        //private void LoadView(object viewType)
        //{
        //    //If the view already existed then select the view.
        //    var info = ActivatedObjects.TryGet(viewType);
        //    if (info.Value != null)
        //    {
        //        SelectedElement = info.Value;
        //        return;
        //    }

        //    if (info.Key.IsNullOrEmpty()) return;

        //    var view = Container.GetInstance<object>(info.Key) as FrameworkElement;
        //    if (view == null) return;

        //    //Add and selected the view.
        //    ActivatedObjects.Add(view);
        //}

        private void CloseView(object viewObj)
        {
            var view = viewObj as FrameworkElement;

            if (view == null)
            {
                return;
            }
            RegionNavigationService.Close(view);

            //Get current index of view and selected status
            //var isSelected = ReferenceEquals(SelectedElement, view);

            //ActivatedObjects.Remove(view);

            //Select the neighbor view based on index and status if available.
            //if (ActivatedObjects.Count <= 0 || !isSelected) return;

            //SelectedElement = ActivatedObjects.LastOrDefault();
        }