MonoTouch.Dialog.RootElement.Reload C# (CSharp) Method

Reload() public method

public Reload ( Element element, UITableViewRowAnimation animation ) : void
element Element
animation UITableViewRowAnimation
return void
		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.GetIndexPath();
			if (path == null)
				return;
			if (TableView!=null)
				TableView.ReloadRows (new NSIndexPath [] { path }, animation);
		}
		

Same methods

RootElement::Reload ( Section section, UITableViewRowAnimation animation ) : void

Usage Example

        public OccurrencesSection(CheckPoint checkpoint,iCheckpointCommandController Controller,CheckPointDetailDialog dialog)
        {
            this.Caption= "Completions:";
            this.Footer = "Tap to remove.";

            var occurenceElements =
                checkpoint
                    .AllOccurrences
                    .OrderByDescending (o => o.TimeStamp)
                    .Select (o => new StringElement (o.Date.ToString ("d")  + (o.IsSkipped?" (Skipped)":""),
                        ()=>{
                            var c = SharedDialogs.ConfirmationDialog(
                                (a)=>
                                {
                                    checkpoint.RemoveOccurrence(o);
                                    Controller.RewriteOccurrences();
                                    dialog.Render();
                                },Message:"Deleting this completion will affect averages and streaks.");
                            dialog.PresentModalViewController(c,true);
                        })
                        {
                            Value= o.TimeStamp.ToString ("t")
                        })
                    .ToList();
            this.AddAll (occurenceElements.Take(5));

            if (occurenceElements.Count > 5)
                this.Add (new StringElement ("All Completions",
                    ()=>{
                        var r = new RootElement(checkpoint.Name);
                        var s = new Section("All Completions");
                        r.Add(s);
                        s.AddAll(
                            occurenceElements.Select(o=>
                                {
                                    o.Tapped+=()=>
                                    {r.Reload(s,UITableViewRowAnimation.Automatic);};
                                    return o;
                                }
                            ));
                        dialog.moreDialog = new DialogViewController(r,true);
                        dialog.NavigationController.PushViewController(dialog.moreDialog,true);
                    }
                ){ Alignment = UITextAlignment.Center });
        }
All Usage Examples Of MonoTouch.Dialog.RootElement::Reload