Exemple #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            _presenter = new NotesViewPresenter(this);

            NavigationController.SetNavigationBarHidden(false, false);
            Title = NSBundle.MainBundle.GetLocalizedString(ConstantsHelper.Notes, ConstantsHelper.Notes);

            _sideMenuManager = new SideMenuManager();
            NavigationItem.SetLeftBarButtonItem(
                new UIBarButtonItem(ConstantsHelper.Menu, UIBarButtonItemStyle.Plain, (sender, e) => {
                PresentViewController(_sideMenuManager.LeftNavigationController, true, null);
            }),
                false);
            SetupSideMenu();

            NotesDataSource = new NotesDataSource(_presenter, this);

            _refreshControl = new UIRefreshControl();
            _refreshControl.ValueChanged += async(sender, args) =>
            {
                await Refresh();
            };

            TableView.RefreshControl = _refreshControl;
            TableView.RegisterClassForCellReuse(typeof(NoteCell), nameof(NoteCell));
            TableView.SeparatorColor = UIColor.Clear;
            TableView.Source         = new NotesDataSource(_presenter, this);

            var addButton = new UIBarButtonItem(UIBarButtonSystemItem.Add, NavigateToEditNoteController)
            {
                AccessibilityLabel = ConstantsHelper.AddNewNoteButtonAccessibilityLabel
            };

            NavigationItem.RightBarButtonItem = addButton;
        }
Exemple #2
0
 public NotesDataSource(NotesViewPresenter presenter, NotesController controller)
 {
     _presenter  = presenter;
     _controller = controller;
 }