Exemplo n.º 1
0
        public static IDisposable PushFlyout(string flyoutName, object context)
        {
            if (flyoutName == null)
            {
                throw new ArgumentNullException(nameof(flyoutName));
            }

            var handle = new FlyoutHandle(flyoutName, context);

            if (TargetElement == null)
            {
                QueuedFlyouts.Enqueue(handle);
                return(handle);
            }

            var oldFlyout = CurrentFlyout;

            Flyouts.Add(oldFlyout);

            var flyout = GetFlyout(handle);

            SwapFlyouts(oldFlyout, flyout);

            return(handle);
        }
        public void AddOrUpdateFlyouts(IFlyoutBaseVm flyout)
        {
            var flyoutType = flyout.GetType();
            var oldFlyout  = Flyouts.FirstOrDefault(e => e.GetType().Name == flyoutType.Name);

            if (oldFlyout != null)
            {
                Flyouts.Remove(oldFlyout);
            }
            Flyouts.Add(BootStrapper.CreateFlyoutControl(flyout));
        }
Exemplo n.º 3
0
 public void DoToggleFlyout(FlyoutBaseViewModel flyout)
 {
     if(!Flyouts.Contains(flyout))
     {
         Flyouts.Add(flyout);
     }
     foreach(FlyoutBaseViewModel fbvw in Flyouts)
     {
         if (fbvw.Equals(flyout)) continue;
         fbvw.IsOpen = false;
     }
     flyout.IsOpen = !flyout.IsOpen;
 }