public void UpdateContent(int projectId, Action <int> onButtonPress) { this.projectId = projectId; this.buttonCallback = onButtonPress; GetStartedButton.SetTitle(StringResources.projects_ui_get_started_button, UIControlState.Normal); GetStartedButton.Layer.BorderWidth = 1.0f; GetStartedButton.Layer.BorderColor = Application.MainColour; GetStartedButton.TouchUpInside -= ButtonTouched; GetStartedButton.TouchUpInside += ButtonTouched; }
public override void ViewDidLoad() { base.ViewDidLoad(); ExtendedNavbarView.BackgroundColor = NavigationController.NavigationBar.BackgroundColor; TimeTrackedTodayLabel.Font = TimeTrackedTodayLabel.Font.GetMonospacedDigitFont(); TitleLabel.Text = Resources.Welcome; DescriptionLabel.Text = Resources.CalendarFeatureDescription; GetStartedButton.SetTitle(Resources.GetStarted, UIControlState.Normal); settingsButton.SetImage(UIImage.FromBundle("icSettings"), UIControlState.Normal); ViewModel .ShouldShowOnboarding .FirstAsync() .Subscribe( shouldShowOnboarding => OnboardingView.Alpha = shouldShowOnboarding ? 1: 0) .DisposedBy(DisposeBag); ViewModel.ShouldShowOnboarding .Subscribe(OnboardingView.Rx().IsVisibleWithFade()) .DisposedBy(DisposeBag); GetStartedButton.Rx() .BindAction(ViewModel.GetStarted) .DisposedBy(DisposeBag); ViewModel.TimeTrackedToday .Subscribe(TimeTrackedTodayLabel.Rx().Text()) .DisposedBy(DisposeBag); ViewModel.CurrentDate .Subscribe(CurrentDateLabel.Rx().Text()) .DisposedBy(DisposeBag); dataSource = new CalendarCollectionViewSource( timeService, CalendarCollectionView, ViewModel.TimeOfDayFormat, ViewModel.CalendarItems); layout = new CalendarCollectionViewLayout(timeService, dataSource); editItemHelper = new CalendarCollectionViewEditItemHelper(CalendarCollectionView, timeService, dataSource, layout); createFromSpanHelper = new CalendarCollectionViewCreateFromSpanHelper(CalendarCollectionView, dataSource, layout); zoomHelper = new CalendarCollectionViewZoomHelper(CalendarCollectionView, layout); CalendarCollectionView.SetCollectionViewLayout(layout, false); CalendarCollectionView.Delegate = dataSource; CalendarCollectionView.DataSource = dataSource; CalendarCollectionView.ContentInset = new UIEdgeInsets(20, 0, 20, 0); dataSource.ItemTapped .Subscribe(ViewModel.OnItemTapped.Inputs) .DisposedBy(DisposeBag); settingsButton.Rx() .BindAction(ViewModel.SelectCalendars) .DisposedBy(DisposeBag); editItemHelper.EditCalendarItem .Subscribe(ViewModel.OnUpdateTimeEntry.Inputs) .DisposedBy(DisposeBag); editItemHelper.LongPressCalendarEvent .Subscribe(ViewModel.OnCalendarEventLongPressed.Inputs) .DisposedBy(DisposeBag); ViewModel.SettingsAreVisible .Subscribe(settingsButton.Rx().IsVisible()) .DisposedBy(DisposeBag); createFromSpanHelper.CreateFromSpan .Subscribe(ViewModel.OnDurationSelected.Inputs) .DisposedBy(DisposeBag); CalendarCollectionView.LayoutIfNeeded(); }