I\'m trying to get some WPF concepts down, so I\'ve put together a simple example of what I\'m trying to do. I would like to set a custom property of a user control, and hav
Sorry to repost, but After re-reading you post, I think that you might be better off with templating. I've attached some samples in VB
Window.xaml
CircleInSquare.xaml.vb
Partial Public Class CircleInSquare
Public Property CircleColor() As Brush
Get
Return GetValue(CircleColorProperty)
End Get
Set(ByVal value As Brush)
SetValue(CircleColorProperty, value)
End Set
End Property
Public Shared ReadOnly CircleColorProperty As DependencyProperty = _
DependencyProperty.Register("CircleColor", _
GetType(Brush), GetType(CircleInSquare), _
New FrameworkPropertyMetadata(Brushes.Black))
Public Property SquareColor() As Brush
Get
Return GetValue(SquareColorProperty)
End Get
Set(ByVal value As Brush)
SetValue(SquareColorProperty, value)
End Set
End Property
Public Shared ReadOnly SquareColorProperty As DependencyProperty = _
DependencyProperty.Register("SquareColor", _
GetType(Brush), GetType(CircleInSquare), _
New FrameworkPropertyMetadata(Brushes.Gray))
End Class
CircleInSquare.xaml