Properties must be declared in C # using DependencyProperty.Register (or, if you are not creating a custom tyoe button, DependencyProperty.RegisterAttached). Here's the declaration if you create a custom button class:
public static readonly DependencyProperty ButtonBorderColourProperty =
DependencyProperty.Register("ButtonBorderColour",
typeof(Color), typeof(MyButton));
public Color ButtonBorderColor
{
get { return (Color)GetValue(ButtonBorderColourProperty); }
set { SetValue(ButtonBorderColourProperty, value); }
}
, , , RegisterAttached:
public static class ButtonCustomisation
{
public static readonly DependencyProperty ButtonBorderColourProperty =
DependencyProperty.RegisterAttached("ButtonBorderColour",
typeof(Color), typeof(ButtonCustomisation));
}
XAML:
<local:MyButton ButtonBorderColour="HotPink" />
<Button local:ButtonCustomisation.ButtonBorderColour="Lime" />