, который начинается с
Код: Выделить всё
Код: Выделить всё
public int FrameThickness
{
get { return (int)GetValue(FrameThicknessProperty); }
set { SetValue(FrameThicknessProperty, value); }
}
public static readonly DependencyProperty FrameThicknessProperty =
DependencyProperty.Register(nameof(FrameThickness), typeof(int), typeof(RectZone), new PropertyMetadata(1));
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
public static readonly DependencyProperty TitleProperty =
DependencyProperty.Register(nameof(Title), typeof(string), typeof(RectZone), new PropertyMetadata("title"));
public ImageBrush? ZoneImage
{
get { return (ImageBrush)GetValue(ZoneImageProperty); }
set { SetValue(ZoneImageProperty, value); }
}
public static readonly DependencyProperty ZoneImageProperty =
DependencyProperty.Register(nameof(ZoneImage), typeof(ImageBrush), typeof(RectZone), new PropertyMetadata(null));
public Visibility LogVisibility
{
get { return (Visibility)GetValue(LogVisibilityProperty); }
set { SetValue(LogVisibilityProperty, value); }
}
public static readonly DependencyProperty LogVisibilityProperty =
DependencyProperty.Register(nameof(LogVisibility), typeof(Visibility), typeof(RectZone), new PropertyMetadata(Visibility.Visible));

текстовая версия для одного из них:
Код: Выделить всё
Severity: Error
Count: 4
Data Context: Visibility
Binding Path: TitleVisibility
Target: RectZone.TitleVisibility
Target Type: Visibility
Description File: TitleVisibility property not found on object of type Visibility
- что не так в моем коде?
- Я думал, что RelativeSource={RelativeSource AncestorType=control:RectZone полностью определит контекст данных, но ошибки привязки показывают, что это не так: почему?
- если не то я делаю неправильно с точки зрения контекста данных?
Подробнее здесь: https://stackoverflow.com/questions/791 ... orrectness