private void OnLayerViewStateChanged(object sender, LayerViewStateChangedEventArgs e)
        {
            // State changed event is sent by a layer. In the list, find the layer which sends this event.
            // If it exists then update the status
            LayerStatusModel model = _layerStatusModels.FirstOrDefault(l => l.LayerName == e.Layer.Name);

            if (model != null)
            {
                model.LayerViewStatus = e.LayerViewState.Status.ToString();
            }
        }
Ejemplo n.º 2
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            // Get the reused cell from the table view.
            UITableViewCell cell = tableView.DequeueReusableCell(CellIdentifier);

            // Get the model at this current cell index.
            LayerStatusModel model = _layers[indexPath.Row];

            // If there are no cells to reuse-create one.
            // We are specifically using Value1 style so text for both layer name and status can be displayed.
            if (cell == null)
            {
                cell = new UITableViewCell(UITableViewCellStyle.Value1, CellIdentifier);
            }

            cell.TextLabel.Text       = model.LayerName ?? "Layer " + indexPath.Row;
            cell.DetailTextLabel.Text = model.LayerViewStatus;
            return(cell);
        }