Я хочу привязать значения CornerRadius.Связывание CornerRadius с зависимым свойством
CornerRadius="{Binding CornerRadiusInfoBtn}"
Это код в TitleBar.
И это моя собственность.
public CornerRadius CornerRadiusInfoBtn
{
get { return (CornerRadius)GetValue(CornerRadiusInfoBtnProperty); }
set { SetValue(CornerRadiusInfoBtnProperty, value); }
}
// Using a DependencyProperty as the backing store for CornerRadiusInfoBtn. This enables animation, styling, binding, etc...
public static readonly DependencyProperty CornerRadiusInfoBtnProperty =
DependencyProperty.Register("CornerRadiusInfoBtn", typeof(CornerRadius), typeof(TitleBar), new PropertyMetadata(new CornerRadius(0.0,0.0,2.0,2.0)));
Но там нет круглых углов. Что не так?
Где круглые углы? Это внутри класса CornerRadius? –
Вы настраиваете контекст данных на экземпляр 'TitleBar'? – PoweredByOrange
Когда я устанавливаю значение выше 0, углы округляются. – user3197157