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));
            }
        }
        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);
        }
Exemplo n.º 3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            WorkspaceTableView.SeparatorStyle = UITableViewCellSeparatorStyle.None;
            WorkspaceTableView.RegisterNibForCellReuse(WorkspaceViewCell.Nib, WorkspaceViewCell.Identifier);
            WorkspaceTableView.Source = tableViewSource;

            TitleLabel.Text = ViewModel.Title;

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

            tableViewSource.WorkspaceSelected
            .Subscribe(ViewModel.SelectWorkspace.Inputs)
            .DisposedBy(DisposeBag);

            replaceWorkspaces(ViewModel.Workspaces);
        }