alexa
menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download

    Show / Hide Table of Contents

    Class CardView

    Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.

    Step 1a) Using this custom control in a XAML file that exists in the current project. Add this XmlNamespace attribute to the root element of the markup file where it is to be used:

    xmlns:MyNamespace="clr-namespace:CardViewControl"

    Step 1b) Using this custom control in a XAML file that exists in a different project. Add this XmlNamespace attribute to the root element of the markup file where it is to be used:

    xmlns:MyNamespace="clr-namespace:CardViewControl;assembly=CardViewControl"

    You will also need to add a project reference from the project where the XAML file lives to this project and Rebuild to avoid compilation errors:

    Right click on the target project in the Solution Explorer and "Add Reference"->"Projects"->[Select this project]

    Step 2) Go ahead and use your control in the XAML file.

    <MyNamespace:CustomControl1/>

    Inheritance
    System.Object
    CardView
    Implements
    System.IDisposable
    Namespace: Syncfusion.Windows.Tools.Controls
    Assembly: Syncfusion.Tools.Wpf.dll
    Syntax
    [SkinType(SkinVisualStyle = Skin.Office2007Blue, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Controls/CardView/Themes/Office2007BlueStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2007Black, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Controls/CardView/Themes/Office2007BlackStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2007Silver, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Controls/CardView/Themes/Office2007SilverStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2010Blue, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Controls/CardView/Themes/Office2010BlueStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2010Black, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Controls/CardView/Themes/Office2010BlackStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Office2010Silver, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Controls/CardView/Themes/Office2010SilverStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Blend, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Controls/CardView/Themes/BlendStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.VS2010, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Controls/CardView/Themes/VS2010Style.xaml")]
    [SkinType(SkinVisualStyle = Skin.Default, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF;component/Controls/CardView/Themes/Generic.xaml")]
    [SkinType(SkinVisualStyle = Skin.Metro, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Controls/CardView/Themes/MetroStyle.xaml")]
    [SkinType(SkinVisualStyle = Skin.Transparent, Type = typeof(CardView), XamlResource = "/Syncfusion.Tools.WPF.Classic;component/Controls/CardView/Themes/TransparentStyle.xaml")]
    public class CardView : ItemsControl, IDisposable

    Constructors

    CardView()

    Initializes a new instance of the CardView class.

    Declaration
    public CardView()

    Fields

    CanEditProperty

    Identifies the CanEdit dependency property.

    Declaration
    public static readonly DependencyProperty CanEditProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CanGroupProperty

    Identifies the CanGroup dependency property.

    Declaration
    public static readonly DependencyProperty CanGroupProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CanSortProperty

    Identifies the CanSort attached dependency property.

    Declaration
    public static readonly DependencyProperty CanSortProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    EditItemTemplateProperty

    Identifies the EditItemTemplate dependency property.

    Declaration
    public static readonly DependencyProperty EditItemTemplateProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    GroupboxCollectionProperty

    Identifies the GroupboxCollection dependency property.

    Declaration
    public static readonly DependencyProperty GroupboxCollectionProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    GroupNamesProperty

    Identifies the GroupNames dependency property.

    Declaration
    public static readonly DependencyProperty GroupNamesProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    GroupsProperty

    Identifies the Groups dependency property.

    Declaration
    public static readonly DependencyProperty GroupsProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    HeaderTemplateProperty

    Identifies the HeaderTemplate dependency property.

    Declaration
    public static readonly DependencyProperty HeaderTemplateProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    IsEditingProperty

    Identifies the IsEditing dependency property.

    Declaration
    public static readonly DependencyProperty IsEditingProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    IsGroupedProperty

    Identifies the IsGrouped dependency property.

    Declaration
    public static readonly DependencyProperty IsGroupedProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    NewItemStyleProperty

    Identifies the NewItemStyle dependency property.

    Declaration
    public static readonly DependencyProperty NewItemStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    OrientationProperty

    Identifies the Orientation dependency property.

    Declaration
    public static readonly DependencyProperty OrientationProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    SelectedItemProperty

    Identifies the SelectedItem dependency property.

    Declaration
    public static readonly DependencyProperty SelectedItemProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ShowHeaderProperty

    Identifies the ShowHeader dependency property.

    Declaration
    public static readonly DependencyProperty ShowHeaderProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    Properties

    CanEdit

    Gets or sets a value indicating whether items in the CardView control can be edited.

    Declaration
    public bool CanEdit { get; set; }
    Property Value
    Type
    System.Boolean

    CanGroup

    Gets or sets a value indicating whether grouping functionality is enabled in the CardView control.

    Declaration
    public bool CanGroup { get; set; }
    Property Value
    Type
    System.Boolean

    CanSort

    Gets or sets a value indicating whether sorting is enabled for the CardView control.

    Declaration
    public bool CanSort { get; set; }
    Property Value
    Type
    System.Boolean

    ClearFilter

    Gets or sets the command used to clear any applied filters in the view.

    Declaration
    public RoutedCommand ClearFilter { get; set; }
    Property Value
    Type
    System.Windows.Input.RoutedCommand

    EditItemTemplate

    Gets or sets the System.Windows.DataTemplate used to display an item in edit mode within the CardView control.

    Declaration
    public DataTemplate EditItemTemplate { get; set; }
    Property Value
    Type
    System.Windows.DataTemplate

    GroupboxCollection

    Gets or sets the collection of GroupInfo objects used to define item groupings in the CardView control.

    Declaration
    public ObservableCollection<GroupInfo> GroupboxCollection { get; set; }
    Property Value
    Type
    System.Collections.ObjectModel.ObservableCollection<GroupInfo>

    GroupNames

    Gets or sets the collection of GroupInfo objects that define the group names used in the CardView control.

    Declaration
    public ObservableCollection<GroupInfo> GroupNames { get; set; }
    Property Value
    Type
    System.Collections.ObjectModel.ObservableCollection<GroupInfo>

    Groups

    Gets or sets the collection of group objects that is used to organize items in the CardView control.

    Declaration
    public ObservableCollection<object> Groups { get; set; }
    Property Value
    Type
    System.Collections.ObjectModel.ObservableCollection<System.Object>

    HeaderTemplate

    Gets or sets the System.Windows.DataTemplate used to display the header in the CardView control.

    Declaration
    public DataTemplate HeaderTemplate { get; set; }
    Property Value
    Type
    System.Windows.DataTemplate

    IsEditing

    Gets or sets a value indicating whether the CardView control is in editing mode.

    Declaration
    public bool IsEditing { get; set; }
    Property Value
    Type
    System.Boolean

    IsGrouped

    Gets or sets a value indicating whether items in the CardView control are grouped.

    Declaration
    public bool IsGrouped { get; set; }
    Property Value
    Type
    System.Boolean

    NewItemStyle

    Gets or sets the System.Windows.Style applied to items in the CardView control.

    Declaration
    public Style NewItemStyle { get; set; }
    Property Value
    Type
    System.Windows.Style

    NormalSort

    Gets or sets the command used to trigger normal sorting behavior.

    Declaration
    public RoutedCommand NormalSort { get; set; }
    Property Value
    Type
    System.Windows.Input.RoutedCommand

    Orientation

    Gets or sets the layout orientation of items within the CardView control.

    Declaration
    public Orientation Orientation { get; set; }
    Property Value
    Type
    System.Windows.Controls.Orientation

    SelectedItem

    Gets or sets the currently selected item in the CardView control.

    Declaration
    public object SelectedItem { get; set; }
    Property Value
    Type
    System.Object

    ShowHeader

    Gets or sets a value indicating whether the header is visible in the CardView control.

    Declaration
    public bool ShowHeader { get; set; }
    Property Value
    Type
    System.Boolean

    Sort

    Gets or sets the System.Windows.Input.RoutedCommand used to trigger sorting behavior in the CardView control.

    Declaration
    public RoutedCommand Sort { get; set; }
    Property Value
    Type
    System.Windows.Input.RoutedCommand

    Methods

    BeginEdit()

    Begins the editing of the SelectedItem by applying the EditItemTemplate.

    Declaration
    public void BeginEdit()

    Dispose()

    Release the unmanaged resources of CardView.

    Declaration
    public void Dispose()

    EndEdit()

    Ends the editing of the SelectedItem by applying the ItemTemplate.

    Declaration
    public void EndEdit()

    GetContainerForItemOverride()

    Creates or returns the container element used to display an item in the CardView control.

    Declaration
    protected override DependencyObject GetContainerForItemOverride()
    Returns
    Type Description
    System.Windows.DependencyObject

    A new instance of CardViewItem configured for use within the CardView.

    GroupCards(String)

    Groups the items in the CardView control based on the specified property name.

    Declaration
    public void GroupCards(string groupname)
    Parameters
    Type Name Description
    System.String groupname

    The name of the property to group items by.

    IsItemItsOwnContainerOverride(Object)

    Determines whether the specified item is its own container or whether a new container needs to be generated.

    Declaration
    protected override bool IsItemItsOwnContainerOverride(object item)
    Parameters
    Type Name Description
    System.Object item

    The item to check.

    Returns
    Type
    System.Boolean

    OnApplyTemplate()

    Called when the control template is applied to the CardView.

    Declaration
    public override void OnApplyTemplate()

    OnItemsChanged(NotifyCollectionChangedEventArgs)

    Called when the item collection of the CardView control changes.

    Declaration
    protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
    Parameters
    Type Name Description
    System.Collections.Specialized.NotifyCollectionChangedEventArgs e

    Provides details about the type of change that occurred in the collection, such as Add, Remove, Replace, or Reset.

    OnItemsSourceChanged(IEnumerable, IEnumerable)

    Called when the ItemsSource property of the CardView control changes.

    Declaration
    protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
    Parameters
    Type Name Description
    System.Collections.IEnumerable oldValue

    The previous data source assigned to ItemsSource.

    System.Collections.IEnumerable newValue

    The new data source assigned to ItemsSource.

    OnSelectedItemChanged(DependencyPropertyChangedEventArgs)

    Called when the items in the CardView control have changed.

    Declaration
    protected virtual void OnSelectedItemChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Provides data about the change to the SelectedItem property, including old and new values.

    PrepareContainerForItemOverride(DependencyObject, Object)

    Prepares the container element to display the specified item in the CardView control.

    Declaration
    protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
    Parameters
    Type Name Description
    System.Windows.DependencyObject element

    The container element used to display the specified item.

    System.Object item

    The data item to be displayed in the container.

    Events

    SelectedItemChanged

    Occurs when the SelectedItem changes.

    Declaration
    public event PropertyChangedCallback SelectedItemChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    Implements

    System.IDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved