In This Article

CloneService Class

Represents a service that supports the cloning of UI elements.

public static class CloneService
Inheritance:
object object

Methods

CanClone(DependencyObject)

Returns whether the specified System.Windows.DependencyObject can be cloned.

public static bool CanClone(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The System.Windows.DependencyObject to examine.

Returns

bool:

true if the object can be cloned; otherwise, false.

Remarks

This method checks that the object is not a clone itself, and that it either implements ICloneable or has a public parameterless constructor.

CreateClone(DependencyObject)

Creates a clone of the specified System.Windows.DependencyObject.

public static DependencyObject CreateClone(DependencyObject source)
Parameter Type Description
source DependencyObject

The object to clone.

Returns

DependencyObject:

The clone of the object.

DisposeClone(DependencyObject)

Removes all tracked references to the specified clone.

public static void DisposeClone(DependencyObject clone)
Parameter Type Description
clone DependencyObject

The object to dispose.

GetCanCloneToQuickAccessToolBar(DependencyObject)

Gets the value of the CanCloneToQuickAccessToolBar attached property for the specified object.

public static bool GetCanCloneToQuickAccessToolBar(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

bool:

The object's value.

GetCloneSource(DependencyObject)

Returns the original source System.Windows.DependencyObject from which the specified System.Windows.DependencyObject was cloned.

public static DependencyObject GetCloneSource(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The System.Windows.DependencyObject to examine.

Returns

DependencyObject:

The original source System.Windows.DependencyObject from which the specified System.Windows.DependencyObject was cloned.

Remarks

null will be returned if the original source of the clone is no longer available or if the specified object is not a clone.

GetClonedSourceReference(DependencyObject)

Gets the value of the ClonedSourceReference attached property for the specified object.

public static WeakReference GetClonedSourceReference(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The object from which the property value is read.

Returns

WeakReference:

The object's value.

GetClones(DependencyObject)

Returns the collection of objects that have been cloned from the specified System.Windows.DependencyObject.

public static ICollection<DependencyObject> GetClones(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The System.Windows.DependencyObject to examine.

Returns

ICollection<DependencyObject>:

The collection of objects that have been cloned from the specified System.Windows.DependencyObject.

HasClones(DependencyObject)

Returns whether the specified System.Windows.DependencyObject has any clones.

public static bool HasClones(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The System.Windows.DependencyObject to examine.

Returns

bool:

true if the specified System.Windows.DependencyObject has any clones; otherwise, false.

IsAClone(DependencyObject)

Returns whether the specified System.Windows.DependencyObject is a root-level clone of another object.

public static bool IsAClone(DependencyObject obj)
Parameter Type Description
obj DependencyObject

The System.Windows.DependencyObject to examine.

Returns

bool:

true if the specified System.Windows.DependencyObject is a root-level clone of another object; otherwise, false.

SetCanCloneToQuickAccessToolBar(DependencyObject, bool)

Sets the value of the CanCloneToQuickAccessToolBar attached property to the specified object.

public static void SetCanCloneToQuickAccessToolBar(DependencyObject obj, bool value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value bool

The value to set.

SetClonedSourceReference(DependencyObject, WeakReference)

Sets the value of the ClonedSourceReference attached property to the specified object.

public static void SetClonedSourceReference(DependencyObject obj, WeakReference value)
Parameter Type Description
obj DependencyObject

The object to which the attached property is written.

value WeakReference

The value to set.

Fields

CanCloneToQuickAccessToolBarProperty

Identifies the CanCloneToQuickAccessToolBar dependency property. This field is read-only.

public static readonly DependencyProperty CanCloneToQuickAccessToolBarProperty

CloneCreatedEvent

Identifies the CloneCreated routed event. This field is read-only.

public static readonly RoutedEvent CloneCreatedEvent

CloneCreatingEvent

Identifies the CloneCreating routed event. This field is read-only.

public static readonly RoutedEvent CloneCreatingEvent

CloneDisposedEvent

Identifies the CloneDisposed routed event. This field is read-only.

public static readonly RoutedEvent CloneDisposedEvent

Inherited Members