本文整理汇总了C#中RootElement类的典型用法代码示例。如果您正苦于以下问题:C# RootElement类的具体用法?C# RootElement怎么用?C# RootElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RootElement类属于命名空间,在下文中一共展示了RootElement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DemoContainerStyle
public void DemoContainerStyle ()
{
var root = new RootElement ("Container Style") {
new Section ("A") {
new StringElement ("Another kind of"),
new StringElement ("TableView, just by setting the"),
new StringElement ("Style property"),
},
new Section ("C"){
new StringElement ("Chaos"),
new StringElement ("Corner"),
},
#warning inline LINQ source removed
/*
*
new Section ("Style"){
from a in "Hello there, this is a long text that I would like to split in many different nodes for the sake of all of us".Split (' ')
select (Element) new StringElement (a)
}
*/
};
var dvc = new DialogViewController (root, true) {
Style = UITableViewStyle.Plain
};
navigation.PushViewController (dvc, true);
}
开发者ID:runegri,项目名称:Android.Dialog,代码行数:26,代码来源:DemoContainerStyle.cs
示例2: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
// ios7 layout
if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
EdgesForExtendedLayout = UIRectEdge.None;
Root = new RootElement("The Dialog")
{
new Section("Strings")
{
new EntryElement("Hello").Bind(this, "Value Hello"),
new EntryElement("Hello2").Bind(this, "Value Hello2"),
new StringElement("Test").Bind(this, "Value Combined"),
new BooleanElement("T or F", false).Bind(this, "Value Option1"),
new BooleanElement("T or F:", true).Bind(this, "Value Option1"),
},
new Section("Dates")
{
new DateElement("The Date", DateTime.Today).Bind(this, "Value TheDate"),
new TimeElement("The Time", DateTime.Today).Bind(this, "Value TheDate"),
new StringElement("Actual").Bind(this, "Value TheDate")
}
};
}
开发者ID:KiranKumarAlugonda,项目名称:NPlus1DaysOfMvvmCross,代码行数:27,代码来源:FirstView.cs
示例3: SponsorsView
public SponsorsView()
: base(UITableViewStyle.Plain)
{
Root = new RootElement("Sponsors");
RefreshRequested += (s, e) => ViewModel.RefreshDataCommand.Execute(null);
}
开发者ID:jorik041,项目名称:NycCodeCamp8,代码行数:7,代码来源:SponsorsView.cs
示例4: PopulateTable
/// <summary>
/// Populates the page with sessions, grouped by time slot
/// that are marked as 'favorite'
/// </summary>
protected override void PopulateTable()
{
// get the sessions from the database
var sessions = BL.Managers.SessionManager.GetSessions ();
var favs = BL.Managers.FavoritesManager.GetFavorites();
// extract IDs from Favorites query
List<string> favoriteIDs = new List<string>();
foreach (var f in favs) favoriteIDs.Add (f.SessionKey);
// build list, matching the Favorite.SessionKey with actual
// Session.Key rows - which might have moved if the data changed
var root = new RootElement ("Favorites") {
from s in sessions
where favoriteIDs.Contains(s.Key)
group s by s.Start.Ticks into g
orderby g.Key
select new Section (new DateTime (g.Key).ToString ("dddd HH:mm")) {
from hs in g
select (Element) new SessionElement (hs)
}};
if(root.Count == 0) {
var section = new Section("No favorites") {
new StyledStringElement("Touch the star to favorite a session")
};
root.Add(section);
}
Root = root;
}
开发者ID:slodge,项目名称:mobile-samples,代码行数:33,代码来源:FavoritesScreen.cs
示例5: CreateOriginals
private void CreateOriginals(RootElement root)
{
originalSections = root.Sections.ToArray ();
originalElements = new Element [originalSections.Length][];
for (int i = 0; i < originalSections.Length; i++)
originalElements [i] = originalSections [i].Elements.ToArray ();
}
开发者ID:xNUTs,项目名称:CodeBucket,代码行数:7,代码来源:DialogViewController.cs
示例6: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
HeaderView.SetImage(null, Images.Avatar);
Title = ViewModel.Name;
ViewModel.Bind(x => x.User, x =>
{
var name = x.FirstName + " " + x.LastName;
HeaderView.SubText = string.IsNullOrWhiteSpace(name) ? x.Username : name;
HeaderView.SetImage(new Avatar(x.Avatar).ToUrl(128), Images.Avatar);
RefreshHeaderView();
var followers = new StyledStringElement("Followers", () => ViewModel.GoToFollowersCommand.Execute(null), Images.Heart);
var events = new StyledStringElement("Events", () => ViewModel.GoToEventsCommand.Execute(null), Images.Event);
var organizations = new StyledStringElement("Groups", () => ViewModel.GoToGroupsCommand.Execute(null), Images.Group);
var repos = new StyledStringElement("Repositories", () => ViewModel.GoToRepositoriesCommand.Execute(null), Images.Repo);
var members = new StyledStringElement("Members", () => ViewModel.GoToMembersCommand.Execute(null), Images.Team);
var midSec = new Section(new UIView(new CGRect(0, 0, 0, 20f))) { events, organizations, members, followers };
Root = new RootElement(Title) { midSec, new Section { repos } };
});
// if (!ViewModel.IsLoggedInUser)
// NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Action, (s, e) => ShowExtraMenu());
}
开发者ID:Jeff-Lewis,项目名称:CodeBucket,代码行数:25,代码来源:TeamView.cs
示例7: CreateNewRoot
RootElement CreateNewRoot(IEnumerable<IGrouping<string, Account>> accountsByGroup)
{
var root = new RootElement ("My Accounts");
var sections = from _group
in accountsByGroup
select new Section () { // i.e.: Deposits
from account in _group select
new AccountRootElement(account,true, StyleTransactionsScreen)
{
new Section() // Section for Account Header
{
new AccountElement(account, false) as Element,
},
new Section("Transactions") // Section for Transactions
{
// account.Transactions.Select(tx=> new StyledStringElement(tx.Description, string.Format (@"{0:M/d hh:mm tt} {1:C}",tx.OccuredOn, tx.Amount),UITableViewCellStyle.Subtitle) as Element),
account.Transactions.Select(tx=> new TransactionElement(tx) as Element),
},
} as Element
};
root.Add (sections);
return root;
}
开发者ID:eatskolnikov,项目名称:QBank,代码行数:28,代码来源:Accounts.cs
示例8: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
var bindings = this.CreateInlineBindingTarget<FirstViewModel>();
var passwordElement = new EntryElement("Password", "Enter Password").Bind(bindings, vm => vm.PasswordProperty);
passwordElement.Password = true;
Root = new RootElement("Example Root")
{
new Section("Your details")
{
new EntryElement("Login", "Enter Login name").Bind(bindings, vm => vm.TextProperty),
passwordElement,
},
new Section("Your options")
{
new BooleanElement("Remember me?").Bind(bindings, vm => vm.SwitchThis),
new CheckboxElement("Upgrade?").Bind(bindings, vm => vm.CheckThis),
},
new Section("Action")
{
new ButtonElement("Go").Bind(bindings, element => element.SelectedCommand, vm => vm.GoCommand)
},
new Section("Debug out:")
{
new StringElement("Login is:").Bind(bindings, vm => vm.TextProperty),
new StringElement("Password is:").Bind(bindings, vm => vm.PasswordProperty),
new StringElement("Remember is:").Bind(bindings, vm => vm.SwitchThis),
new StringElement("Upgrade is:").Bind(bindings, vm => vm.CheckThis),
},
};
}
开发者ID:JaccoRademaker,项目名称:MvvmCross-Tutorials,代码行数:34,代码来源:FirstView.cs
示例9: Initialize
private void Initialize()
{
Root = new RootElement("Flurry Analytics Portable")
{
new Section("Basics")
{
new StringElement("Flurry Supported").Bind(this, "Value IsFlurrySupported"),
new StringElement("Flurry Version").Bind(this, "Value FlurryVersion"),
new StringElement("Flurry API Key").Bind(this, "Value FlurryApiKey"),
},
new Section("User Information")
{
new EntryElement("User Id", "enter user id").Bind(this, "Value UserId"),
new EntryElement("User Age", "enter user age").Bind(this, "Value UserAge, Converter=Int"),
new SimplePickerElement("User Gender", null, null).Bind(this, "Value UserGender; Entries UserGender, Converter=EnumToEnumerable")
},
new Section("Location")
{
new StringElement("Latitude").Bind(this, "Value UserLocation.Coordinates.Latitude, Mode=TwoWay"),
new StringElement("Longitude").Bind(this, "Value UserLocation.Coordinates.Longitude"),
new StringElement("Accuracy").Bind(this, "Value UserLocation.Coordinates.Accuracy"),
},
new Section("Events")
{
new StyledStringElement("Show Events")
{
Accessory = UITableViewCellAccessory.DisclosureIndicator,
Font = UIFont.SystemFontOfSize(UIFont.LabelFontSize)
}.Bind(this, "SelectedCommand ShowEventsCommand"),
},
};
}
开发者ID:Mazooma-Interactive-Games,项目名称:Flurry.Analytics,代码行数:32,代码来源:MainView.cs
示例10: OnLoadingComplete
protected override void OnLoadingComplete()
{
base.OnLoadingComplete();
var bindings = this.CreateInlineBindingTarget<SpeakerViewModel>();
Root = new RootElement("Speaker Info")
{
new Section
{
new TransparentMultilineElement
{
Font = AppStyles.EntityTitleFont
}.Bind(bindings, el => el.Caption, vm => vm.Speaker.Name)
},
new Section
{
new StyledStringElement("Send Email") {
Accessory = UITableViewCellAccessory.DisclosureIndicator,
ShouldDeselectAfterTouch = true,
Image = UIImage.FromFile("compose.png"),
BackgroundColor = AppStyles.SemiTransparentCellBackgroundColor,
TextColor = AppStyles.ListTitleColor,
Font = AppStyles.ListTitleFont
}.Bind(bindings, el => el.SelectedCommand, vm => vm.EmailSpeakerCommand)
},
new Section
{
new TransparentMultilineElement()
.Bind(bindings, el => el.Caption, vm => vm.Speaker.Bio, "MultiLine")
}
};
Root.UnevenRows = true;
}
开发者ID:jorik041,项目名称:NycCodeCamp8,代码行数:34,代码来源:SpeakerView.cs
示例11: ResetDisplay
private void ResetDisplay()
{
string addressString = ViewModel.Customer.PrimaryAddress != null ? ViewModel.Customer.PrimaryAddress.ToString() : string.Empty;
var root = new RootElement("Customer Info")
{
new Section("Contact Info")
{
new StringElement("ID").Bind(this, "Value Customer.ID"),
new StringElement("Name").Bind(this, "Value Customer.Name"),
new StringElement("Website").Bind(this, "Value Customer.Website; SelectedCommand ShowWebsiteCommand"),
new StringElement("Primary Phone").Bind(this, "Value Customer.PrimaryPhone; SelectedCommand CallCustomerCommand"),
},
new Section("General Info")
{
new StyledMultilineElement("Address").Bind(this, "Value Customer.PrimaryAddress; SelectedCommand ShowOnMapCommand"),
//new StringElement("Previous Orders ", ViewModel.Customer.Orders != null ? ViewModel.Customer.Orders.Count.ToString() : string.Empty),
//new StringElement("Other Addresses ", ViewModel.Customer.Addresses != null ? ViewModel.Customer.Addresses.Count.ToString() : string.Empty),
//new StringElement("Contacts ", ViewModel.Customer.Contacts != null ? ViewModel.Customer.Contacts.Count.ToString() : string.Empty),
},
};
root.UnevenRows = true;
Root = root;
}
开发者ID:Coolerhino,项目名称:MvvmCross-Tutorials,代码行数:25,代码来源:CustomerView.cs
示例12: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
var root = new RootElement(Title)
{
new Section
{
new MultilinedElement("CodeBucket") { Value = About, CaptionColor = Theme.CurrentTheme.MainTitleColor, ValueColor = Theme.CurrentTheme.MainTextColor }
},
new Section
{
new StyledStringElement("Source Code", () => UIApplication.SharedApplication.OpenUrl(new NSUrl("https://github.com/thedillonb/CodeBucket")))
},
new Section(String.Empty, "Thank you for downloading. Enjoy!")
{
new StyledStringElement("Follow On Twitter", () => UIApplication.SharedApplication.OpenUrl(new NSUrl("https://twitter.com/Codebucketapp"))),
new StyledStringElement("Rate This App", () => UIApplication.SharedApplication.OpenUrl(new NSUrl("https://itunes.apple.com/us/app/codebucket/id551531422?mt=8"))),
new StyledStringElement("App Version", NSBundle.MainBundle.InfoDictionary.ValueForKey(new NSString("CFBundleVersion")).ToString())
}
};
root.UnevenRows = true;
Root = root;
}
开发者ID:jsuo,项目名称:CodeBucket,代码行数:25,代码来源:AboutView.cs
示例13: Core
private void Core()
{
var rootStyles = new RootElement ("Add New Styles");
var styleHeaderElement = new Section ("Style Header");
var manualEntryRootElement = new RootElement ("Manual Entry");
styleHeaderElement.Add (manualEntryRootElement);
var quickFillElement = new Section ("Quick Fill");
var womenTops = new RootElement ("Womens Tops");
var womenOutwear = new RootElement ("Womens Outerwear");
var womenSweaters = new RootElement ("Womens Sweaters");
quickFillElement.AddAll (new [] { womenTops, womenOutwear, womenSweaters });
rootStyles.Add (new [] { styleHeaderElement, quickFillElement });
// DialogViewController derives from UITableViewController, so access all stuff from it
var rootDialog = new DialogViewController (rootStyles);
rootDialog.NavigationItem.BackBarButtonItem = new UIBarButtonItem("Back", UIBarButtonItemStyle.Bordered, null);
EventHandler handler = (s, e) => {
if(_popover != null)
_popover.Dismiss(true);
};
rootDialog.NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Bordered, handler), true);
rootDialog.NavigationItem.SetRightBarButtonItem(new UIBarButtonItem("Create", UIBarButtonItemStyle.Bordered, null), true);
NavigationPopoverContentViewController = new UINavigationController (rootDialog);
}
开发者ID:semuserable,项目名称:Cloud9,代码行数:30,代码来源:PopoverContentViewControllerOld.cs
示例14: DialogViewControllerDemoListViewCustomCell
public DialogViewControllerDemoListViewCustomCell () : base (UITableViewStyle.Plain, null)
{
ElementDerivedCustom edc1 = new ElementDerivedCustom();
ElementDerivedCustom edc2 = new ElementDerivedCustom("UITableViewCellCustomHuzDaBoss");
ElementDerivedCustom edc3 = new ElementDerivedCustom("UITableViewCellCustomForList");
Root = new RootElement ("MTD")
{
new Section ("First Section"){
new StringElement
(
"Hello"
, () =>
{
new UIAlertView ("Hola", "Thanks for tapping!", null, "Continue")
.Show ();
}
),
new EntryElement ("Name", "Enter your name", String.Empty)
},
new Section ("Second Section")
{
new ElementDerivedCustom()
, edc1
, new ElementDerivedCustom()
, edc2
, edc3
, new ElementDerivedCustom("UITableViewCellCustomForList")
, new ElementDerivedCustom("UITableViewCellCustomHuzDaBoss")
},
};
}
开发者ID:moljac,项目名称:MonoTouch.Samples,代码行数:34,代码来源:DialogViewControllerDemoListViewCustomCell.cs
示例15: RenderIssue
public void RenderIssue()
{
if (ViewModel.Issue == null)
return;
var avatar = new Avatar(ViewModel.Issue.ReportedBy?.Avatar);
NavigationItem.RightBarButtonItem.Enabled = true;
HeaderView.Text = ViewModel.Issue.Title;
HeaderView.SetImage(avatar.ToUrl(), Images.Avatar);
HeaderView.SubText = ViewModel.Issue.Content ?? "Updated " + ViewModel.Issue.UtcLastUpdated.Humanize();
RefreshHeaderView();
var split = new SplitButtonElement();
split.AddButton("Comments", ViewModel.Comments.Items.Count.ToString());
split.AddButton("Watches", ViewModel.Issue.FollowerCount.ToString());
var root = new RootElement(Title);
root.Add(new Section { split });
var secDetails = new Section();
if (!string.IsNullOrEmpty(ViewModel.Issue.Content))
{
_descriptionElement.LoadContent(new MarkdownRazorView { Model = ViewModel.Issue.Content }.GenerateString());
secDetails.Add(_descriptionElement);
}
_split1.Button1.Text = ViewModel.Issue.Status;
_split1.Button2.Text = ViewModel.Issue.Priority;
secDetails.Add(_split1);
_split2.Button1.Text = ViewModel.Issue.Metadata.Kind;
_split2.Button2.Text = ViewModel.Issue.Metadata.Component ?? "No Component";
secDetails.Add(_split2);
_split3.Button1.Text = ViewModel.Issue.Metadata.Version ?? "No Version";
_split3.Button2.Text = ViewModel.Issue.Metadata.Milestone ?? "No Milestone";
secDetails.Add(_split3);
var assigneeElement = new StyledStringElement("Assigned", ViewModel.Issue.Responsible != null ? ViewModel.Issue.Responsible.Username : "Unassigned", UITableViewCellStyle.Value1) {
Image = AtlassianIcon.User.ToImage(),
Accessory = UITableViewCellAccessory.DisclosureIndicator
};
assigneeElement.Tapped += () => ViewModel.GoToAssigneeCommand.Execute(null);
secDetails.Add(assigneeElement);
root.Add(secDetails);
if (ViewModel.Comments.Any(x => !string.IsNullOrEmpty(x.Content)))
{
root.Add(new Section { _commentsElement });
}
var addComment = new StyledStringElement("Add Comment") { Image = AtlassianIcon.Addcomment.ToImage() };
addComment.Tapped += AddCommentTapped;
root.Add(new Section { addComment });
Root = root;
}
开发者ID:Mikoj,项目名称:CodeBucket,代码行数:59,代码来源:IssueView.cs
示例16: IndexedViewController
public IndexedViewController (RootElement root, bool pushing) : base (root, pushing)
{
// Indexed tables require this style.
Style = UITableViewStyle.Plain;
EnableSearch = true;
SearchPlaceholder = "Find item";
AutoHideSearch = true;
}
开发者ID:runegri,项目名称:Android.Dialog,代码行数:8,代码来源:DemoIndex.cs
示例17: SessionsView
public SessionsView()
: base(UITableViewStyle.Plain)
{
Root = new RootElement("Schedule");
Root.UnevenRows = true;
RefreshRequested += (s, e) => ViewModel.RefreshDataCommand.Execute(null);
}
开发者ID:jorik041,项目名称:NycCodeCamp8,代码行数:8,代码来源:SessionsView.cs
示例18: OverviewView
public OverviewView()
: base(UITableViewStyle.Plain)
{
Root = new RootElement("NYC Code Camp");
Root.UnevenRows = true;
RefreshRequested += (s, e) => ViewModel.RefreshDataCommand.Execute(null);
}
开发者ID:jorik041,项目名称:NycCodeCamp8,代码行数:8,代码来源:OverviewView.cs
示例19: StyleTransactionsScreen
UIViewController StyleTransactionsScreen (RootElement arg)
{
var dvc = new DialogViewController (UITableViewStyle.Plain, arg,true);
dvc.LoadView ();
dvc.Root.TableView.SeparatorColor = UIColor.FromPatternImage (Resources.CellSeparator);
dvc.Root.TableView.BackgroundView = new UIImageView (UIImage.FromBundle ("paper.png"));
return dvc;
}
开发者ID:eatskolnikov,项目名称:QBank,代码行数:9,代码来源:Accounts.cs
示例20: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
var bindings = this.CreateInlineBindingTarget<FirstViewModel>();
// note that this list isn't bound - if the view model list changes, then the UI won't update it;s list
var radioChoices = from r in (ViewModel as FirstViewModel).DessertChoices
select (Element)new RadioElement(r);
Root = new RootElement("Example Root")
{
new Section("Your details")
{
new EntryElement("Login", "Enter Login name").Bind(bindings, vm => vm.TextProperty),
new EntryElement("Password", "Enter Password", "", true).Bind(bindings, vm => vm.PasswordProperty)
},
new Section("Your options")
{
new BooleanElement("Remember me?", false).Bind(bindings, vm => vm.SwitchThis),
new CheckboxElement("Upgrade?").Bind(bindings, vm => vm.CheckThis),
},
new Section("Radio")
{
new RootElement("Dessert", new RadioGroup("Dessert", 0))
{
new Section()
{
radioChoices
}
}.Bind(bindings, e => e.RadioSelected, vm => vm.CurrentDessertIndex) as Element
},
new Section("Action")
{
new StyledStringElement("Second")
{
BackgroundColor = UIColor.Red,
TextColor = UIColor.Yellow,
Alignment = UITextAlignment.Right
}.Bind(bindings, element => element.SelectedCommand, vm => vm.GoSecondCommand),
new StyledStringElement("Bindable Elements") {
BackgroundColor = UIColor.Blue,
TextColor = UIColor.White,
Alignment = UITextAlignment.Center
}.Bind(bindings, element => element.SelectedCommand, vm => vm.BindableElementsCommand),
},
new Section("Debug out:")
{
new StringElement("Login is:").Bind(bindings, vm => vm.TextProperty),
new StringElement("Password is:").Bind(bindings, vm => vm.PasswordProperty),
new StringElement("Remember is:").Bind(bindings, vm => vm.SwitchThis),
new StringElement("Upgrade is:").Bind(bindings, vm => vm.CheckThis),
new StringElement("Selected Dessert Index is:").Bind(bindings, vm => vm.CurrentDessertIndex),
},
};
}
开发者ID:ChebMami38,项目名称:MvvmCross-Tutorials,代码行数:56,代码来源:FirstView.cs
注:本文中的RootElement类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论