If you want to achieve similar functionality to the
Background
property, you could use a
Brush
type DependencyProperty:
public Brush MyCustomColor
{
get { return (Brush)GetValue(MyCustomColorProperty); }
set { SetValue(MyCustomColorProperty, value); }
}
public static readonly DependencyProperty MyCustomColorProperty =
DependencyProperty.Register("MyCustomColor", typeof(Brush), typeof(mystackpanel));