コード例 #1
0
        public AddLocationTableViewSource(List <Location> items, AddLocationViewController tvc)
        {
            TableItems = items;
            viewModel  = new LocationsViewLocationViewModel(items.ToArray());

            addLocationViewController = tvc;
        }
コード例 #2
0
		public void UpdateCell(LocationsViewLocationViewModel viewModel, NSIndexPath indexPath, NSString cellId)
		{
			TableViewCellId = cellId;
			var section = indexPath.Section;
			var row = indexPath.Row;


			if (TableViewCellId == LocationsCellId)
			{
			    switch (section)
                {
                    case (int)LocationsSection.current:
                        mainLabel.Text = viewModel.MyLocationName();
                        secondaryLabel.Text = viewModel.MyLocationAsString();
                        break;

                    case (int)LocationsSection.favorite:
                        mainLabel.Text = viewModel.LocationName(row+1);
                        secondaryLabel.Text = string.Empty;
                        break;
                }
            }
            else
            {
                throw new Exception("unexpected Table View Cell ID");
            }

		}
コード例 #3
0
        public void UpdateCell(LocationsViewLocationViewModel viewModel, NSIndexPath indexPath, NSString cellId)
        {
            TableViewCellId = cellId;
            var section = indexPath.Section;
            var row     = indexPath.Row;

            if (TableViewCellId == AddLocationCellId)
            {
                mainLabel.Text      = viewModel.LocationName(row);
                secondaryLabel.Text = "";
            }
            else
            {
                throw new Exception("unexpected Table View Cell ID");
            }
        }
コード例 #4
0
 public LocationsTableViewSource(List <Location> items, LocationsViewController uivc)
 {
     viewModel = new LocationsViewLocationViewModel(items.ToArray());
     locationsViewController = uivc;
     TableItems = items;
 }