This documentation is archived and is not being maintained.

Stroke.ContainsPropertyData Method

Returns a value that indicates whether the Stroke object contains the specified custom property.

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

public bool ContainsPropertyData(
	Guid propertyDataId
You cannot use methods in XAML.


Type: System.Guid

The unique identifier for the property.

Return Value

Type: System.Boolean
Returns true if the custom property exists; otherwise, returns false.

The following example demonstrates how to determine whether a Stroke object has a custom property.

// 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);

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0