This is a very quick (and probably noob) question.
I am creating a dependencyobject and one of my dependencyproperty will be a “Point”.
The thing is that I don’t know what is the “ownerclass” of the dependencyproperty i am creating :/
Here is the code :
public Point MyPoint
{
get { return (Point)GetValue(MyPointProperty); }
set { SetValue(MyPointProperty, value); }
}
public static readonly DependencyProperty MyPointProperty =
DependencyProperty.Register("MyPoint", typeof(Point), typeof(**???**), new UIPropertyMetadata(0));
And btw, the metadata is OK ? (there is a constructor that takes an int as parameter for “Point”)
There’s only one example within the documentation for
Register, but hopefully its obvious enough – it’s the class that you’re adding this property to (you haven’t show us your class declaration, unfortunately, so I can’t post the actual value you need) but something like:If you’re not sure on the MetaData, there’s an overload of
Registerthat just takes three parameters, so you don’t have to specify any metadata.