Пример #1
0
        //private void PushClient_MessageReceived(object sender, InstagramApiSharp.API.Push.MessageReceivedEventArgs e)
        //{
        //    System.Diagnostics.Debug.WriteLine(e?.Json);
        //    Helpers.PushHelper.HandleNotify(e.NotificationContent, Helper.InstaApiList);
        //    //Helpers.NotificationHelper.ShowToast(e.NotificationContent.Message, e.NotificationContent.OptionalAvatarUrl, e.NotificationContent.Title ?? "");
        //}
        public async void TryToRefresh(bool all = false)
        {
            if (all)
            {
                await UserHelper.GetBanyanAsync();

                UserHelper.GetSelfUser();
            }
            MainVM.FirstRun(true);
        }
Пример #2
0
 private void OnKeyDownHandler(object sender, KeyRoutedEventArgs e)
 {
     try
     {
         if (e.Key == Windows.System.VirtualKey.F5)
         {
             MainVM.FirstRun(true);
         }
     }
     catch { }
 }
Пример #3
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            KeyDown += OnKeyDownHandler;
            if (e.NavigationMode == NavigationMode.New || e.NavigationMode == NavigationMode.Refresh)
            {
                if (Helper.UserChanged)
                {
                    try
                    {
                        MainVM.Stories.Clear();
                        MainVM.PostsGenerator.Items.Clear();
                        if (Helpers.NavigationService.Frame.BackStack.Count > 0)
                        {
                            Helpers.NavigationService.Frame.BackStack.Clear();
                        }
                        Helper.UserChanged = false;
                        MainPage.Current?.HideBackButton();
                        MainVM.FirstRun(true);
                    }
                    catch { }
                }
            }
            try
            {
                try
                {
                    if (Helpers.NavigationService.Frame.BackStack.Count > 0)
                    {
                        Helpers.NavigationService.Frame.BackStack.Clear();
                    }
                }
                catch { }
                if (MediaMainUc == null)
                {
                    return;
                }
                ConnectedAnimation userPictureUserDetailsView = ConnectedAnimationService.GetForCurrentView().GetAnimation("UserPictureUserDetailsView");
                if (userPictureUserDetailsView != null)
                {
                    userPictureUserDetailsView.Completed += ImageAnimationClose_Completed;
                    //if (LatestGrid?.Name != InfoGrid.Name)
                    //    LatestGrid.Background = new SolidColorBrush(Helper.GetColorFromHex("#FF2E2E2E"));

                    userPictureUserDetailsView.TryStart(MediaMainUc.UserImage);
                    //GridShadow.Visibility = GVSHOW.Visibility = Visibility.Collapsed;
                }
            }
            catch { }
            //SetSeens();
        }
Пример #4
0
 public async void TryToRefresh(bool all = false)
 {
     if (all)
     {
         if (Helper.CurrentUser != null)
         {
             await UserHelper.GetBanyanAsync().ConfigureAwait(false);
         }
         else
         {
             await UserHelper.GetBanyanAsync();
         }
         UserHelper.GetSelfUser();
     }
     MainVM.FirstRun(true);
 }
Пример #5
0
 private void RefreshControlRefreshRequested(Microsoft.UI.Xaml.Controls.RefreshContainer sender, Microsoft.UI.Xaml.Controls.RefreshRequestedEventArgs args)
 {
     using (var RefreshCompletionDeferral = args.GetDeferral())
         MainVM.FirstRun(true);
 }