using System.Windows.Automation.Peers;
namespace WPFluent.Controls;
///
/// Inherited from the control which displays an additional
/// control on the right side of the card.
///
public class CardControl : System.Windows.Controls.Primitives.ButtonBase, IIconControl
{
///
/// Identifies the dependency property.
///
public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register(
nameof(CornerRadius),
typeof(CornerRadius),
typeof(CardControl),
new PropertyMetadata(new CornerRadius(0)));
///
/// Identifies the dependency property.
///
public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register(
nameof(Header),
typeof(object),
typeof(CardControl),
new PropertyMetadata(null));
///
/// Identifies the dependency property.
///
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
nameof(Icon),
typeof(IconElement),
typeof(CardControl),
new PropertyMetadata(null));
protected override AutomationPeer OnCreateAutomationPeer() { return new CardControlAutomationPeer(this); }
///
/// Gets or sets the corner radius of the control.
///
[Bindable(true)]
[Category("Appearance")]
public CornerRadius CornerRadius
{
get => (CornerRadius)GetValue(CornerRadiusProperty);
set => SetValue(CornerRadiusProperty, value);
}
///
/// Gets or sets header which is used for each item in the control.
///
[Bindable(true)]
public object Header { get => GetValue(HeaderProperty); set => SetValue(HeaderProperty, value); }
///
/// Gets or sets displayed .
///
[Bindable(true)]
[Category("Appearance")]
public IconElement? Icon { get => (IconElement?)GetValue(IconProperty); set => SetValue(IconProperty, value); }
}