コード例 #1
0
        public override async void OnNavigatedTo(Dictionary <string, object> parameters, NavigationMode mode)
        {
            if (CurrentUser == null && AppSettings.AccessToken != null && !AppSettings.AccessToken.HasExpired)
            {
                LoadCurrentUser();
                ServiceLocator.LongPollHandler.Start();
                if (AppSettings.EnableNotifications)
                {
                    PushHelper.Start();
                }
                ServiceLocator.UserPresenceService.SetUserOnline();

                if (((App)Application.Current).LaunchArgs != null)
                {
                    var args = ((App)Application.Current).LaunchArgs;
                    if (args != null && args.ContainsKey("uid"))
                    {
                        long uid = long.Parse(args["uid"]);

                        await Task.Delay(1);

                        Navigator.Content.Navigate(typeof(ChatView), new ConversationViewModel(uid));
                    }
                }

                try
                {
                    ServiceLocator.Vkontakte.Stats.TrackVisitor();
                }
                catch { }
            }
        }