本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
}
示例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 ();
}
示例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);
}
示例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);
}
示例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));
}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
}