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


            NewList = new List <NewsEntity>();

            //NewListPerWeek = new List<NewsEntity>();

            CreateData(List);

            _todayweek       = DateTime.Today.ToIso8601Weeknumber();
            tableView.Source = new DetailTableSource(NewListPerWeek, this);
            _cellDelegate    = new CellDelegate(NewListPerWeek, tableView, this);
            FilterDataByWeek(_todayweek);
            NavigationItem.SetLeftBarButtonItem(new UIBarButtonItem(UIImage.FromBundle("IconBack"), UIBarButtonItemStyle.Plain, (sender, args) =>
            {
                NavigationController.PopViewController(true);
            }), true);
            NavigationItem.SetRightBarButtonItem(new UIBarButtonItem(UIImage.FromBundle("Add"), UIBarButtonItemStyle.Plain, (sender, args) =>
            {
                var editVc = Storyboard.InstantiateViewController("CreateEditNewsViewController") as CreateEditNewsViewController;
                if (editVc == null)
                {
                    return;
                }
                var createEditNavigationController = new UINavigationController(editVc);
                NavigationController.PresentViewController(createEditNavigationController, true, null);
            }), true);
        }
Example #2
0
 void FilterDataByWeek(int weekInt)
 {
     NewListPerWeek   = NewList.Where(x => x.Week.ToIso8601Weeknumber() == weekInt).ToList();
     weekLabel.Text   = "Week " + _todayweek + " | " + DateTime.Today.Year;
     tableView.Source = new DetailTableSource(NewListPerWeek, this);
     _cellDelegate    = new CellDelegate(NewListPerWeek, tableView, this);
     ReloadDataTableView();
 }