Answer the question
In order to leave comments, you need to log in
Can't get dependency property value?
There is a class - describing the dependency property
namespace WpfApp1
{
class BrushClass: InkCanvas
{
public static DependencyProperty BrushProperty;
static BrushClass()
{
BrushProperty = DependencyProperty.Register("BrushData",typeof(Brush),typeof(BrushClass));
}
public Brush BrushData
{
get { return (Brush)GetValue(BrushProperty); }
set { SetValue(BrushProperty, value); }
}
}
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Brush_Control.BrushData.SetCurrentValue(BrushProperty, 5); // не видит BrushProperty
}
Answer the question
In order to leave comments, you need to log in
BrushProperty is a static field and should be accessed accordingly
SetCurrentValue( BrushClass .BrushProperty, 5);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question