namespace WPFluent.Controls; /// /// Simple Card with content and . /// public class Card : System.Windows.Controls.ContentControl { /// /// Identifies the dependency property. /// public static readonly DependencyProperty FooterProperty = DependencyProperty.Register( nameof(Footer), typeof(object), typeof(Card), new PropertyMetadata(null, OnFooterChanged)); /// /// Identifies the dependency property. /// public static readonly DependencyProperty HasFooterProperty = DependencyProperty.Register( nameof(HasFooter), typeof(bool), typeof(Card), new PropertyMetadata(false)); private static void OnFooterChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (d is not Card control) { return; } control.SetValue(HasFooterProperty, control.Footer != null); } /// /// Gets or sets additional content displayed at the bottom. /// public object? Footer { get => GetValue(FooterProperty); set => SetValue(FooterProperty, value); } /// /// Gets a value indicating whether the has a . /// public bool HasFooter { get => (bool)GetValue(HasFooterProperty); internal set => SetValue(HasFooterProperty, value); } }