当前位置: 首页>>代码示例>>C#>>正文


C# UITableViewRowAnimation类代码示例

本文整理汇总了C#中UITableViewRowAnimation的典型用法代码示例。如果您正苦于以下问题:C# UITableViewRowAnimation类的具体用法?C# UITableViewRowAnimation怎么用?C# UITableViewRowAnimation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UITableViewRowAnimation类属于命名空间,在下文中一共展示了UITableViewRowAnimation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Reload

 public static void Reload(this Element element, UITableViewRowAnimation animation = UITableViewRowAnimation.None)
 {
     if (element.GetContainerTableView() == null)
         return;
     var root = element.GetImmediateRootElement();
     if (root != null)
         root.Reload(element, animation);
 }
开发者ID:dbeattie71,项目名称:MugenMvvmToolkit,代码行数:8,代码来源:MonoTouchDialogExtensions.cs

示例2: Insert

		public int Insert(int idx, UITableViewRowAnimation anim, IEnumerable<IElement> newElements)
		{
			if (newElements == null)
				return 0;
			
			int pos = idx;
			int count = 0;
			foreach (var e in newElements)
			{
				Elements.Insert(pos++, e);
				e.Parent = this;
				count++;
			}

			if (Root != null && Root.TableView != null)
			{
				if (anim == UITableViewRowAnimation.None)
					Root.TableView.ReloadData();
				else
					InsertVisual(idx, anim, pos - idx);
			}
			return count;
		}
开发者ID:CartBlanche,项目名称:MonoMobile.MVVM,代码行数:23,代码来源:Section.cs

示例3: RemoveRange

        /// <summary>
        /// Remove a range of elements from the section with the given animation
        /// </summary>
        /// <param name="start">
        /// Starting position
        /// </param>
        /// <param name="count">
        /// Number of elements to remove form the section
        /// </param>
        /// <param name="anim">
        /// The animation to use while removing the elements
        /// </param>
        public void RemoveRange(int start, int count, UITableViewRowAnimation anim)
        {
            if (start < 0 || start >= Elements.Count)
                return;
            if (count == 0)
                return;

            var root = Parent as RootElement;

            if (start + count > Elements.Count)
                count = Elements.Count - start;

            Elements.RemoveRange(start, count);

            if (root == null || root.TableView == null)
                return;

            int sidx = root.IndexOf(this);
            var paths = new NSIndexPath[count];
            for (int i = 0; i < count; i++)
                paths[i] = NSIndexPath.FromRowSection(start + i, sidx);
            root.TableView.DeleteRows(paths, anim);
        }
开发者ID:indazoo,项目名称:MvvmCross_DesignData,代码行数:35,代码来源:Section.cs

示例4: InsertVisual

        private void InsertVisual(int idx, UITableViewRowAnimation anim, int count)
        {
            var root = Parent as RootElement;

            if (root == null || root.TableView == null)
                return;

            int sidx = root.IndexOf(this);
            var paths = new NSIndexPath[count];
            for (int i = 0; i < count; i++)
                paths[i] = NSIndexPath.FromRowSection(idx + i, sidx);

            root.TableView.InsertRows(paths, anim);
        }
开发者ID:indazoo,项目名称:MvvmCross_DesignData,代码行数:14,代码来源:Section.cs

示例5: RemoveAt

        /// <summary>
        /// Removes a section at a specified location using the specified animation
        /// </summary>
        /// <param name="idx">
        /// A <see cref="System.Int32"/>
        /// </param>
        /// <param name="anim">
        /// A <see cref="UITableViewRowAnimation"/>
        /// </param>
        public void RemoveAt(int idx, UITableViewRowAnimation anim)
        {
            if (idx < 0 || idx >= Sections.Count)
                return;

            Sections.RemoveAt (idx);

            if (TableView == null)
                return;

            TableView.DeleteSections (NSIndexSet.FromIndex (idx), anim);
        }
开发者ID:mauropm,项目名称:Monospace11,代码行数:21,代码来源:Elements.cs

示例6: Reload

 public void Reload(Element element, UITableViewRowAnimation animation)
 {
     if (element == null)
         throw new ArgumentNullException ("element");
     var section = element.Parent as Section;
     if (section == null)
         throw new ArgumentException ("Element is not attached to this root");
     var root = section.Parent as RootElement;
     if (root == null)
         throw new ArgumentException ("Element is not attached to this root");
     var path = element.IndexPath;
     if (path == null)
         return;
     TableView.ReloadRows (new NSIndexPath [] { path }, animation);
 }
开发者ID:mauropm,项目名称:Monospace11,代码行数:15,代码来源:Elements.cs

示例7: InsertRow

		private void InsertRow(Section section, int row, object item, UITableViewRowAnimation animation = UITableViewRowAnimation.Fade)
		{
			AddPropertyChangedHandler(item);

			section.DataContext.Insert(row, item); 
			
			if (Controller == MonoMobileApplication.CurrentViewController)
			{		
				var indexPaths = new NSIndexPath[] { NSIndexPath.FromRowSection(row, section.Index) };
				InvokeOnMainThread(()=> Controller.TableView.InsertRows(indexPaths, animation));
			}
		}
开发者ID:RobertKozak,项目名称:MonoMobile.Views,代码行数:12,代码来源:DataContextBinder.cs

示例8: Insert

        /// <summary>
        /// Inserts a new section into the RootElement
        /// </summary>
        /// <param name="idx">
        /// The index where the section is added <see cref="System.Int32"/>
        /// </param>
        /// <param name="anim">
        /// The <see cref="UITableViewRowAnimation"/> type.
        /// </param>
        /// <param name="newSections">
        /// A <see cref="Section[]"/> list of sections to insert
        /// </param>
        /// <remarks>
        ///    This inserts the specified list of sections (a params argument) into the
        ///    root using the specified animation.
        /// </remarks>
        public void Insert(int idx, UITableViewRowAnimation anim, params Section [] newSections)
        {
            if (idx < 0 || idx > Sections.Count)
                return;
            if (newSections == null)
                return;

            if (TableView != null)
                TableView.BeginUpdates ();

            int pos = idx;
            foreach (var s in newSections){
                s.Parent = this;
                Sections.Insert (pos++, s);
            }

            if (TableView == null)
                return;

            TableView.InsertSections (MakeIndexSet (idx, newSections.Length), anim);
            TableView.EndUpdates ();
        }
开发者ID:mauropm,项目名称:Monospace11,代码行数:38,代码来源:Elements.cs

示例9: Insert

		/// <summary>
		/// Inserts a series of elements into the Section using the specified animation
		/// </summary>
		/// <param name="idx">
		/// The index where the elements are inserted
		/// </param>
		/// <param name="anim">
		/// The animation to use
		/// </param>
		/// <param name="newElements">
		/// A series of elements.
		/// </param>
		public void Insert (int idx, UITableViewRowAnimation anim, params Element [] newElements)
		{
			if (newElements == null)
				return;
			
			int pos = idx;
			foreach (var e in newElements){
				Elements.Insert (pos++, e);
				e.Parent = this;
			}
			
			if (Parent != null)
				InsertVisual (idx, anim, newElements.Length);
		}
开发者ID:briandonahue,项目名称:MonoTouch.Dialog,代码行数:26,代码来源:Elements.cs

示例10: Insert

		/// <summary>
		/// Inserts a single RootElement into the Section using the specified animation
		/// </summary>
		/// <param name="idx">
		/// The index where the elements are inserted
		/// </param>
		/// <param name="anim">
		/// The animation to use
		/// </param>
		/// <param name="newElements">
		/// A series of elements.
		/// </param>
		public void Insert (int idx, UITableViewRowAnimation anim, RootElement newElement)
		{
			Insert (idx, anim, (Element) newElement);
		}
开发者ID:henrikweimenhog,项目名称:MonoTouch.Dialog,代码行数:16,代码来源:Section.cs

示例11: ReplaceRow

		private void ReplaceRow(Section section, object oldItem, object newItem, UITableViewRowAnimation animation = UITableViewRowAnimation.Fade)
		{
			RemovePropertyChangedHandler(oldItem);
			AddPropertyChangedHandler(newItem);

			var row = section.DataContext.IndexOf(oldItem);

			section.DataContext[row] = newItem;
					
			if (Controller == MonoMobileApplication.CurrentViewController)
			{
				var indexPaths = new NSIndexPath[] { NSIndexPath.FromRowSection(row, section.Index) };
				InvokeOnMainThread(()=> Controller.TableView.ReloadRows(indexPaths, animation));
			}
		}
开发者ID:RobertKozak,项目名称:MonoMobile.Views,代码行数:15,代码来源:DataContextBinder.cs

示例12: InsertVisual

		void InsertVisual(int idx, UITableViewRowAnimation anim, int count)
		{
			if (Root == null || Root.TableView == null)
				return;
			
			int sidx = Root.IndexOf(this as ISection);
			var paths = new NSIndexPath[count];
			for (int i = 0; i < count; i++)
				paths[i] = NSIndexPath.FromRowSection(idx + i, sidx);
			
			Root.TableView.InsertRows(paths, anim);
		}
开发者ID:CartBlanche,项目名称:MonoMobile.MVVM,代码行数:12,代码来源:Section.cs

示例13: Remove

 public void Remove(Section s, UITableViewRowAnimation anim)
 {
     if (s == null)
         return;
     int idx = Sections.IndexOf (s);
     if (idx == -1)
         return;
     RemoveAt (idx, anim);
 }
开发者ID:mauropm,项目名称:Monospace11,代码行数:9,代码来源:Elements.cs

示例14: RemoveRange

		/// <summary>
		/// Remove a range of elements from the section with the given animation
		/// </summary>
		/// <param name="start">
		/// Starting position
		/// </param>
		/// <param name="count">
		/// Number of elements to remove form the section
		/// </param>
		/// <param name="anim">
		/// The animation to use while removing the elements
		/// </param>
		public void RemoveRange(int start, int count, UITableViewRowAnimation anim)
		{
			if (start < 0 || start >= Elements.Count)
				return;
			if (count == 0)
				return;
			
			if (start + count > Elements.Count)
				count = Elements.Count - start;
			
	//		Elements.RemoveRange(start, count);
			
			if (Root == null || Root.TableView == null)
				return;
			
			int sidx = Root.IndexOf(this as ISection);
			var paths = new NSIndexPath[count];
			for (int i = 0; i < count; i++)
				paths[i] = NSIndexPath.FromRowSection(start + i, sidx);
			Root.TableView.DeleteRows(paths, anim);

			foreach(var element in Elements)
			{
				if (element.Cell != null)
					element.Cell.SetNeedsDisplay();
			}
		}
开发者ID:CartBlanche,项目名称:MonoMobile.MVVM,代码行数:39,代码来源:Section.cs

示例15: RemoveRow

		private void RemoveRow(Section section, object item, UITableViewRowAnimation animation = UITableViewRowAnimation.Fade)
		{
			RemovePropertyChangedHandler(item);

			var row = section.DataContext.IndexOf(item);
			section.DataContext.Remove(item);
					
			if (Controller == MonoMobileApplication.CurrentViewController)
			{
				var indexPaths = new NSIndexPath[] { NSIndexPath.FromRowSection(row, section.Index) };
				Controller.TableView.DeleteRows(indexPaths, animation);
			}
		}
开发者ID:drony,项目名称:MonoMobile.Views,代码行数:13,代码来源:DataContextBinder.cs


注:本文中的UITableViewRowAnimation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。