Exemplo n.º 1
0
        public void RaiseNavigated(long chatId)
        {
            if (Content is ChatPage)
            {
                NavigationService.CacheKeyToChatId[CurrentPageCacheKey] = chatId;
                CurrentPageParam = chatId;

                var args = new NavigatedEventArgs
                {
                    NavigationMode = NavigationMode.Refresh,
                    SourcePageType = CurrentPageType,
                    Parameter      = CurrentPageParam,
                    Content        = Frame.Content as Page
                };

                foreach (var handler in _navigatedEventHandlers)
                {
                    if (handler.Target is INavigationService)
                    {
                        continue;
                    }

                    handler(Frame, args);
                }
            }
        }
Exemplo n.º 2
0
        private void FacadeNavigatedEventHandler(object sender, NavigationEventArgs e)
        {
            Logger.Info();

            CurrentPageType     = e.SourcePageType;
            CurrentPageParam    = e.Parameter;
            CurrentPageCacheKey = null;

            if (e.SourcePageType == typeof(ChatPage) && CurrentPageParam is string cacheKey)
            {
                CurrentPageParam    = NavigationService.CacheKeyToChatId[cacheKey];
                CurrentPageCacheKey = cacheKey;
            }

            var args = new NavigatedEventArgs(e, Content as Page);

            args.Parameter = CurrentPageParam;

            if (NavigationModeHint != NavigationMode.New)
            {
                args.NavigationMode = NavigationModeHint;
            }

            NavigationModeHint = NavigationMode.New;

            foreach (var handler in _navigatedEventHandlers)
            {
                handler(Frame, args);
            }
        }