Exemple #1
0
 public static ValueTask <string> InputType1Async(this IPopupNavigator popupNavigator, string title, string value, int maxLength)
 {
     return(FocusHelper.WithRestoreFocus(() =>
                                         popupNavigator.PopupAsync <TextInputParameter, string>(
                                             DialogId.PopupType1,
                                             new TextInputParameter(title, value, maxLength))));
 }
 public PopupMenuViewModel(
     ApplicationState applicationState,
     IPopupNavigator popupNavigator)
     : base(applicationState)
 {
     Popup1Command = MakeAsyncCommand(async() =>
     {
         value = await popupNavigator.InputType1Async("Input", value, 8);
     });
 }
Exemple #3
0
        public MenuViewModel(
            ApplicationState applicationState,
            IDialogs dialogs,
            IPopupNavigator popupNavigator)
            : base(applicationState)
        {
            this.dialogs        = dialogs;
            this.popupNavigator = popupNavigator;

            ForwardCommand = MakeAsyncCommand <ViewId>(x => Navigator.ForwardAsync(x));
            SharedCommand  = MakeAsyncCommand <ViewId>(x => Navigator.ForwardAsync(ViewId.SharedInput, Parameters.MakeNextViewId(x)));
            ModalCommand   = MakeAsyncCommand(ShowModal);
        }
        //  .ctor
        // ////////////////////////////////////////////////////////////////////

        internal TourRun(Tour tour, IVisualElementManager visualElementManager, IWindowManager windowManager, IPopupNavigator popupNavigator)
        {
            if (tour == null)
            {
                throw new ArgumentNullException("tour");
            }
            if (tour.Steps == null)
            {
                throw new ArgumentNullException("tour.Steps");
            }
            if (tour.Steps.Length == 0)
            {
                throw new ArgumentException("Unable to start tour without steps");
            }
            if (tour.Steps.Any(s => s == null))
            {
                throw new ArgumentException("Steps must not be null");
            }
            if (tour.Steps.Any(s => s.ElementID == null))
            {
                throw new ArgumentException("Step.ElementID must not be null");
            }
            if (visualElementManager == null)
            {
                throw new ArgumentNullException("visualElementManager");
            }
            if (windowManager == null)
            {
                throw new ArgumentNullException("windowManager");
            }
            if (popupNavigator == null)
            {
                throw new ArgumentNullException("popupNavigator");
            }

            myTour = tour;
            myVisualElementManager = visualElementManager;
            myWindowManager        = windowManager;
            myPopupNavigator       = popupNavigator;

            windowManager.WindowActivated   += WindowActivated;
            windowManager.WindowDeactivated += WindowDeactivated;
            myCurrentWindowID = windowManager.GetActiveWindowID();
            InitStepNodes();
        }
Exemple #5
0
 static TourHelper()
 {
     thePopupNavigator       = new PupupNavigator();
     theWindowManager        = new WindowManager(thePopupNavigator);
     theVisualElementManager = new VisualElementManager(theWindowManager);
 }
Exemple #6
0
 public WindowManager(IPopupNavigator popupNavigator)
 {
     myPopupNavigator = popupNavigator;
 }
 public static ValueTask <string> InputNumberAsync(this IPopupNavigator popupNavigator, string value, int maxLength)
 {
     return(popupNavigator.PopupAsync <NumberInputParameter, string>(
                DialogId.InputNumber,
                new NumberInputParameter(value, maxLength, 0, false)));
 }