DesignModeValueProvider Constructor
Initializes a new instance of the DesignModeValueProvider class.
Namespace: Microsoft.Windows.Design.Model
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
Syntax
'Declaration
Public Sub New
public DesignModeValueProvider()
public:
DesignModeValueProvider()
new : unit -> DesignModeValueProvider
public function DesignModeValueProvider()
Exceptions
Exception | Condition |
---|---|
InvalidOperationException | An invalid property is added to Properties. |
Remarks
In the constructor you identify the properties that you want to capture. You identify the properties by adding them to Properties.
Examples
The following example identifies the Background and Content properties as properties to capture. When the user changes these properties, new values are provided by the TranslatePropertyValue method. This code example is part of a larger example provided for the DesignModeValueProvider class.
For more information, see Walkthrough: Changing the Behavior of a Property at Design Time.
Public Sub New()
Properties.Add(GetType(Button), "Content")
Properties.Add(GetType(Button), "Background")
End Sub
public CustomButtonDesignModeValueProvider()
{
Properties.Add( typeof(Button), "Content");
Properties.Add(typeof(Button), "Background");
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Windows.Design.Model Namespace
Other Resources
How to: Change the Behavior of a Property at Design Time