Ejemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CloseButton.SetTemplateColor(ColorAssets.Text2);

            SearchView.InsertSeparator();

            TitleLabel.Text       = Resources.Tags;
            TextField.Placeholder = Resources.AddFilterTags;
            EmptyStateLabel.Text  = Resources.EmptyTagText;
            SaveButton.SetTitle(Resources.Save, UIControlState.Normal);

            var tableViewSource = new SelectTagsTableViewSource(TagsTableView);

            tableViewSource.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectTag.Inputs)
            .DisposedBy(DisposeBag);

            tableViewSource.Rx().DragStarted()
            .Subscribe(_ => TextField.ResignFirstResponder())
            .DisposedBy(DisposeBag);

            var tagsReplay = ViewModel.Tags.Replay();

            tagsReplay
            .Subscribe(TagsTableView.Rx().ReloadItems(tableViewSource))
            .DisposedBy(DisposeBag);

            tagsReplay.Connect();

            ViewModel.IsEmpty
            .Subscribe(EmptyStateImage.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.IsEmpty
            .Subscribe(EmptyStateLabel.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.FilterText
            .Subscribe(TextField.Rx().TextObserver())
            .DisposedBy(DisposeBag);

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

            SaveButton.Rx()
            .BindAction(ViewModel.Save)
            .DisposedBy(DisposeBag);

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

            BottomConstraint.Active |= TraitCollection.HorizontalSizeClass == UIUserInterfaceSizeClass.Compact;
        }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CloseButton.SetTemplateColor(ColorAssets.Text2);

            SearchView.InsertSeparator();

            TitleLabel.Text      = Resources.Projects;
            EmptyStateLabel.Text = Resources.EmptyProjectText;

            var source = new SelectProjectTableViewSource();

            source.RegisterViewCells(ProjectsTableView);

            source.UseGrouping = ViewModel.UseGrouping;

            ProjectsTableView.TableFooterView = new UIView();
            ProjectsTableView.Source          = source;

            source.Rx().DragStarted()
            .Subscribe(_ => TextField.ResignFirstResponder())
            .DisposedBy(DisposeBag);

            ViewModel.Suggestions
            .Subscribe(ProjectsTableView.Rx().ReloadSections(source))
            .DisposedBy(DisposeBag);

            ViewModel.IsEmpty
            .Subscribe(EmptyStateLabel.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.IsEmpty
            .Subscribe(EmptyStateImage.Rx().IsVisible())
            .DisposedBy(DisposeBag);

            ViewModel.PlaceholderText
            .Subscribe(TextField.Rx().PlaceholderText())
            .DisposedBy(DisposeBag);

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

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

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

            source.ToggleTaskSuggestions
            .Subscribe(ViewModel.ToggleTaskSuggestions.Inputs)
            .DisposedBy(DisposeBag);
        }
Ejemplo n.º 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CloseButton.SetTemplateColor(ColorAssets.Text2);
            SearchView.InsertSeparator();

            TitleLabel.Text             = Resources.Clients;
            SearchTextField.Placeholder = Resources.AddFilterClients;

            SuggestionsTableView.RegisterNibForCellReuse(ClientViewCell.Nib, ClientViewCell.Identifier);
            SuggestionsTableView.RegisterNibForCellReuse(CreateClientViewCell.Nib, CreateClientViewCell.Identifier);
            SuggestionsTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;

            var tableViewSource = new ClientTableViewSource(SuggestionsTableView);

            SuggestionsTableView.Source = tableViewSource;

            tableViewSource.Rx().DragStarted()
            .Subscribe(_ => SearchTextField.ResignFirstResponder())
            .DisposedBy(DisposeBag);

            var clientsReplay = ViewModel.Clients.Replay();

            clientsReplay
            .Subscribe(SuggestionsTableView.Rx().ReloadItems(tableViewSource))
            .DisposedBy(DisposeBag);

            clientsReplay.Connect();

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

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

            tableViewSource.Rx().ModelSelected()
            .Subscribe(ViewModel.SelectClient.Inputs)
            .DisposedBy(DisposeBag);

            BottomConstraint.Active |= TraitCollection.HorizontalSizeClass == UIUserInterfaceSizeClass.Compact;
        }
Ejemplo n.º 4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            SearchView.InsertSeparator();

            CloseButton.SetTemplateColor(ColorAssets.Text2);
            SearchTextField.TintColor = ColorAssets.Text2;

            TitleLabel.Text = Resources.CountryOfResidence;

            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();
        }