mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-09 07:56:08 +02:00
Fix naming in custom-dependency-properties snippet (#1204)
* Fix naming * Simplify identifier assignment * Simplify identifier assignment
This commit is contained in:
+4
-7
@@ -18,8 +18,9 @@ namespace CodeSampleCsharp
|
||||
//<RegisterDependencyPropertyWithWrapper>
|
||||
//<RegisterDependencyProperty>
|
||||
// Register a dependency property with the specified property name,
|
||||
// property type, owner type, and property metadata.
|
||||
private static readonly DependencyProperty s_aquariumGraphicProperty =
|
||||
// property type, owner type, and property metadata. Store the dependency
|
||||
// property identifier as a public static readonly member of the class.
|
||||
public static readonly DependencyProperty AquariumGraphicProperty =
|
||||
DependencyProperty.Register(
|
||||
name: "AquariumGraphic",
|
||||
propertyType: typeof(Uri),
|
||||
@@ -29,14 +30,10 @@ namespace CodeSampleCsharp
|
||||
flags: FrameworkPropertyMetadataOptions.AffectsRender,
|
||||
propertyChangedCallback: new PropertyChangedCallback(OnUriChanged))
|
||||
);
|
||||
|
||||
// Store the dependency property identifier as a static member of the class.
|
||||
public static readonly DependencyProperty AquariumGraphicProperty =
|
||||
s_aquariumGraphicProperty;
|
||||
//</RegisterDependencyProperty>
|
||||
|
||||
// Declare a read-write property.
|
||||
public Uri AquariumContents
|
||||
public Uri AquariumGraphic
|
||||
{
|
||||
get => (Uri)GetValue(AquariumGraphicProperty);
|
||||
set => SetValue(AquariumGraphicProperty, value);
|
||||
|
||||
Reference in New Issue
Block a user