Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

StrokeCollection::AddPropertyData Method (Guid, Object^)

 

Adds a custom property to the StrokeCollection.

Namespace:   System.Windows.Ink
Assembly:  PresentationCore (in PresentationCore.dll)

public:
void AddPropertyData(
	Guid propertyDataId,
	Object^ propertyData
)

Parameters

propertyDataId
Type: System::Guid

The Guid to associate with the custom property.

propertyData
Type: System::Object^

The value of the custom property. propertyData must be of type Char, Byte,Int16,,UInt16, Int32, UInt32, Int64, UInt64, Single, Double, DateTime, Boolean, String, Decimal or an array of these data types, except String, which is not allowed.

Exception Condition
ArgumentException

propertyDataId is an empty Guid.

-or-

propertyData is not one of the allowed data types listed in the Parameters section.

The AddPropertyData method enables you to add custom properties to a StrokeCollection. You can then include extra information with a StrokeCollection.

The following example demonstrates how to add and get custom property data. The AddTimeStamp_Click method uses the AddPropertyData method to add the current time to the StrokeCollection. The GetTimeStap_Click method uses the GetPropertyData method to retrieve the timestamp from the StrokeCollection. This example assumes that there is an InkCanvas called inkCanvas1.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft