Exemplo n.º 1
0
        public override PopOperation AsSpecificPopOperation(InnerStack <TViewModel> child)
        {
            if (child is FragmentInnerStack <TViewModel> fragmentInnerStack)
            {
                FragmentStack.RemoveAt(FragmentStack.Count - 1);
                return(new FragmentPopOperation <TViewModel>(this)
                {
                    FragmentStacksToPop =
                    {
                        fragmentInnerStack
                    }
                });
            }

            throw new InvalidOperationException("Specific pop operation on unsupported child type");
        }
Exemplo n.º 2
0
 public override PopOperation AsSpecificPopOperation(InnerStack <TViewModel> child)
 {
     throw new InvalidOperationException("Operation not supported, fragment can not have children");
 }
Exemplo n.º 3
0
        internal static ActivityInnerStack <TViewModel> GetActivityInnerStack <TViewModel>(this InnerStack <TViewModel> item) where TViewModel : IViewModel
        {
            switch (item)
            {
            case null:
                return(null);

            case ActivityInnerStack <TViewModel> res:
                return(res);

            case DialogFragmentInnerStack <TViewModel> dialogFragmentInnerStack:
                return(dialogFragmentInnerStack.FragmentHost);

            case FragmentInnerStack <TViewModel> fragmentInnerStack:
                return(fragmentInnerStack.FragmentHost);

            default:
                throw new InvalidOperationException($"Unsupported inner stack type : {item.GetType().Name}");
            }
        }
Exemplo n.º 4
0
 public abstract PopOperation AsSpecificPopOperation(InnerStack <TViewModel> child);