Ejemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            TitleLabel.Text = Resources.UpcomingEvent;

            TableView.ScrollEnabled   = false;
            TableView.TableFooterView = new UIView(CGRect.Empty);
            TableView.RegisterNibForCellReuse(UpcomingEventsOptionCell.Nib, UpcomingEventsOptionCell.Identifier);
            TableView.RowHeight = rowHeight;

            var source = new CustomTableViewSource <CalendarSectionModel, Unit, SelectableCalendarNotificationsOptionViewModel>(
                UpcomingEventsOptionCell.CellConfiguration(UpcomingEventsOptionCell.Identifier),
                ViewModel.AvailableOptions
                );

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

            TableView.Source = source;

            CloseButton.Rx()
            .BindAction(ViewModel.Close)
            .DisposedBy(DisposeBag);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            TitleLabel.Text             = Resources.CountryOfResidence;
            SearchTextField.Placeholder = Resources.Search;

            CountriesTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
            CountriesTableView.RegisterNibForCellReuse(CountryViewCell.Nib, CountryViewCell.Identifier);
            CountriesTableView.RowHeight = rowHeight;

            var source = new CustomTableViewSource <SectionModel <string, SelectableCountryViewModel>, string, SelectableCountryViewModel>(
                CountryViewCell.CellConfiguration(CountryViewCell.Identifier));

            CountriesTableView.Source = source;

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

            ViewModel.Countries
            .Subscribe(CountriesTableView.Rx().ReloadItems(source))
            .DisposedBy(DisposeBag);

            CloseButton.Rx().Tap()
            .Subscribe(ViewModel.CloseWithDefaultResult)
            .DisposedBy(DisposeBag);

            SearchTextField.Rx().Text()
            .Subscribe(ViewModel.FilterText)
            .DisposedBy(DisposeBag);

            SearchTextField.BecomeFirstResponder();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            WorkspaceTableView.RowHeight      = rowHeight;
            WorkspaceTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
            WorkspaceTableView.RegisterNibForCellReuse(WorkspaceViewCell.Nib, WorkspaceViewCell.Identifier);

            var source = new CustomTableViewSource <Unit, SelectableWorkspaceViewModel>(
                WorkspaceViewCell.CellConfiguration(WorkspaceViewCell.Identifier),
                ViewModel.Workspaces
                );

            WorkspaceTableView.Source = source;

            TitleLabel.Text = ViewModel.Title;

            CloseButton.Rx()
            .BindAction(ViewModel.Close)
            .DisposedBy(DisposeBag);

            source.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectWorkspace.Inputs)
            .DisposedBy(DisposeBag);
        }
Ejemplo n.º 4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = Resources.Licenses;

            TableView.EstimatedRowHeight  = 396;
            TableView.SectionHeaderHeight = 44;
            TableView.RowHeight           = UITableView.AutomaticDimension;

            TableView.RegisterNibForCellReuse(LicensesViewCell.Nib, LicensesViewCell.Identifier);
            TableView.RegisterNibForHeaderFooterViewReuse(LicensesHeaderViewCell.Nib,
                                                          LicensesHeaderViewCell.Identifier);

            var sectionedLicenses = ViewModel.Licenses
                                    .Select(license => new SectionModel <License, License>(license, new[] { license }))
                                    .ToImmutableList();

            var source = new CustomTableViewSource <SectionModel <License, License>, License, License>(
                LicensesViewCell.CellConfiguration(LicensesViewCell.Identifier),
                LicensesHeaderViewCell.HeaderConfiguration,
                sectionedLicenses
                );

            TableView.Source = source;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            WorkspaceTableView.RowHeight      = rowHeight;
            WorkspaceTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
            WorkspaceTableView.RegisterNibForCellReuse(WorkspaceViewCell.Nib, WorkspaceViewCell.Identifier);

            var source = new CustomTableViewSource <SectionModel <Unit, SelectableWorkspaceViewModel>, Unit, SelectableWorkspaceViewModel>(
                WorkspaceViewCell.CellConfiguration(WorkspaceViewCell.Identifier),
                ViewModel.Workspaces
                );

            WorkspaceTableView.Source = source;

            TitleLabel.Text = ViewModel.Title;

            CloseButton.Rx()
            .BindAction(ViewModel.Close)
            .DisposedBy(DisposeBag);

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

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                PreferredContentSize = new CoreGraphics.CGSize(0, headerHeight + (ViewModel.Workspaces.Count * rowHeight));
            }
        }
Ejemplo n.º 6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            SetUpTableView(attributesList, AttributeItemCell.Nib, AttributeItemCell.Identifier);

            _tableSource          = new CustomTableViewSource(attributesList, AttributeItemCell.Identifier);
            attributesList.Source = _tableSource;
            locationLabel.Hidden  = true;

            var set = CreateBindingSet <AttributedView>();

            set.Bind(nameField).For(f => f.Placeholder).To(vm => vm.NamePlaceholderText);
            set.Bind(locationField).For(f => f.Placeholder).To(vm => vm.LocationPlaceholderText);
            set.Bind(nameField).To(vm => vm.Name);
            set.Bind(locationField).To(vm => vm.Location);
            set.Bind(addAttributeButton).To(vm => vm.AddAttributeCommand);
            set.Bind(saveButton).To(vm => vm.SaveCommand);
            set.Bind(cancelButton).To(vm => vm.CancelCommand);

            set.Bind(_tableSource).To(vm => vm.Attributes);
            set.Bind(_tableSource).For(t => t.SelectionChangedCommand).To(vm => vm.AttributeSelectedCommand);
            set.Apply();

            ViewModel.Initialize().ContinueWith(_ => attributesList.ReloadData());
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            TableView.RowHeight = UITableView.AutomaticDimension;
            TableView.RegisterNibForCellReuse(SyncFailureCell.Nib, SyncFailureCell.Identifier);
            var tableViewSource = new CustomTableViewSource <SectionModel <Unit, SyncFailureItem>, Unit, SyncFailureItem>(
                SyncFailureCell.CellConfiguration(SyncFailureCell.Identifier),
                ViewModel.SyncFailures
                );

            TableView.Source = tableViewSource;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            HeadingLabel.Text     = Resources.SetDefaultWorkspace;
            DescriptionLabel.Text = Resources.SelectDefaultWorkspaceDescription;

            View.ClipsToBounds = true;

            WorkspacesTableView.RegisterNibForCellReuse(SelectDefaultWorkspaceTableViewCell.Nib, SelectDefaultWorkspaceTableViewCell.Identifier);
            var tableViewSource = new CustomTableViewSource <SectionModel <Unit, SelectableWorkspaceViewModel>, Unit, SelectableWorkspaceViewModel>(
                SelectDefaultWorkspaceTableViewCell.CellConfiguration(SelectDefaultWorkspaceTableViewCell.Identifier),
                ViewModel.Workspaces
                );

            tableViewSource.OnItemTapped        = onWorkspaceTapped;
            WorkspacesTableView.Source          = tableViewSource;
            WorkspacesTableView.TableFooterView = new UIKit.UIView(new CoreGraphics.CGRect(0, 0, UIKit.UIScreen.MainScreen.Bounds.Width, 24));
        }
Ejemplo n.º 9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SetUpTableView(assessmentList, AttributedListItemCell.Nib, AttributedListItemCell.Identifier);

            _tableSource          = new CustomTableViewSource(assessmentList, AttributedListItemCell.Identifier);
            assessmentList.Source = _tableSource;

            var set = CreateBindingSet <AttributedListView> ();

            set.Bind(_tableSource).To(vm => vm.Items);
            set.Bind(_tableSource).For(t => t.SelectionChangedCommand).To(vm => vm.ItemSelectedCommand);

            set.Apply();

            assessmentList.ReloadData();

            ViewModel.Initialize();
        }
Ejemplo n.º 10
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            prepareSiriButton();

            NavigationItem.Title          = Resources.ReportPeriod;
            SelectWorkspaceCellLabel.Text = Resources.SelectWorkspace;

            TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
            TableView.RegisterNibForCellReuse(SiriShortcutReportPeriodCell.Nib, SiriShortcutReportPeriodCell.Identifier);

            TableView.RowHeight       = rowHeight;
            TableView.TableFooterView = TableFooterView;

            var source =
                new CustomTableViewSource <ReportSection, Unit,
                                           SelectableReportPeriodViewModel>(
                    SiriShortcutReportPeriodCell.CellConfiguration(SiriShortcutReportPeriodCell.Identifier)
                    );

            ViewModel.ReportPeriods
            .Subscribe(TableView.Rx().ReloadItems(source))
            .DisposedBy(DisposeBag);

            source.Rx().ModelSelected()
            .Select(p => p.ReportPeriod)
            .Subscribe(ViewModel.SelectReportPeriod.Accept)
            .DisposedBy(DisposeBag);

            TableView.Source = source;

            SelectWorkspaceView.Rx()
            .BindAction(ViewModel.PickWorkspace)
            .DisposedBy(DisposeBag);

            ViewModel.WorkspaceName
            .Subscribe(SelectWorkspaceNameLabel.Rx().Text())
            .DisposedBy(DisposeBag);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = Resources.SiriWorkflows;

            HeaderLabel.Text = Resources.SiriWorkflowsDescription;
            HeaderView.RemoveFromSuperview();
            HeaderView.BackgroundColor = Colors.Siri.HeaderBackground.ToNativeColor();
            TableView.TableHeaderView  = HeaderView;
            HeaderView.TranslatesAutoresizingMaskIntoConstraints = false;
            HeaderView.WidthAnchor.ConstraintEqualTo(TableView.WidthAnchor).Active = true;

            TableView.SeparatorStyle  = UITableViewCellSeparatorStyle.None;
            TableView.BackgroundColor = Colors.Siri.HeaderBackground.ToNativeColor();
            TableView.TableFooterView = new UIView();
            TableView.ContentInset    = new UIEdgeInsets(0, 0, 20, 0);

            TableView.RegisterNibForCellReuse(SiriWorkflowCell.Nib, SiriWorkflowCell.Identifier);
            TableView.RowHeight = UITableView.AutomaticDimension;

            var source = new CustomTableViewSource <SectionModel <Unit, SiriWorkflow>, Unit, SiriWorkflow>(
                SiriWorkflowCell.CellConfiguration(SiriWorkflowCell.Identifier)
                );

            downloadJson()
            .Select(JsonConvert.DeserializeObject <List <SiriWorkflow> >)
            .Select(list => list.ToImmutableList())
            .ObserveOn(IosDependencyContainer.Instance.SchedulerProvider.MainScheduler)
            .Subscribe(TableView.Rx().ReloadItems(source))
            .DisposedBy(DisposeBag);

            source.Rx().ModelSelected()
            .Subscribe(workflowSelected)
            .DisposedBy(DisposeBag);

            TableView.Source = source;
        }
Ejemplo n.º 12
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            TitleLabel.Text = Resources.FirstDayOfTheWeek;

            DaysTableView.RegisterNibForCellReuse(DayOfWeekViewCell.Nib, DayOfWeekViewCell.Identifier);

            var source = new CustomTableViewSource <SectionModel <Unit, SelectableBeginningOfWeekViewModel>, Unit, SelectableBeginningOfWeekViewModel>(
                DayOfWeekViewCell.CellConfiguration(DayOfWeekViewCell.Identifier),
                ViewModel.BeginningOfWeekCollection
                );

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

            DaysTableView.Source = source;

            BackButton.Rx()
            .BindAction(ViewModel.Close)
            .DisposedBy(DisposeBag);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            TitleLabel.Text = Resources.DurationFormat;

            DurationFormatsTableView.RowHeight = rowHeight;
            DurationFormatsTableView.RegisterNibForCellReuse(DurationFormatViewCell.Nib, DurationFormatViewCell.Identifier);

            var source = new CustomTableViewSource <SectionModel <Unit, SelectableDurationFormatViewModel>, Unit, SelectableDurationFormatViewModel>(
                DurationFormatViewCell.CellConfiguration(DurationFormatViewCell.Identifier),
                ViewModel.DurationFormats
                );

            DurationFormatsTableView.Source = source;

            source.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectDurationFormat.Inputs)
            .DisposedBy(disposeBag);

            BackButton.Rx()
            .BindAction(ViewModel.Close)
            .DisposedBy(disposeBag);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            TitleLabel.Text = Resources.DateFormat;

            DateFormatsTableView.RegisterNibForCellReuse(DateFormatViewCell.Nib, DateFormatViewCell.Identifier);
            DateFormatsTableView.RowHeight = rowHeight;

            var source = new CustomTableViewSource <SectionModel <string, SelectableDateFormatViewModel>, string, SelectableDateFormatViewModel>(
                DateFormatViewCell.CellConfiguration(DateFormatViewCell.Identifier),
                ViewModel.DateTimeFormats
                );

            DateFormatsTableView.Source = source;

            source.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectDateFormat.Inputs)
            .DisposedBy(disposeBag);

            BackButton.Rx().Tap()
            .Subscribe(ViewModel.CloseWithDefaultResult)
            .DisposedBy(disposeBag);
        }