示例#1
0
 protected DialogToken([NotNull] DialogBuilder builder, DialogToken inputToken, [NotNull] string tokenName)
 {
     _builder    = builder;
     InputToken  = inputToken;
     TokenName   = tokenName;
     OutputToken = TokenName;
     Builder.AddToken(this);
 }
示例#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);
 }
示例#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);
        }
示例#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);
        }
示例#6
0
 internal PlayerDialogToken([NotNull] DialogBuilder builder, DialogToken inputToken,
                            [NotNull] string tokenName)
     : base(builder, inputToken, tokenName)
 {
 }
示例#7
0
 public PartnerDialogToken([NotNull] DialogBuilder builder, DialogToken inputTokenToken,
                           [NotNull] string tokenName)
     : base(builder, inputTokenToken, tokenName)
 {
 }
 public DialogToken()
 {
     Current = this;
 }