Esempio n. 1
0
 protected DialogToken([NotNull] DialogBuilder builder, DialogToken inputToken, [NotNull] string tokenName)
 {
     _builder    = builder;
     InputToken  = inputToken;
     TokenName   = tokenName;
     OutputToken = TokenName;
     Builder.AddToken(this);
 }
Esempio n. 2
0
 private void AddToken([NotNull] DialogToken token)
 {
     if (token is IInputDialogToken)
     {
         return;
     }
     if (_tokens.Exists(t => token.TokenName == t?.TokenName))
     {
         throw new ApplicationException("Token with same name already defined!");
     }
     _tokens.Add(token);
 }
Esempio n. 3
0
        public static async Task <RoutePickerDialogResult> ShowAsync(Route direction, StopGroup stopGroup = null)
        {
            var token = new DialogToken {
                OriginalRoute = direction, OriginalStop = stopGroup
            };

            var currentFrame = (Frame)Window.Current.Content;

            currentFrame.Navigate(typeof(RoutePickerDialog), token);
            await token.WorkTask;

            return(token.Result);
        }
        public static async Task <RoutePickerDialogResult> ShowAsync(Route direction, StopGroup stopGroup = null)
        {
            var token = new DialogToken {
                OriginalRoute = direction, OriginalStop = stopGroup
            };

            var currentPage = (PhoneApplicationPage)App.RootFrame.Content;

            currentPage.NavigationService.Navigate(new Uri("/Dialogs/RoutePickerDialog.xaml", UriKind.Relative));
            await token.WorkTask;

            return(token.Result);
        }
Esempio n. 5
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            token = (DialogToken)e.Parameter;

            this.routeGroup = token.OriginalRoute.RouteGroup;
            this.routes     = routeGroup.Routes.ToList();
            this.stop       = token.OriginalStop;
            this.routeIndex = routes.IndexOf(token.OriginalRoute);

            if (stop == null)
            {
                this.stop = await UserEstimations.BestStopAsync(token.OriginalRoute);
            }

            DataContext   = this;
            TextName.Text = routeGroup.Description.Replace(" / ", "\n");

            setName();
            setContent();
            //Animations.FadeInFromBottomAfter(ContentListView, this, 25);
        }
Esempio n. 6
0
 internal PlayerDialogToken([NotNull] DialogBuilder builder, DialogToken inputToken,
                            [NotNull] string tokenName)
     : base(builder, inputToken, tokenName)
 {
 }
Esempio n. 7
0
 public PartnerDialogToken([NotNull] DialogBuilder builder, DialogToken inputTokenToken,
                           [NotNull] string tokenName)
     : base(builder, inputTokenToken, tokenName)
 {
 }
 public DialogToken()
 {
     Current = this;
 }