Exemplo n.º 1
0
 public override void ReloadSections(NSIndexSet sections)
 {
     NativeLayout?.NotifyCollectionChange(new CollectionChangedOperation(
                                              IndexPath.FromRowSection(0, (int)sections.FirstIndex),
                                              (int)sections.Count,
                                              NotifyCollectionChangedAction.Replace,
                                              CollectionChangedOperation.Element.Group
                                              ));
     base.ReloadSections(sections);
 }
Exemplo n.º 2
0
        public void ScrollIntoView(int displayPosition, ScrollIntoViewAlignment alignment)
        {
            StopScroll();

            if (NativeLayout != null)
            {
                NativeLayout.ScrollToPosition(displayPosition, alignment);

                AwakenScrollBars();
            }
        }
		public void Refresh()
		{
			CurrentAdapter?.Refresh();

			var isScrollResetting = NativeLayout != null && NativeLayout.ContentOffset != 0;
			NativeLayout?.Refresh();

			if (isScrollResetting)
			{
				// Raise scroll events since offset has been reset to 0
				InvokeOnScroll();
			}
		}
Exemplo n.º 4
0
 public override void ReloadItems(NSIndexPath[] indexPaths)
 {
     if (TryApplyCollectionChange())
     {
         NativeLayout?.NotifyCollectionChange(new CollectionChangedOperation(
                                                  indexPaths.First().ToIndexPath(),
                                                  indexPaths.Length,
                                                  NotifyCollectionChangedAction.Replace,
                                                  CollectionChangedOperation.Element.Item
                                                  ));
         base.ReloadItems(indexPaths);
     }
 }
Exemplo n.º 5
0
 public override void ReloadSections(NSIndexSet sections)
 {
     if (TryApplyCollectionChange())
     {
         using (EnableOrDisableAnimations())
         {
             NativeLayout?.NotifyCollectionChange(new CollectionChangedOperation(
                                                      Uno.UI.IndexPath.FromRowSection(0, (int)sections.FirstIndex),
                                                      (int)sections.Count,
                                                      NotifyCollectionChangedAction.Replace,
                                                      CollectionChangedOperation.Element.Group
                                                      ));
             base.ReloadSections(sections);
         }
     }
 }
Exemplo n.º 6
0
 public override void DeleteSections(NSIndexSet sections)
 {
     if (TryApplyCollectionChange())
     {
         NativeLayout?.NotifyCollectionChange(new CollectionChangedOperation(
                                                  IndexPath.FromRowSection(0, (int)sections.FirstIndex),
                                                  (int)sections.Count,
                                                  NotifyCollectionChangedAction.Remove,
                                                  CollectionChangedOperation.Element.Group
                                                  ));
         try
         {
             base.DeleteSections(sections);
         }
         catch (MonoTouchException e)
         {
             this.Log().Error("Error when updating collection", e);
         }
     }
 }
Exemplo n.º 7
0
 public override void DeleteItems(NSIndexPath[] indexPaths)
 {
     if (TryApplyCollectionChange())
     {
         NativeLayout?.NotifyCollectionChange(new CollectionChangedOperation(
                                                  indexPaths.First().ToIndexPath(),
                                                  indexPaths.Length,
                                                  NotifyCollectionChangedAction.Remove,
                                                  CollectionChangedOperation.Element.Item
                                                  ));
         try
         {
             base.DeleteItems(indexPaths);
         }
         catch (MonoTouchException e)
         {
             this.Log().Error("Error when updating collection", e);
         }
     }
 }
Exemplo n.º 8
0
 public override void InsertItems(NSIndexPath[] indexPaths)
 {
     if (TryApplyCollectionChange())
     {
         using (EnableOrDisableAnimations())
         {
             NativeLayout?.NotifyCollectionChange(new CollectionChangedOperation(
                                                      indexPaths.First().ToIndexPath(),
                                                      indexPaths.Length,
                                                      NotifyCollectionChangedAction.Add,
                                                      CollectionChangedOperation.Element.Item
                                                      ));
             try
             {
                 base.InsertItems(indexPaths);
             }
             catch (MonoTouchException e)
             {
                 this.Log().Error("Error when updating collection", e);
             }
         }
     }
 }
Exemplo n.º 9
0
 public override void InsertSections(NSIndexSet sections)
 {
     if (TryApplyCollectionChange())
     {
         using (EnableOrDisableAnimations())
         {
             NativeLayout?.NotifyCollectionChange(new CollectionChangedOperation(
                                                      Uno.UI.IndexPath.FromRowSection(0, (int)sections.FirstIndex),
                                                      (int)sections.Count,
                                                      NotifyCollectionChangedAction.Add,
                                                      CollectionChangedOperation.Element.Group
                                                      ));
             try
             {
                 base.InsertSections(sections);
             }
             catch (MonoTouchException e)
             {
                 this.Log().Error("Error when updating collection", e);
             }
         }
     }
 }
Exemplo n.º 10
0
 public override bool CanScrollVertically(int direction)
 {
     return(NativeLayout.CanCurrentlyScrollVertically(direction));
 }
Exemplo n.º 11
0
        public override CGSize SizeThatFits(CGSize size)
        {
            var result = NativeLayout.SizeThatFits(size);

            return(result);
        }
		// We override these two methods because the base implementation depends on ComputeScrollOfset, which is not reliable when, eg, items 
		// are inserted/removed out of view.
		public override bool CanScrollHorizontally(int direction)
		{
			return NativeLayout.CanCurrentlyScrollHorizontally(direction);
		}