public override void ViewDidLoad() { base.ViewDidLoad(); var split = new SplitButtonElement(); var contributors = split.AddButton("Contributors", "-"); var lastCommit = split.AddButton("Last Commit", "-"); var addFeatureButton = new BigButtonElement("Suggest a feature", Octicon.LightBulb.ToImage()); var addBugButton = new BigButtonElement("Report a bug", Octicon.Bug.ToImage()); var featuresButton = new BigButtonElement("Submitted Work Items", Octicon.Clippy.ToImage()); HeaderView.SubText = "This app is the product of hard work and great suggestions! Thank you to all whom provide feedback!"; HeaderView.Image = UIImage.FromFile("*****@*****.**"); Root.Reset(new Section { split }, new Section { addFeatureButton, addBugButton }, new Section { featuresButton }); OnActivation(d => { d(addFeatureButton.Clicked.InvokeCommand(ViewModel.GoToSuggestFeatureCommand)); d(addBugButton.Clicked.InvokeCommand(ViewModel.GoToReportBugCommand)); d(featuresButton.Clicked.InvokeCommand(ViewModel.GoToFeedbackCommand)); d(HeaderView.Clicked.InvokeCommand(ViewModel.GoToRepositoryCommand)); d(this.WhenAnyValue(x => x.ViewModel.Contributors).Where(x => x.HasValue).SubscribeSafe(x => contributors.Text = (x.Value >= 100 ? "100+" : x.Value.ToString()))); d(this.WhenAnyValue(x => x.ViewModel.LastCommit).Where(x => x.HasValue).SubscribeSafe(x => lastCommit.Text = x.Value.UtcDateTime.Humanize())); }); }
public override void ViewDidLoad() { base.ViewDidLoad(); var split = new SplitButtonElement(); var contributors = split.AddButton("Contributors", "-"); var lastCommit = split.AddButton("Last Commit", "-"); var addFeatureButton = new BigButtonElement("Suggest a feature", Octicon.LightBulb); var addBugButton = new BigButtonElement("Report a bug", Octicon.Bug); var featuresButton = new BigButtonElement("Submitted Work Items", Octicon.Clippy); HeaderView.SubText = "This app is the product of hard work and great suggestions! Thank you to all whom provide feedback!"; HeaderView.Image = UIImage.FromBundle("AppIcons60x60"); NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = "" }; Root.Reset( new Section { split }, new Section { addFeatureButton, addBugButton }, new Section { featuresButton }); OnActivation(d => { d(addFeatureButton.Clicked .Select(_ => FeedbackComposerViewController.CreateAsFeature()) .Select(viewCtrl => new ThemedNavigationController(viewCtrl)) .Subscribe(viewCtrl => PresentViewController(viewCtrl, true, null))); d(addBugButton.Clicked .Select(_ => FeedbackComposerViewController.CreateAsBug()) .Select(viewCtrl => new ThemedNavigationController(viewCtrl)) .Subscribe(viewCtrl => PresentViewController(viewCtrl, true, null))); d(this.WhenAnyValue(x => x.ViewModel.Title) .Subscribe(title => Title = title)); d(featuresButton.Clicked .Subscribe(_ => this.PushViewController(new FeedbackViewController()))); d(HeaderView.Clicked.Subscribe(_ => GoToRepository())); d(this.WhenAnyValue(x => x.ViewModel.Contributors) .Where(x => x.HasValue) .Subscribe(x => contributors.Text = (x.Value >= 100 ? "100+" : x.Value.ToString()))); d(this.WhenAnyValue(x => x.ViewModel.LastCommit) .Where(x => x.HasValue) .Subscribe(x => lastCommit.Text = x.Value.UtcDateTime.Humanize())); }); Appearing .Take(1) .Select(_ => Unit.Default) .InvokeReactiveCommand(ViewModel.LoadCommand); }
public override void ViewDidLoad() { base.ViewDidLoad(); var split = new SplitButtonElement(); var contributors = split.AddButton("Contributors", "-"); var lastCommit = split.AddButton("Last Commit", "-"); var openIssue = new BigButtonElement("Open an Issue on GitHub", Octicon.Bug); var sendEmail = new BigButtonElement("Email Support", Octicon.Mail); var openIssues = new BigButtonElement("Existing Issues", Octicon.IssueOpened); HeaderView.SubText = "This app is the product of hard work and great suggestions! Thank you to all whom provide feedback!"; HeaderView.Image = UIImage.FromBundle("AppIcons60x60"); NavigationItem.BackBarButtonItem = new UIBarButtonItem { Title = "" }; Root.Reset( new Section { split }, new Section(null, "Opening an issue on the GitHub project page is the fastest way to get a response.") { openIssue, openIssues }, new Section(), new Section(null, "Emails are answered as quickly as possible but there is only one person answering them so expect a delay.") { sendEmail }); OnActivation(d => { d(openIssue.Clicked .Select(_ => new FeedbackComposerViewController()) .Select(viewCtrl => new ThemedNavigationController(viewCtrl)) .Subscribe(viewCtrl => PresentViewController(viewCtrl, true, null))); d(sendEmail.Clicked.Subscribe(_ => SendEmail())); d(this.WhenAnyValue(x => x.ViewModel.Title) .Subscribe(title => Title = title)); d(openIssues.Clicked .Subscribe(_ => this.PushViewController(new FeedbackViewController()))); d(HeaderView.Clicked.Subscribe(_ => GoToRepository())); d(this.WhenAnyValue(x => x.ViewModel.Contributors) .Where(x => x.HasValue) .Subscribe(x => contributors.Text = (x.Value >= 100 ? "100+" : x.Value.ToString()))); d(this.WhenAnyValue(x => x.ViewModel.LastCommit) .Where(x => x.HasValue) .Subscribe(x => lastCommit.Text = x.Value.UtcDateTime.Humanize())); }); Appearing .Take(1) .Select(_ => Unit.Default) .InvokeReactiveCommand(ViewModel.LoadCommand); }