Skip to content

Commit 6b6015c

Browse files
CardView control item
1 parent 2e1d130 commit 6b6015c

File tree

96 files changed

+4029
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+4029
-2
lines changed

README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,46 @@
1-
# syncfusion-wpf-card-view-examples
2-
Syncfusion WPF card view examples
1+
# CardView Control samples
2+
3+
This repository contains the samples that demonstrate the functionalities of WPF CardView Control.
4+
5+
<table>
6+
<tr>
7+
<td><a href="Samples/Getting-Started">Getting Started</a></td>
8+
<td><a href="Samples/Getting-Started">Populating items using CardViewItem</a></td>
9+
<td><a href="Samples/PopulateItems">Populating items using ItemsSource</a></td>
10+
<td><a href="Samples/Getting-Started">Select a CardViewItem</a></td>
11+
</tr>
12+
<tr>
13+
<td><a href="Samples/Getting-Started">Select CardViewItem programmatically using property</a></td>
14+
<td><a href="Samples/Editing">Group the CardViewItems</a></td>
15+
<td><a href="Samples/Editing">Sort the CardViewItems</a></td>
16+
<td><a href="Samples/Editing"</a>Edit the CardViewItems</td>
17+
</tr>
18+
<tr>
19+
<td><a href="Samples/Editing">Orientation of CardViewItems</a></td>
20+
<td><a href="Samples/Editing">Data binding to objects</a></td>
21+
<td><a href="Samples/CustomUI">Custom UI for CardViewItem header</a></td>
22+
<td><a href="Samples/CustomUI"</a>Custom UI for CardViewItem content</td>
23+
</tr>
24+
<tr>
25+
<td><a href="Samples/CustomUI"></a>Custom UI for edit mode CardViewItem</td>
26+
<td><a href="Samples/Specific-CustomUI"></a>Different UI styles for specific CardViewItem</td>
27+
<td><a href="Samples/Editing"></a>Change flow direction</td>
28+
<td><a href="Samples/Themes"</a>Theme</td>
29+
</tr>
30+
<tr>
31+
<td><a href="Samples/Editing">Enable/disable the grouping, sorting and editing mode</a></td>
32+
<td><a href="Samples/Editing">Card editing using keyboard and mouse interaction</a></td>
33+
<td><a href="Samples/CardView-EditMode">Start card editing programmatically</a></td>
34+
<td><a href="Samples/Editing"</a>Filter the CardViewItems</td>
35+
</tr>
36+
<tr>
37+
<td><a href="Samples/Editing">Reset the filter</a></td>
38+
<td><a href="Samples/Editing">Hide the grouping, sorting, editing and filtering header</a></td>
39+
<td><a href="Samples/Editing">Group the CardViewItems</a></td>
40+
<td><a href="Samples/Editing"</a>Nested grouping of CardViewItems</td>
41+
</tr>
42+
<tr>
43+
<td><a href="Samples/Editing">Sort the CardViewItems</a></td>
44+
<td><a href="Samples/Editing">Sort the grouped CardViewItems</a></td>
45+
</tr>
46+
</table>
65.5 KB
Binary file not shown.

Samples/CustomUI/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>

Samples/CustomUI/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="CustomUI.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:CustomUI"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

Samples/CustomUI/App.xaml.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
9+
namespace CustomUI
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}

Samples/CustomUI/CustomUI.csproj

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{6F415305-B501-4384-B259-0DDE3C68EE5D}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>CustomUI</RootNamespace>
10+
<AssemblyName>CustomUI</AssemblyName>
11+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
14+
<WarningLevel>4</WarningLevel>
15+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
16+
<Deterministic>true</Deterministic>
17+
</PropertyGroup>
18+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
19+
<PlatformTarget>AnyCPU</PlatformTarget>
20+
<DebugSymbols>true</DebugSymbols>
21+
<DebugType>full</DebugType>
22+
<Optimize>false</Optimize>
23+
<OutputPath>bin\Debug\</OutputPath>
24+
<DefineConstants>DEBUG;TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
29+
<PlatformTarget>AnyCPU</PlatformTarget>
30+
<DebugType>pdbonly</DebugType>
31+
<Optimize>true</Optimize>
32+
<OutputPath>bin\Release\</OutputPath>
33+
<DefineConstants>TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
</PropertyGroup>
37+
<ItemGroup>
38+
<Reference Include="Syncfusion.Licensing, Version=18.4460.0.34, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
39+
<HintPath>packages\Syncfusion.Licensing.18.4.0.34\lib\net46\Syncfusion.Licensing.dll</HintPath>
40+
</Reference>
41+
<Reference Include="Syncfusion.Shared.WPF, Version=18.4460.0.34, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
42+
<HintPath>packages\Syncfusion.Shared.WPF.18.4.0.34\lib\net46\Syncfusion.Shared.WPF.dll</HintPath>
43+
</Reference>
44+
<Reference Include="Syncfusion.Tools.WPF, Version=18.4460.0.34, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
45+
<HintPath>packages\Syncfusion.Tools.WPF.18.4.0.34\lib\net46\Syncfusion.Tools.WPF.dll</HintPath>
46+
</Reference>
47+
<Reference Include="System" />
48+
<Reference Include="System.Data" />
49+
<Reference Include="System.Xml" />
50+
<Reference Include="Microsoft.CSharp" />
51+
<Reference Include="System.Core" />
52+
<Reference Include="System.Xml.Linq" />
53+
<Reference Include="System.Data.DataSetExtensions" />
54+
<Reference Include="System.Net.Http" />
55+
<Reference Include="System.Xaml">
56+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
57+
</Reference>
58+
<Reference Include="WindowsBase" />
59+
<Reference Include="PresentationCore" />
60+
<Reference Include="PresentationFramework" />
61+
</ItemGroup>
62+
<ItemGroup>
63+
<ApplicationDefinition Include="App.xaml">
64+
<Generator>MSBuild:Compile</Generator>
65+
<SubType>Designer</SubType>
66+
</ApplicationDefinition>
67+
<Compile Include="ViewModel\ViewModel.cs" />
68+
<Page Include="MainWindow.xaml">
69+
<Generator>MSBuild:Compile</Generator>
70+
<SubType>Designer</SubType>
71+
</Page>
72+
<Compile Include="App.xaml.cs">
73+
<DependentUpon>App.xaml</DependentUpon>
74+
<SubType>Code</SubType>
75+
</Compile>
76+
<Compile Include="MainWindow.xaml.cs">
77+
<DependentUpon>MainWindow.xaml</DependentUpon>
78+
<SubType>Code</SubType>
79+
</Compile>
80+
</ItemGroup>
81+
<ItemGroup>
82+
<Compile Include="Model\CardViewModel.cs" />
83+
<Compile Include="Properties\AssemblyInfo.cs">
84+
<SubType>Code</SubType>
85+
</Compile>
86+
<Compile Include="Properties\Resources.Designer.cs">
87+
<AutoGen>True</AutoGen>
88+
<DesignTime>True</DesignTime>
89+
<DependentUpon>Resources.resx</DependentUpon>
90+
</Compile>
91+
<Compile Include="Properties\Settings.Designer.cs">
92+
<AutoGen>True</AutoGen>
93+
<DependentUpon>Settings.settings</DependentUpon>
94+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
95+
</Compile>
96+
<EmbeddedResource Include="Properties\Resources.resx">
97+
<Generator>ResXFileCodeGenerator</Generator>
98+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
99+
</EmbeddedResource>
100+
<None Include="packages.config" />
101+
<None Include="Properties\Settings.settings">
102+
<Generator>SettingsSingleFileGenerator</Generator>
103+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
104+
</None>
105+
</ItemGroup>
106+
<ItemGroup>
107+
<None Include="App.config" />
108+
</ItemGroup>
109+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
110+
</Project>

Samples/CustomUI/CustomUI.sln

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30709.64
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomUI", "CustomUI.csproj", "{6F415305-B501-4384-B259-0DDE3C68EE5D}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{6F415305-B501-4384-B259-0DDE3C68EE5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{6F415305-B501-4384-B259-0DDE3C68EE5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{6F415305-B501-4384-B259-0DDE3C68EE5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{6F415305-B501-4384-B259-0DDE3C68EE5D}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {B009DD08-0FFE-4E2C-BCDC-D9B70139DB7C}
24+
EndGlobalSection
25+
EndGlobal

Samples/CustomUI/MainWindow.xaml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<Window x:Class="CustomUI.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
7+
xmlns:local="clr-namespace:CustomUI"
8+
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
9+
Title="CardView - Custom UI" Height="450" Width="800">
10+
<Window.DataContext>
11+
<local:ViewModel/>
12+
</Window.DataContext>
13+
<Grid>
14+
<syncfusion:CardView
15+
CanEdit="True"
16+
CanGroup="True"
17+
CanSort="True"
18+
ShowHeader="True"
19+
ItemsSource="{Binding CardViewItems}"
20+
Name="cardView">
21+
<syncfusion:CardView.HeaderTemplate>
22+
<DataTemplate>
23+
<TextBlock
24+
Text="{Binding FirstName}"
25+
TextAlignment="Center"
26+
FontWeight="Bold"
27+
Foreground="Red"/>
28+
</DataTemplate>
29+
</syncfusion:CardView.HeaderTemplate>
30+
<syncfusion:CardView.ItemTemplate>
31+
<DataTemplate >
32+
<ListBox ScrollViewer.HorizontalScrollBarVisibility="Disabled">
33+
<ListBoxItem Padding="1">
34+
<Grid>
35+
<Grid.ColumnDefinitions>
36+
<ColumnDefinition Width="75" />
37+
<ColumnDefinition />
38+
</Grid.ColumnDefinitions>
39+
<TextBlock Text="First Name:" />
40+
<TextBlock Grid.Column="1"
41+
Foreground="YellowGreen"
42+
Text="{Binding FirstName,
43+
UpdateSourceTrigger=PropertyChanged}" />
44+
</Grid>
45+
</ListBoxItem>
46+
<ListBoxItem Padding="1">
47+
<Grid>
48+
<Grid.ColumnDefinitions>
49+
<ColumnDefinition Width="75" />
50+
<ColumnDefinition Width="*" />
51+
</Grid.ColumnDefinitions>
52+
<TextBlock Text="Last Name:" />
53+
<TextBlock Grid.Column="1"
54+
Foreground="Red"
55+
Text="{Binding LastName,
56+
UpdateSourceTrigger=PropertyChanged}" />
57+
</Grid>
58+
</ListBoxItem>
59+
<ListBoxItem Padding="1">
60+
<Grid>
61+
<Grid.ColumnDefinitions>
62+
<ColumnDefinition Width="75" />
63+
<ColumnDefinition Width="*" />
64+
</Grid.ColumnDefinitions>
65+
<TextBlock Text="Age:" />
66+
<TextBlock Grid.Column="1"
67+
Foreground="Blue"
68+
Text="{Binding Age,
69+
UpdateSourceTrigger=PropertyChanged}" />
70+
</Grid>
71+
</ListBoxItem>
72+
</ListBox>
73+
</DataTemplate>
74+
</syncfusion:CardView.ItemTemplate>
75+
<syncfusion:CardView.EditItemTemplate>
76+
<DataTemplate>
77+
<ListBox ScrollViewer.HorizontalScrollBarVisibility="Disabled">
78+
<ListBoxItem Padding="1" HorizontalContentAlignment="Stretch">
79+
<Grid>
80+
<Grid.ColumnDefinitions>
81+
<ColumnDefinition Width="75" />
82+
<ColumnDefinition />
83+
</Grid.ColumnDefinitions>
84+
<TextBlock Text="First Name:" />
85+
<TextBox
86+
Background="Black"
87+
Foreground="White"
88+
Grid.Column="1"
89+
Text="{Binding FirstName,
90+
UpdateSourceTrigger=PropertyChanged}" />
91+
</Grid>
92+
</ListBoxItem>
93+
<ListBoxItem Padding="1" HorizontalContentAlignment="Stretch">
94+
<Grid>
95+
<Grid.ColumnDefinitions>
96+
<ColumnDefinition Width="75" />
97+
<ColumnDefinition Width="*" />
98+
</Grid.ColumnDefinitions>
99+
<TextBlock Text="Last Name:" />
100+
<TextBox
101+
Background="LightGreen"
102+
Foreground="Red"
103+
Grid.Column="1"
104+
Text="{Binding LastName,
105+
UpdateSourceTrigger=PropertyChanged}" />
106+
</Grid>
107+
</ListBoxItem>
108+
<ListBoxItem Padding="1" HorizontalContentAlignment="Stretch">
109+
<Grid>
110+
<Grid.ColumnDefinitions>
111+
<ColumnDefinition Width="75" />
112+
<ColumnDefinition Width="*" />
113+
</Grid.ColumnDefinitions>
114+
<TextBlock Text="Age:" />
115+
<TextBox
116+
Background="Pink"
117+
Foreground="Blue"
118+
Grid.Column="1"
119+
Text="{Binding Age,
120+
UpdateSourceTrigger=PropertyChanged}" />
121+
</Grid>
122+
</ListBoxItem>
123+
</ListBox>
124+
</DataTemplate>
125+
</syncfusion:CardView.EditItemTemplate>
126+
</syncfusion:CardView>
127+
</Grid>
128+
</Window>

Samples/CustomUI/MainWindow.xaml.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace CustomUI
17+
{
18+
/// <summary>
19+
/// Interaction logic for MainWindow.xaml
20+
/// </summary>
21+
public partial class MainWindow : Window
22+
{
23+
public MainWindow()
24+
{
25+
InitializeComponent();
26+
}
27+
}
28+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace CustomUI
8+
{
9+
//Model.cs
10+
public class CardViewModel
11+
{
12+
public string FirstName { get; set; }
13+
public string LastName { get; set; }
14+
public int Age { get; set; }
15+
}
16+
}

0 commit comments

Comments
 (0)