Пример #1
0
 private async void MainFlip_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (MainFlip.Items.Count == 4)
     {
         var container    = MainFlip.ContainerFromItem(this);
         var scrollViewer = FindChildrenObjectByType <ScrollViewer>(container);
         if (scrollViewer != null)
         {
             var store  = new StoreToFiles();
             var offset = (float)scrollViewer.VerticalOffset;
             Thread.CurrentOffset = offset;
             await store.UpdateCurrentOffset(Thread);
         }
     }
 }
Пример #2
0
 private async void MainFlip_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (MainFlip.Items.Count == 2)
     {
         var container    = MainFlip.ContainerFromItem(this);
         var scrollViewer = FindChildrenObjectByType <ScrollViewer>(container);
         var store        = new StoreToFiles();
         if (scrollViewer != null)
         {
             var offset = (float)scrollViewer.VerticalOffset;
             thread.CurrentOffset = offset;
             try
             {
                 await store.UpdateCurrentOffset(thread);
             }
             catch (Exception ex)
             {
                 //ここでの例外はおそらく同時に複数のタスクが更新しようとしているだけ
             }
         }
     }
 }