Example #1
0
        void SegmentValueChanged(object sender, EventArgs e)
        {
            var application = Mvx.Resolve <IApplicationService>();

            // If there is searching going on. Finish it.
            FinishSearch();

            if (_viewSegment.SelectedSegment == 0)
            {
                ViewModel.Issues.ApplyFilter(IssuesFilterModel.CreateOpenFilter(), true);
            }
            else if (_viewSegment.SelectedSegment == 1)
            {
                ViewModel.Issues.ApplyFilter(IssuesFilterModel.CreateClosedFilter(), true);
            }
            else if (_viewSegment.SelectedSegment == 2)
            {
                ViewModel.Issues.ApplyFilter(IssuesFilterModel.CreateMineFilter(application.Account.Username), true);
            }
            else if (_viewSegment.SelectedSegment == 3)
            {
                var filter = new IssuesFilterViewController(ViewModel.Username, ViewModel.Repository, ViewModel.Issues);
                var nav    = new UINavigationController(filter);
                PresentViewController(nav, true, null);
            }
        }
Example #2
0
        public override void ViewWillAppear(bool animated)
        {
            if (ToolbarItems != null)
            {
                NavigationController.SetToolbarHidden(false, animated);
            }
            base.ViewWillAppear(animated);

            //Before we select which one, make sure we detach the event handler or silly things will happen
            _viewSegment.ValueChanged -= SegmentValueChanged;

            var application = Mvx.Resolve <IApplicationService>();

            //Select which one is currently selected
            if (ViewModel.Issues.Filter.Equals(IssuesFilterModel.CreateOpenFilter()))
            {
                _viewSegment.SelectedSegment = 0;
            }
            else if (ViewModel.Issues.Filter.Equals(IssuesFilterModel.CreateClosedFilter()))
            {
                _viewSegment.SelectedSegment = 1;
            }
            else if (ViewModel.Issues.Filter.Equals(IssuesFilterModel.CreateMineFilter(application.Account.Username)))
            {
                _viewSegment.SelectedSegment = 2;
            }
            else
            {
                _viewSegment.SelectedSegment = 3;
            }

            _viewSegment.ValueChanged += SegmentValueChanged;
        }
Example #3
0
 void SegmentValueChanged(object sender, EventArgs e)
 {
     if (_viewSegment.SelectedSegment == 0)
     {
         ViewModel.Issues.ApplyFilter(IssuesFilterModel.CreateOpenFilter(), true);
     }
     else if (_viewSegment.SelectedSegment == 1)
     {
         ViewModel.Issues.ApplyFilter(IssuesFilterModel.CreateClosedFilter(), true);
     }
     else if (_viewSegment.SelectedSegment == 2)
     {
         ViewModel.Issues.ApplyFilter(IssuesFilterModel.CreateMineFilter(Application.Account.Username), true);
     }
     else if (_viewSegment.SelectedSegment == 3)
     {
         var filter = new IssuesFilterViewController(ViewModel.User, ViewModel.Slug, ViewModel.Issues);
         var nav    = new UINavigationController(filter);
         PresentViewController(nav, true, null);
     }
 }
Example #4
0
        void SegmentValueChanged(object sender, EventArgs e)
        {
            // If there is searching going on. Finish it.
            //FinishSearch();

            if (_viewSegment.SelectedSegment == 0)
            {
                ViewModel.Filter = IssuesFilterModel.CreateOpenFilter();
            }
            else if (_viewSegment.SelectedSegment == 1)
            {
                ViewModel.Filter = IssuesFilterModel.CreateClosedFilter();
            }
            else if (_viewSegment.SelectedSegment == 2)
            {
                ViewModel.Filter = IssuesFilterModel.CreateMineFilter(_applicationService.Account.Username);
            }
            else if (_viewSegment.SelectedSegment == 3)
            {
                //ShowFilterController(new IssuesFilterViewController(ViewModel.RepositoryOwner, ViewModel.RepositoryName, ViewModel.Issues));
            }
        }