コード例 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            HeadingLabel.Text     = Resources.SelectCalendars;
            DescriptionLabel.Text = Resources.SelectCalendarsDescription;
            DoneButton.SetTitle(Resources.Done, UIControlState.Normal);

            var source = new SelectUserCalendarsTableViewSource(TableView);

            TableView.Source = source;

            DoneButton.Rx()
            .BindAction(ViewModel.Done)
            .DisposedBy(DisposeBag);

            source.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectCalendar.Inputs)
            .DisposedBy(DisposeBag);

            ViewModel.Done.Enabled
            .Subscribe(DoneButton.Rx().Enabled())
            .DisposedBy(DisposeBag);

            ViewModel.Done.Enabled
            .Select(alphaForEnabled)
            .Subscribe(DoneButton.Rx().AnimatedAlpha())
            .DisposedBy(DisposeBag);

            ViewModel.Calendars
            .Subscribe(TableView.Rx().ReloadSections(source))
            .DisposedBy(DisposeBag);
        }
コード例 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            NavigationItem.Title = FoundationResources.CalendarSettingsTitle;

            var header = CalendarSettingsTableViewHeader.Create();

            UserCalendarsTableView.TableHeaderView           = header;
            header.TranslatesAutoresizingMaskIntoConstraints = false;
            header.HeightAnchor.ConstraintEqualTo(tableViewHeaderHeight).Active             = true;
            header.WidthAnchor.ConstraintEqualTo(UserCalendarsTableView.WidthAnchor).Active = true;
            header.SetCalendarPermissionStatus(ViewModel.PermissionGranted);

            var source = new SelectUserCalendarsTableViewSource(UserCalendarsTableView);

            source.SectionHeaderBackgroundColor = Colors.Settings.Background.ToNativeColor();
            UserCalendarsTableView.Source       = source;

            ViewModel.Calendars
            .Subscribe(UserCalendarsTableView.Rx().ReloadSections(source))
            .DisposedBy(DisposeBag);

            header.EnableCalendarAccessTapped
            .Subscribe(ViewModel.RequestAccess.Inputs)
            .DisposedBy(DisposeBag);

            source.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectCalendar.Inputs)
            .DisposedBy(DisposeBag);
        }
コード例 #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var source = new SelectUserCalendarsTableViewSource(TableView, ViewModel.Calendars);

            TableView.Source = source;

            this.Bind(DoneButton.Rx().Tap(), ViewModel.DoneAction);
            this.Bind(source.ItemSelected, ViewModel.SelectCalendarAction);
            this.Bind(ViewModel.DoneAction.Enabled, DoneButton.Rx().Enabled());
            this.Bind(ViewModel.DoneAction.Enabled.Select(alphaForEnabled), DoneButton.Rx().AnimatedAlpha());
        }
コード例 #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            NavigationItem.Title = FoundationResources.CalendarSettingsTitle;

            var header = CalendarSettingsTableViewHeader.Create();

            UserCalendarsTableView.TableHeaderView           = header;
            header.TranslatesAutoresizingMaskIntoConstraints = false;
            header.HeightAnchor.ConstraintEqualTo(tableViewHeaderHeight).Active             = true;
            header.WidthAnchor.ConstraintEqualTo(UserCalendarsTableView.WidthAnchor).Active = true;
            header.SetCalendarPermissionStatus(ViewModel.PermissionGranted);

            var source = new SelectUserCalendarsTableViewSource(UserCalendarsTableView, ViewModel.Calendars);

            source.SectionHeaderBackgroundColor = Color.Settings.Background.ToNativeColor();
            UserCalendarsTableView.Source       = source;

            this.Bind(header.EnableCalendarAccessTapped, ViewModel.RequestAccessAction);
            this.Bind(source.ItemSelected, ViewModel.SelectCalendarAction);
        }