Stroke.GetPropertyData Method

Retrieves the property data for the specified GUID.

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

public Object GetPropertyData(
	Guid propertyDataId
)

Parameters

propertyDataId
Type: System.Guid

The unique identifier for the property.

Return Value

Type: System.Object
An object containing the property data.

ExceptionCondition
ArgumentException

propertyDataId is not associated with a custom property of the Stroke.

The following example demonstrates how to retrieve a custom property on a Stroke object.

// Create a guid for the date/timestamp.
Guid dtGuid = new Guid("03457307-3475-3450-3035-640435034540");

DateTime now = DateTime.Now;

// Check whether the property is already saved 
if (thisStroke.ContainsPropertyData(dtGuid))
{
    // Check whether the existing property matches the current date/timestamp
    DateTime oldDT = (DateTime)thisStroke.GetPropertyData(dtGuid);

    if (oldDT != now)
    {
        // Update the current date and time
        thisStroke.AddPropertyData(dtGuid, now);
    }
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft