ShinobiControls Xamarin Bindings Documentation

ShinobiGrids : ShinobiGrids Namespace

SGridCell Class

Base class for individual cells in a grid

Syntax

[Foundation.Register("SGridCell", true)]
public class SGridCell : UIKit.UIView, Foundation.INSCopying, ISGridEventResponder, IDisposable

Remarks

An SGridCell object is used to represent a cell within a ShinobiGrid and can be located within the grid via its SGridCell.GridCoord property. This class provides basic cell functionality such as cell selection. This class is ideal if you want to provide custom content that the ShinobiGrids.SGridAutoCell (and subclasses) are not suited for - as instances of this class have no automatic content, they are effective containers for other UIView objects (or descendants) that you may wish to add as subviews to the cell.

SGridCell's use the SGridCell.ReuseIdentifier property for performance reasons much in the same manner as the Cocoa framework's UIScrollView and UITableViewCell classes. For this reason it is important to ensure you make effective use of the ReuseIdentifier for each different type of cell content you wish to display in the ShinobiGrid - see the included project samples for examples of the ReuseIdentifer in use.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

Members

See Also: Inherited members from UIKit.UIView.

Public Constructors

Initializes a cell with a reuse identifier.

Protected Constructors

Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects.

Public Properties

[read-only]
override
ClassHandle IntPtr . The handle for this class.
[read-only]
ContentFrame CoreGraphics.CGRect . A readonly frame which represents the area available for content of the cell.
FitSubviewsToView bool . Setting this property to true results in any added subviews having dimensions automatically applied so that they are the same size as the cell. Default value is true.
[read-only]
GridCoord SGridCoord . This property represents the coordinates of the cell and uniquely identifies it within its parent grid. The notation {`colIndex`, `row`}, is sometimes used to refer to a gridCoord object within this documentation.
[read-only]
ReuseIdentifier string . A string used to identify a cell that is reusable. (read-only) The reuse identifier is associated with a SGridCell object that the ShinobiGrid's data source creates with the intent to reuse it as the basis (for performance reasons) for multiple cells of a ShinobiGrid object. It is assigned to the cell object in ReuseIdentifier and cannot be changed thereafter. A ShinobiGrid object maintains a collection of the currently reusable cells, each with its own reuse identifier.
[read-only]
Selected bool . A read-only boolean that indicates if this cell is selected or not.
SelectedColor UIKit.UIColor . The color that the cell will change to when selected. Setting this property to null will result in a selection color that is identical to the cell's final background color.
SelectedStyle SGridCellStyle . The style that will be applied to the cell when selected.

Public Methods

ApplyStyle (SGridCellStyle)
This method is called in order to style each cell as the grid is preparing to display.
Copy (Foundation.NSZone) : Foundation.NSObject
Documentation for this section has not yet been entered.
ResetForReuse ()
This method is called before a cell is returned from the pool that it has been stored in. Any state that may need to be reset prior to it being retrieved from ShinobiGrid.DequeueReusableCellWithIdentifier can be done inside this method.
SetSelected (bool, bool) : bool
Set this cell as being selected or deselected.

Protected Methods

override
Dispose (bool)
Releases unmanaged resources.

Member Details

SGridCell Constructor

Constructor to call on derived classes to skip initialization and merely allocate the object.

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
protected SGridCell (Foundation.NSObjectFlag t)

Parameters

t
Unused sentinel value

Remarks

You should not invoke this method directly.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

SGridCell Constructor

A constructor used when creating managed representations of unmanaged objects.

Syntax

[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
protected SGridCell (IntPtr handle)

Parameters

handle
Handle of the unmanaged object

Remarks

You should not invoke this method directly.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

SGridCell Constructor

Initializes a cell with a reuse identifier.

Syntax

[Foundation.Export("initWithReuseIdentifier:")]
public SGridCell (string identifier)

Parameters

identifier
The reuse identifier

Remarks

Important: This method must be used to initialize a cell.

When subclassing a cell, ensure that you have overridden this constructor, as this is the method which the Grid will call when instantiating cells.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

ApplyStyle Method

This method is called in order to style each cell as the grid is preparing to display.

Syntax

[Foundation.Export("applyStyle:")]
public virtual void ApplyStyle (SGridCellStyle style)

Parameters

style
The style to apply.

Remarks

If you create your own cell subclass you may want to override this method to ensure that the style object is properly used in the styling of the cell. For example the ShinobiGrids.SGridAutoCell implementation ensures that text alignment is properly applied to the cell.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

ClassHandle Property

The handle for this class.

Syntax

public override IntPtr ClassHandle { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

ContentFrame Property

A readonly frame which represents the area available for content of the cell.

Syntax

[get: Foundation.Export("contentFrame")]
public virtual CoreGraphics.CGRect ContentFrame { get; }

Value

Documentation for this section has not yet been entered.

Remarks

The gridlines take up the remaining edges of the cell.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

Copy Method

Documentation for this section has not yet been entered.

Syntax

[Foundation.Export("copyWithZone:")]
public virtual Foundation.NSObject Copy (Foundation.NSZone zone)

Parameters

zone
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

Dispose Method

Releases unmanaged resources.

Syntax

protected override void Dispose (bool disposing)

Parameters

disposing
True if called by Dispose, false if called from a finalizer

Remarks

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

FitSubviewsToView Property

Setting this property to true results in any added subviews having dimensions automatically applied so that they are the same size as the cell. Default value is true.

Syntax

[get: Foundation.Export("fitSubviewsToView", ObjCRuntime.ArgumentSemantic.UnsafeUnretained)]
[set: Foundation.Export("setFitSubviewsToView:", ObjCRuntime.ArgumentSemantic.UnsafeUnretained)]
public virtual bool FitSubviewsToView { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

GridCoord Property

This property represents the coordinates of the cell and uniquely identifies it within its parent grid. The notation {`colIndex`, `row`}, is sometimes used to refer to a gridCoord object within this documentation.

Syntax

[get: Foundation.Export("gridCoord", ObjCRuntime.ArgumentSemantic.Strong)]
public virtual SGridCoord GridCoord { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

ResetForReuse Method

This method is called before a cell is returned from the pool that it has been stored in. Any state that may need to be reset prior to it being retrieved from ShinobiGrid.DequeueReusableCellWithIdentifier can be done inside this method.

Syntax

[Foundation.Export("resetForReuse")]
public virtual void ResetForReuse ()

Remarks

Important: This method is a potential performance hotspot as it is called every time a cell is retrieved as a result of a call to the data source method. For this reason you should only override this method to reset a property of this cell if changing said property within the datasource method is not applicable.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

ReuseIdentifier Property

A string used to identify a cell that is reusable. (read-only) The reuse identifier is associated with a SGridCell object that the ShinobiGrid's data source creates with the intent to reuse it as the basis (for performance reasons) for multiple cells of a ShinobiGrid object. It is assigned to the cell object in ReuseIdentifier and cannot be changed thereafter. A ShinobiGrid object maintains a collection of the currently reusable cells, each with its own reuse identifier.

Syntax

[get: Foundation.Export("reuseIdentifier")]
public virtual string ReuseIdentifier { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

Selected Property

A read-only boolean that indicates if this cell is selected or not.

Syntax

[get: Foundation.Export("selected")]
public virtual bool Selected { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

SelectedColor Property

The color that the cell will change to when selected. Setting this property to null will result in a selection color that is identical to the cell's final background color.

Syntax

[System.Obsolete("Use SelectedStyle instead", false)]
[get: Foundation.Export("selectedColor", ObjCRuntime.ArgumentSemantic.Strong)]
[set: Foundation.Export("setSelectedColor:", ObjCRuntime.ArgumentSemantic.Strong)]
public virtual UIKit.UIColor SelectedColor { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Important: Deprecated for versions after 1.1.2. Use SGridCell.SelectedStyle (inherited from the SGridCell protocol) instead.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

SelectedStyle Property

The style that will be applied to the cell when selected.

Syntax

[get: Foundation.Export("selectedStyle", ObjCRuntime.ArgumentSemantic.Strong)]
[set: Foundation.Export("setSelectedStyle:", ObjCRuntime.ArgumentSemantic.Strong)]
public virtual SGridCellStyle SelectedStyle { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4

SetSelected Method

Set this cell as being selected or deselected.

Syntax

[Foundation.Export("setSelected:animated:")]
public virtual bool SetSelected (bool isSelected, bool animated)

Parameters

isSelected
Whether the cell should be set as selected.
animated
Whether the cell's selection change should be animated.

Returns

Documentation for this section has not yet been entered.

Remarks

Important: Note that programmatic cell selection ignores the grid's ShinobiGrid.SelectionMode, meaning that there will be no automatic deselection in any circumstances.

Requirements

Namespace: ShinobiGrids
Assembly: ShinobiGrids (in ShinobiGrids.dll)
Assembly Versions: 2.8.0.4