本文整理汇总了C#中MonoTouch.Dialog.DialogViewController.ReloadData方法的典型用法代码示例。如果您正苦于以下问题:C# DialogViewController.ReloadData方法的具体用法?C# DialogViewController.ReloadData怎么用?C# DialogViewController.ReloadData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoTouch.Dialog.DialogViewController
的用法示例。
在下文中一共展示了DialogViewController.ReloadData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PushViewController
public void PushViewController()
{
// trace event
TraceHelper.AddMessage("Item: PushViewController");
try
{
folder = App.ViewModel.LoadFolder(ThisItem.FolderID);
}
catch (Exception)
{
folder = null;
return;
}
// make a deep copy of the item which stores the previous values
// the iphone implementation will make changes to the "live" copy
ItemCopy = new Item(ThisItem);
root = RenderViewItem(ThisItem);
actionsViewController = new DialogViewController (root, true);
// create an Edit button which pushes the edit view onto the nav stack
actionsViewController.NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Edit, delegate {
var editRoot = RenderEditItem(ThisItem, false);
editViewController = new DialogViewController(editRoot, true);
editViewController.NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Done, delegate {
// save the item and trigger a sync with the service
SaveButton_Click(null, null);
// navigate back to the list page
TraceHelper.StartMessage("Item: Navigate back");
NavigateBack();
});
UIImage actionsBackButtonImage = UIImageCache.GetUIImage("Images/actions-back-button.png");
UIImage actionsBackButtonImageSelected = UIImageCache.GetUIImage("Images/actions-back-button-selected.png");
UIButton actionsBackButton = UIButton.FromType(UIButtonType.Custom);
actionsBackButton.SetImage(actionsBackButtonImage, UIControlState.Normal);
actionsBackButton.SetImage(actionsBackButtonImageSelected, UIControlState.Selected);
actionsBackButton.SetImage(actionsBackButtonImageSelected, UIControlState.Highlighted);
actionsBackButton.Frame = new System.Drawing.RectangleF(0, 0, actionsBackButtonImage.Size.Width, actionsBackButtonImage.Size.Height);
actionsBackButton.TouchUpInside += delegate {
// save the item and trigger a sync with the service
SaveButton_Click(null, null);
// reload the Actions page
var oldroot = root;
root = RenderViewItem(ThisItem);
actionsViewController.Root = root;
actionsViewController.ReloadData();
oldroot.Dispose();
// pop back to actions page
controller.PopViewControllerAnimated(true);
};
UIBarButtonItem actionsBackBarItem = new UIBarButtonItem(actionsBackButton);
editViewController.NavigationItem.LeftBarButtonItem = actionsBackBarItem;
editViewController.TableView.BackgroundColor = UIColorHelper.FromString(App.ViewModel.Theme.PageBackground);
controller.PushViewController(editViewController, true);
});
// if moving from the item page to its parent (e.g. the schedule tab), call ViewDidAppear on that controller
actionsViewController.ViewDisappearing += (sender, e) =>
{
/*
if (UIDevice.CurrentDevice.CheckSystemVersion(5, 0))
{
// this property should be called "IsMovingToParentViewController" - it is a bug in the property naming,
// not a bug in the code
if (actionsViewController.IsMovingFromParentViewController)
controller.ViewDidAppear(false);
}
*/
// the IsMovingToParentViewController method is only available on iOS 5.0 so the code above doesn't work generally.
// it does not appear to hurt anything to always call ViewDidAppear (even when pushing deeper into the nav stack)
controller.ViewDidAppear(false);
};
// push the "view item" view onto the nav stack
actionsViewController.TableView.BackgroundColor = UIColorHelper.FromString(App.ViewModel.Theme.PageBackground);
controller.PushViewController(actionsViewController, true);
}
示例2: ResetSectionValues
/// <summary>
/// For proper display when the user taps "Back" button.
/// Resets rootSections' dropdowns (No of Styles, Style Category, SizeRange etc) to default values (i.e. 0)
/// </summary>
public void ResetSectionValues(DialogViewController dvc)
{
for (int i = 0; i < rootSections.Count; i++) {
foreach (Element item in rootSections[i].Elements) {
var rootElement = item as RootElement;
if (rootElement != null)
rootElement.RadioSelected = 0;
}
}
dvc.ReloadData ();
}
示例3: AdvancedConfigEdit
void AdvancedConfigEdit (DialogViewController dvc)
{
dvc.NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Edit, delegate {
// Activate editing
// Switch the root to editable elements
dvc.Root = CreateEditableRoot(dvc.Root, true);
dvc.ReloadData();
// Activate row editing & deleting
dvc.TableView.SetEditing (true, true);
AdvancedConfigDone(dvc);
});
}
示例4: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad ();
// Perform any additional setup after loading the view, typically from a nib.
//DVC is the source one - the one we start with. Most of it's stuff is just setup
dvc = new DialogViewController(null, false);
var root = new RootElement("Hello there");
var section = new Section();
for(int i = 0; i < 10; i++)
{
//urgh, using lambas, so we need to capture a few things locally.
//never sure if I have to do this with int's or not tho
int locali = i;
//make the local element, the one in the main list
StyledStringElement localElement = null;
localElement = new StyledStringElement("Hello " + i.ToString (), delegate {;
//when you tap on the item, make a new root,
// which is a radio list. Select item 1 (the second one) by default
// but only cos I want to, no real reason :)
RadioGroup radioGroup = new RadioGroup(1);
//create 3 elements. This is stupid code copy and paste, they all do the same thing
// I guess you'd make this from an array or database?
var childroot = new RootElement("child", radioGroup)
{
new Section()
{
// I've made a custom RadioElement (down the bottom)
// that, when selected, calls us back
new CheckedRadioElement("First", delegate(CheckedRadioElement cre) {
// .. and we dismiss the popover, grab the value out, and then tell the
// main dvc to reload/redisplay itself.
popOver.Dismiss(true);
localElement.Caption = cre.Caption;
dvc.ReloadData();
}),
// these 2 are the same - just other data. Use a database or an array :)
new CheckedRadioElement("Second", delegate(CheckedRadioElement cre) {
popOver.Dismiss(true);
localElement.Caption = cre.Caption;
dvc.ReloadData();
}),
new CheckedRadioElement("Third", delegate(CheckedRadioElement cre) {
popOver.Dismiss(true);
localElement.Caption = cre.Caption;
dvc.ReloadData();
})
}
};
//make the child DVC. This is the one which goes into the popover.
// false on the end, 'cos we are not pushing it into a UINavigationController
var childdvc = new DialogViewController(childroot, false);
childdvc.Style = UITableViewStyle.Plain;
//this does tho!
//get the rect of the last section
var newrootSize = childdvc.TableView.RectForSection (childroot.Count - 1);
//and make that the size. Or 700... which ever is smaller.
childdvc.ContentSizeForViewInPopover = new SizeF (300, Math.Min (newrootSize.Bottom, 700));
//make the popover and set its size
popOver = new UIPopoverController(childdvc);
//and show the popover. We ask the tableview for the rect of the item we selected.
// and in this case, we want to see it on the right (arrow == left)
popOver.PresentFromRect(dvc.TableView.RectForRowAtIndexPath(localElement.IndexPath), dvc.TableView, UIPopoverArrowDirection.Left, true);
}) {
Accessory = UITableViewCellAccessory.DisclosureIndicator
};
section.Add (localElement);
}
root.Add (section);
dvc.Root = root;
//temp view is because a normal DVC wants to take over the whole screen, we I'm constraining it to a 300x300 area, which I think is about
// what you had. Thats the only reason tho.
var tempView = new UIView(new RectangleF(10,10,300,300));
tempView.AddSubview(dvc.TableView);
View.Add (tempView);
}
示例5: AdvancedConfigDone
void AdvancedConfigDone (DialogViewController dvc)
{
dvc.NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Done, delegate {
// Deactivate editing
dvc.ReloadData();
// Switch updated entry elements to StringElements
dvc.Root = CreateEditableRoot(dvc.Root, false);
dvc.TableView.SetEditing (false, true);
AdvancedConfigEdit (dvc);
});
}