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


C# RootElement.Reload方法代码示例

本文整理汇总了C#中RootElement.Reload方法的典型用法代码示例。如果您正苦于以下问题:C# RootElement.Reload方法的具体用法?C# RootElement.Reload怎么用?C# RootElement.Reload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RootElement的用法示例。


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

示例1: ViewDidLoad

		public override void ViewDidLoad()
		{
			base.ViewDidLoad();

			_hud = this.CreateHud();

			NavigationItem.RightBarButtonItem = new UIBarButtonItem(Theme.CurrentTheme.SaveButton, UIBarButtonItemStyle.Plain, (s, e) => {
				View.EndEditing(true);
				ViewModel.SaveCommand.Execute(null);
			});

			var title = new InputElement("Title", string.Empty, string.Empty) { TextAlignment = UITextAlignment.Right };
			title.Changed += (object sender, EventArgs e) => ViewModel.Title = title.Value;

			var assignedTo = new StyledStringElement("Responsible", "Unassigned", UITableViewCellStyle.Value1);
			assignedTo.Accessory = UITableViewCellAccessory.DisclosureIndicator;
			assignedTo.Tapped += () => ViewModel.GoToAssigneeCommand.Execute(null);

			var kind = new StyledStringElement("Issue Type", ViewModel.Kind, UITableViewCellStyle.Value1);
			kind.Accessory = UITableViewCellAccessory.DisclosureIndicator;
			kind.Tapped += () =>
			{
				var ctrl = new IssueAttributesView(IssueModifyViewModel.Kinds, ViewModel.Kind) { Title = "Issue Type" };
				ctrl.SelectedValue = x => ViewModel.Kind = x.ToLower();
				NavigationController.PushViewController(ctrl, true);
			};

			var priority = new StyledStringElement("Priority", ViewModel.Priority, UITableViewCellStyle.Value1);
			priority.Accessory = UITableViewCellAccessory.DisclosureIndicator;
			priority.Tapped += () => 
			{
				var ctrl = new IssueAttributesView(IssueModifyViewModel.Priorities, ViewModel.Priority) { Title = "Priority" };
				ctrl.SelectedValue = x => ViewModel.Priority = x.ToLower();
				NavigationController.PushViewController(ctrl, true);
			};

			var milestone = new StyledStringElement("Milestone", "None", UITableViewCellStyle.Value1);
			milestone.Accessory = UITableViewCellAccessory.DisclosureIndicator;
			milestone.Tapped += () => ViewModel.GoToMilestonesCommand.Execute(null);

			var component = new StyledStringElement("Component", "None", UITableViewCellStyle.Value1);
			component.Accessory = UITableViewCellAccessory.DisclosureIndicator;
            component.Tapped += () => ViewModel.GoToComponentsCommand.Execute(null);

			var version = new StyledStringElement("Version", "None", UITableViewCellStyle.Value1);
			version.Accessory = UITableViewCellAccessory.DisclosureIndicator;
            version.Tapped += () => ViewModel.GoToVersionsCommand.Execute(null);

			var content = new MultilinedElement("Description");
			content.Tapped += () =>
			{
                var composer = new Composer { Title = "Issue Description", Text = content.Value };
				composer.NewComment(this, (text) => {
					ViewModel.Content = text;
					composer.CloseComposer();
				});
			};

			ViewModel.Bind(x => x.IsSaving, x =>
			{
				if (x)
					_hud.Show("Saving...");
				else
					_hud.Hide();
			});

			Root = new RootElement(Title) { new Section { title, assignedTo, kind, priority }, new Section { milestone, component, version }, new Section { content } };

			ViewModel.Bind(x => x.Title, x => {
				title.Value = x;
				Root.Reload(title, UITableViewRowAnimation.None);
			}, true);

			ViewModel.Bind(x => x.AssignedTo, x => {
				assignedTo.Value = x == null ? "Unassigned" : x.Username;
				Root.Reload(assignedTo, UITableViewRowAnimation.None);
			}, true);

			ViewModel.Bind(x => x.Kind, x => {
				kind.Value = x;
				Root.Reload(kind, UITableViewRowAnimation.None);
			}, true);

			ViewModel.Bind(x => x.Priority, x => {
				priority.Value = x;
				Root.Reload(priority, UITableViewRowAnimation.None);
			}, true);

			ViewModel.Bind(x => x.Milestone, x => {
				milestone.Value = x ?? "None";
				Root.Reload(milestone, UITableViewRowAnimation.None);
			}, true);

			ViewModel.Bind(x => x.Component, x => {
				component.Value = x ?? "None";
				Root.Reload(component, UITableViewRowAnimation.None);
			}, true);

			ViewModel.Bind(x => x.Version, x => {
				version.Value = x ?? "None";
//.........这里部分代码省略.........
开发者ID:Jeff-Lewis,项目名称:CodeBucket,代码行数:101,代码来源:IssueModifyView.cs


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