共用方式為


GridCellLengthAttribute Class

Definition

This class associates a grid cell size with a MEF export.

public ref class GridCellLengthAttribute sealed : Microsoft::VisualStudio::Utilities::SingletonBaseMetadataAttribute
public ref class GridCellLengthAttribute sealed : Microsoft::VisualStudio::Utilities::SingletonBaseMetadataAttribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, AllowMultiple=false)]
[System.ComponentModel.Composition.MetadataAttribute]
public sealed class GridCellLengthAttribute : Microsoft.VisualStudio.Utilities.SingletonBaseMetadataAttribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, AllowMultiple=false)>]
[<System.ComponentModel.Composition.MetadataAttribute>]
type GridCellLengthAttribute = class
    inherit SingletonBaseMetadataAttribute
Public NotInheritable Class GridCellLengthAttribute
Inherits SingletonBaseMetadataAttribute
Inheritance
GridCellLengthAttribute
Attributes

Examples

[Export(typeof(IWpfTextViewMarginProvider))]
[Name(PredefinedMarginNames.VerticalScrollBar)]
[MarginContainer(PredefinedMarginNames.VerticalScrollBarContainerMargin)]
[ContentType("text")]
[TextViewRole(PredefinedTextViewRoles.Interactive)]
[GridUnitType(GridUnitType.Pixel)] //this size is expressed as a pixel using the GridCellLength attribute
[GridCellLength(15)] //15 pixels wide
internal sealed class VerticalScrollBarMarginProvider : IWpfTextViewMarginProvider { */ implementation /* }

Remarks

The value of this attribute will be used by the consumers to decide rendering behavior for the exported object. The rendering behavior will match the behavior defined in WPF classes (e.g. Grid) that interact with GridLength.

This class is used in combination with GridUnitTypeAttribute to create a GridLength for a cell in a Grid.

Constructors

GridCellLengthAttribute(Double)

Constructs a GridCellLengthAttribute.

Properties

GridCellLength

Gets the grid cell length.

Applies to