private void CreateTable() { var application = Mvx.Resolve<IApplicationService>(); var vm = (SettingsViewModel)ViewModel; var currentAccount = application.Account; var showOrganizationsInEvents = new TrueFalseElement("Show Teams under Events", currentAccount.ShowTeamEvents, e => { currentAccount.ShowTeamEvents = e.Value; application.Accounts.Update(currentAccount); }); var showOrganizations = new TrueFalseElement("List Teams & Groups in Menu", currentAccount.ExpandTeamsAndGroups, e => { currentAccount.ExpandTeamsAndGroups = e.Value; application.Accounts.Update(currentAccount); }); var repoDescriptions = new TrueFalseElement("Show Repo Descriptions", currentAccount.RepositoryDescriptionInList, e => { currentAccount.RepositoryDescriptionInList = e.Value; application.Accounts.Update(currentAccount); }); var startupView = new StyledStringElement("Startup View", vm.DefaultStartupViewName, UIKit.UITableViewCellStyle.Value1) { Accessory = UIKit.UITableViewCellAccessory.DisclosureIndicator, }; startupView.Tapped += () => vm.GoToDefaultStartupViewCommand.Execute(null); //Assign the root var root = new RootElement(Title); root.Add(new Section()); root.Add(new Section { showOrganizationsInEvents, showOrganizations, repoDescriptions, startupView }); root.Add(new Section { new StyledStringElement("Source Code", () => UIApplication.SharedApplication.OpenUrl(new NSUrl("https://github.com/thedillonb/CodeBucket"))) }); root.Add(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; }
public override void ViewDidLoad() { base.ViewDidLoad(); var currentModel = _filterController.Filter.Clone(); //Load the root var root = new RootElement(Title) { new Section("Order By") { (_orderby = CreateEnumElement("Type", currentModel.OrderBy)), (_ascendingElement = new TrueFalseElement("Ascending", currentModel.Ascending)), }, new Section { new StyledStringElement("Save as Default", () => { _filterController.ApplyFilter(CreateFilterModel(), true); CloseViewController(); }, Images.Size) { Accessory = UITableViewCellAccessory.None }, } }; Root = root; }
private void CreateTable() { var application = Mvx.Resolve<IApplicationService>(); var vm = (SettingsViewModel)ViewModel; var currentAccount = application.Account; var showOrganizationsInEvents = new TrueFalseElement("Show Teams under Events", currentAccount.ShowTeamEvents, e => { currentAccount.ShowTeamEvents = e.Value; application.Accounts.Update(currentAccount); }); var showOrganizations = new TrueFalseElement("List Teams & Groups in Menu", currentAccount.ExpandTeamsAndGroups, e => { currentAccount.ExpandTeamsAndGroups = e.Value; application.Accounts.Update(currentAccount); }); var repoDescriptions = new TrueFalseElement("Show Repo Descriptions", currentAccount.RepositoryDescriptionInList, e => { currentAccount.RepositoryDescriptionInList = e.Value; application.Accounts.Update(currentAccount); }); var startupView = new StyledStringElement("Startup View", vm.DefaultStartupViewName, UIKit.UITableViewCellStyle.Value1) { Accessory = UIKit.UITableViewCellAccessory.DisclosureIndicator, }; startupView.Tapped += () => vm.GoToDefaultStartupViewCommand.Execute(null); //Assign the root var root = new RootElement(Title); root.Add(new Section("Apperance") { showOrganizationsInEvents, showOrganizations, repoDescriptions, startupView }); Root = root; }