Skip to content

Commit d5a1566

Browse files
committed
The sample for CheckListBox group and sorting is committed.
1 parent 442ec47 commit d5a1566

32 files changed

+1416
-0
lines changed

CheckListBox_Grouping/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.0"/>
5+
</startup>
6+
</configuration>

CheckListBox_Grouping/App.ico

4.19 KB
Binary file not shown.

CheckListBox_Grouping/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="Getting_Started_2017.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:Getting_Started_2017"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

CheckListBox_Grouping/App.xaml.cs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#region Copyright Syncfusion Inc. 2001-2019.
2+
// Copyright Syncfusion Inc. 2001-2019. All rights reserved.
3+
// Use of this code is subject to the terms of our license.
4+
// A copy of the current license can be obtained at any time by e-mailing
5+
// licensing@syncfusion.com. Any infringement will be prosecuted under
6+
// applicable laws.
7+
#endregion
8+
using System;
9+
using System.Collections.Generic;
10+
using System.Configuration;
11+
using System.Data;
12+
using System.IO;
13+
using System.Linq;
14+
using System.Reflection;
15+
using System.Text;
16+
using System.Threading.Tasks;
17+
using System.Windows;
18+
using Syncfusion.Licensing;
19+
20+
namespace Getting_Started_2017
21+
{
22+
/// <summary>
23+
/// Interaction logic for App.xaml
24+
/// </summary>
25+
public partial class App : Application
26+
{
27+
public App()
28+
{
29+
SyncfusionLicenseProvider.RegisterLicense(DemoCommon.FindLicenseKey());
30+
}
31+
}
32+
33+
public static class DemoCommon
34+
{
35+
/// <summary>
36+
/// Helper method to find a syncfusion license key from the Common folder
37+
/// </summary>
38+
/// <param name="fileName">File name of the syncfusion license key</param>
39+
/// <returns></returns>
40+
public static string FindLicenseKey()
41+
{
42+
int levelsToCheck = 12;
43+
string filePath = @"Common\SyncfusionLicense.txt";
44+
45+
string rootPath = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().CodeBase.Replace(@"file:///", ""));
46+
47+
for (int n = 0; n < levelsToCheck; n++)
48+
{
49+
string fileDataPath = System.IO.Path.Combine(rootPath, filePath);
50+
if (System.IO.File.Exists(fileDataPath))
51+
return File.ReadAllText(fileDataPath, Encoding.UTF8);
52+
DirectoryInfo rootDirectory = Directory.GetParent(rootPath);
53+
if (rootDirectory == null)
54+
break;
55+
rootPath = rootDirectory.FullName;
56+
}
57+
return string.Empty;
58+
}
59+
}
60+
}
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>{743D1162-1F4F-45ED-8BC7-06C30506121C}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>CheckListBox</RootNamespace>
10+
<AssemblyName>CheckListBox</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</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+
<TargetFrameworkProfile />
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
20+
<PlatformTarget>AnyCPU</PlatformTarget>
21+
<DebugSymbols>true</DebugSymbols>
22+
<DebugType>full</DebugType>
23+
<Optimize>false</Optimize>
24+
<OutputPath>bin\Debug\</OutputPath>
25+
<DefineConstants>DEBUG;TRACE</DefineConstants>
26+
<ErrorReport>prompt</ErrorReport>
27+
<WarningLevel>4</WarningLevel>
28+
</PropertyGroup>
29+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
30+
<PlatformTarget>AnyCPU</PlatformTarget>
31+
<DebugType>pdbonly</DebugType>
32+
<Optimize>true</Optimize>
33+
<OutputPath>bin\Release\</OutputPath>
34+
<DefineConstants>TRACE</DefineConstants>
35+
<ErrorReport>prompt</ErrorReport>
36+
<WarningLevel>4</WarningLevel>
37+
</PropertyGroup>
38+
<ItemGroup>
39+
<Reference Include="Syncfusion.Licensing"/>
40+
<Reference Include="Syncfusion.Shared.WPF"/>
41+
<Reference Include="Syncfusion.Tools.WPF"/>
42+
<Reference Include="System" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Xml" />
45+
<Reference Include="Microsoft.CSharp" />
46+
<Reference Include="System.Core" />
47+
<Reference Include="System.Xml.Linq" />
48+
<Reference Include="System.Data.DataSetExtensions" />
49+
<Reference Include="System.Net.Http" />
50+
<Reference Include="System.Xaml">
51+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
52+
</Reference>
53+
<Reference Include="WindowsBase" />
54+
<Reference Include="PresentationCore" />
55+
<Reference Include="PresentationFramework" />
56+
</ItemGroup>
57+
<ItemGroup>
58+
<ApplicationDefinition Include="App.xaml">
59+
<Generator>MSBuild:Compile</Generator>
60+
<SubType>Designer</SubType>
61+
</ApplicationDefinition>
62+
<Compile Include="View Model\View Model.cs" />
63+
<Page Include="MainWindow.xaml">
64+
<Generator>MSBuild:Compile</Generator>
65+
<SubType>Designer</SubType>
66+
</Page>
67+
<Compile Include="App.xaml.cs">
68+
<DependentUpon>App.xaml</DependentUpon>
69+
<SubType>Code</SubType>
70+
</Compile>
71+
<Compile Include="MainWindow.xaml.cs">
72+
<DependentUpon>MainWindow.xaml</DependentUpon>
73+
<SubType>Code</SubType>
74+
</Compile>
75+
</ItemGroup>
76+
<ItemGroup>
77+
<Compile Include="Model\Model.cs" />
78+
<Compile Include="Properties\AssemblyInfo.cs">
79+
<SubType>Code</SubType>
80+
</Compile>
81+
<Compile Include="Properties\Resources.Designer.cs">
82+
<AutoGen>True</AutoGen>
83+
<DesignTime>True</DesignTime>
84+
<DependentUpon>Resources.resx</DependentUpon>
85+
</Compile>
86+
<Compile Include="Properties\Settings.Designer.cs">
87+
<AutoGen>True</AutoGen>
88+
<DependentUpon>Settings.settings</DependentUpon>
89+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
90+
</Compile>
91+
<EmbeddedResource Include="Properties\Resources.resx">
92+
<Generator>ResXFileCodeGenerator</Generator>
93+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
94+
</EmbeddedResource>
95+
<None Include="Properties\Settings.settings">
96+
<Generator>SettingsSingleFileGenerator</Generator>
97+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
98+
</None>
99+
</ItemGroup>
100+
<ItemGroup>
101+
<None Include="App.config" />
102+
</ItemGroup>
103+
<ItemGroup>
104+
<Resource Include="Images\App.ico" />
105+
</ItemGroup>
106+
<ItemGroup>
107+
<Resource Include="App.ico" />
108+
</ItemGroup>
109+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
110+
</Project>
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 15
4+
VisualStudioVersion = 15.0.28307.168
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Getting Started_2017", "Getting Started_2017.csproj", "{743D1162-1F4F-45ED-8BC7-06C30506121C}"
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+
{743D1162-1F4F-45ED-8BC7-06C30506121C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{743D1162-1F4F-45ED-8BC7-06C30506121C}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{743D1162-1F4F-45ED-8BC7-06C30506121C}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{743D1162-1F4F-45ED-8BC7-06C30506121C}.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 = {CD459E84-5402-4646-A161-4EBFD3AFA987}
24+
EndGlobalSection
25+
EndGlobal
4.19 KB
Binary file not shown.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<Window x:Class="CheckListBox_Demo.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:local="clr-namespace:CheckListBox_Demo"
7+
mc:Ignorable="d"
8+
Icon="Images/App.ico"
9+
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
10+
Title="CheckListBox" Height="600" Width="800" WindowStartupLocation="CenterScreen">
11+
<Window.DataContext>
12+
<local:ViewModel/>
13+
</Window.DataContext>
14+
15+
<Grid>
16+
<Grid.ColumnDefinitions>
17+
<ColumnDefinition/>
18+
19+
</Grid.ColumnDefinitions>
20+
<Grid.RowDefinitions>
21+
<RowDefinition Height="50"></RowDefinition>
22+
<RowDefinition></RowDefinition>
23+
</Grid.RowDefinitions>
24+
<TextBlock Text="This sample illustrates the grouping of CheckListBox items based on Category property"
25+
Grid.Row="0" Padding="15 20 0 0" Height="40"
26+
TextWrapping="Wrap" />
27+
28+
<syncfusion:CheckListBox
29+
Grid.Row="1"
30+
DisplayMemberPath="Name"
31+
Width="400" Height="400"
32+
HorizontalAlignment="Center"
33+
VerticalAlignment="Center"
34+
Margin="10"
35+
ItemsSource="{Binding Vegetables}"
36+
SelectedItems="{Binding CheckedItems}"
37+
x:Name="ListBox"/>
38+
<GroupBox Grid.Column="1" Grid.RowSpan="3"
39+
Margin="10" Padding="10">
40+
</GroupBox>
41+
</Grid>
42+
</Window>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#region Copyright Syncfusion Inc. 2001-2019.
2+
// Copyright Syncfusion Inc. 2001-2019. All rights reserved.
3+
// Use of this code is subject to the terms of our license.
4+
// A copy of the current license can be obtained at any time by e-mailing
5+
// licensing@syncfusion.com. Any infringement will be prosecuted under
6+
// applicable laws.
7+
#endregion
8+
using Syncfusion.Windows.Tools.Controls;
9+
using System;
10+
using System.Collections.Generic;
11+
using System.ComponentModel;
12+
using System.Globalization;
13+
using System.Linq;
14+
using System.Text;
15+
using System.Threading.Tasks;
16+
using System.Windows;
17+
using System.Windows.Controls;
18+
using System.Windows.Data;
19+
using System.Windows.Documents;
20+
using System.Windows.Input;
21+
using System.Windows.Media;
22+
using System.Windows.Media.Imaging;
23+
using System.Windows.Navigation;
24+
using System.Windows.Shapes;
25+
26+
namespace CheckListBox_Demo
27+
{
28+
/// <summary>
29+
/// Interaction logic for MainWindow.xaml
30+
/// </summary>
31+
public partial class MainWindow : Window
32+
{
33+
ViewModel v1 = new ViewModel();
34+
public MainWindow()
35+
{
36+
InitializeComponent();
37+
}
38+
39+
}
40+
41+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#region Copyright Syncfusion Inc. 2001-2019.
2+
// Copyright Syncfusion Inc. 2001-2019. All rights reserved.
3+
// Use of this code is subject to the terms of our license.
4+
// A copy of the current license can be obtained at any time by e-mailing
5+
// licensing@syncfusion.com. Any infringement will be prosecuted under
6+
// applicable laws.
7+
#endregion
8+
using System;
9+
using System.Collections.Generic;
10+
using System.Linq;
11+
using System.Text;
12+
using System.Threading.Tasks;
13+
14+
namespace CheckListBox_Demo
15+
{
16+
class Vegetable
17+
{
18+
public string Name { get; set; }
19+
20+
public string Category { get; set; }
21+
22+
}
23+
}

0 commit comments

Comments
 (0)