Reputation: 47
I want to create a control that inherits from TextBox, which has an attribute called 'Filler'. I have the basic control created (named GhostBox), so I can load it in to a sample project and see it on the designer, but I don't know how to create custom XAML parameters (such as Text and Width which already exist). Please explain how to add these?
Example:
<ghostbox:GhostBox Name="ghostBox1" Text="" Height="72" HorizontalAlignment="Left" VerticalAlignment="Top" Width="460" Margin="0,80,0,0" Filler="Filler Text"/>
As you can see at the end of the tag, there is a Filler attribute. That's what I want to add, if I haven't made it clear enough. Thanks.
Upvotes: 0
Views: 120
Reputation: 19591
They are called Dependency Properties. Have a read of this MSDN article about them.
Upvotes: 1