Dependency Property Nedir?
Sıradan C# property'lerinden farkı ve Binding için neden zorunlu olduğu.
WPF'te bir kontrolün (mesela bir butonun renginin) başka bir yerle otomatik senkronize olması için DependencyProperty kullanılır. Bu sistem, değişiklik bildirimi (change notification) mekanizmasını otomatik yönetir.
Özel Dependency Property Tanımı
public static readonly DependencyProperty UserAgeProperty =
DependencyProperty.Register("UserAge", typeof(int), typeof(MyControl),
new PropertyMetadata(0));
public int UserAge {
get => (int)GetValue(UserAgeProperty);
set => SetValue(UserAgeProperty, value);
}