1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
public class CustCanvas : Canvas
{
static CustCanvas()
{
//DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomCanvas), new FrameworkPropertyMetadata(typeof(CustomCanvas)));
}
public CustCanvas()
{
}
public string Message
{
get { return (string)GetValue(MessageProperty); }
set { SetValue(MessageProperty, value); }
}
// Using a DependencyProperty as the backing store for Message. This enables animation, styling, binding, etc...
public static readonly DependencyProperty MessageProperty =
DependencyProperty.Register("Message",
typeof(string),
typeof(CustCanvas),
new UIPropertyMetadata("Alias = False"));
public bool AliasMouseOver
{
get { return (bool)GetValue(AliasMouseOverProperty); }
set { SetValue(AliasMouseOverProperty, value); }
}
// Using a DependencyProperty as the backing store for NewMouseOver. This enables animation, styling, binding, etc...
public static readonly DependencyProperty AliasMouseOverProperty =
DependencyProperty.Register("AliasMouseOver",
typeof(bool),
typeof(CustCanvas),
new FrameworkPropertyMetadata(false));
} |
Partager