Skip to content

Commit 2ee7617

Browse files
author
prabakaran.sangameswaran
committed
Vol3 samples committed.
1 parent 7176a66 commit 2ee7617

18 files changed

+847
-31
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@ This repository contains the samples that demonstrate the functionalities of Cal
2929
</tr>
3030
<tr>
3131
<td><a href="Samples/Previous-NextButton">Previous-Next scroll button template</a></td>
32+
<td><a href="Samples/Template">Custom UI for all cells</a></td>
33+
<td><a href="Samples/CalenderEdit_DataTemplateSelector">Custom UI for specific cells</a></td>
3234
</tr>
3335
</table>
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.6" />
5+
</startup>
6+
</configuration>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="CalenderEdit_DataTemplateSelector.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:CalenderEdit_DataTemplateSelector"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>
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 CalenderEdit_DataTemplateSelector
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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>{B8560160-D9D6-4609-8998-A0498A2392DD}</ProjectGuid>
8+
<OutputType>WinExe</OutputType>
9+
<RootNamespace>CalenderEdit_DataTemplateSelector</RootNamespace>
10+
<AssemblyName>CalenderEdit-DataTemplateSelector</AssemblyName>
11+
<TargetFrameworkVersion>v4.6</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.Shared.WPF, Version=18.2460.0.57, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
39+
<HintPath>packages\Syncfusion.Shared.WPF.18.2.0.57\lib\net46\Syncfusion.Shared.WPF.dll</HintPath>
40+
</Reference>
41+
<Reference Include="Syncfusion.Tools.WPF, Version=18.2460.0.57, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
42+
<HintPath>packages\Syncfusion.Tools.WPF.18.2.0.57\lib\net46\Syncfusion.Tools.WPF.dll</HintPath>
43+
</Reference>
44+
<Reference Include="System" />
45+
<Reference Include="System.Data" />
46+
<Reference Include="System.Xml" />
47+
<Reference Include="Microsoft.CSharp" />
48+
<Reference Include="System.Core" />
49+
<Reference Include="System.Xml.Linq" />
50+
<Reference Include="System.Data.DataSetExtensions" />
51+
<Reference Include="System.Net.Http" />
52+
<Reference Include="System.Xaml">
53+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
54+
</Reference>
55+
<Reference Include="WindowsBase" />
56+
<Reference Include="PresentationCore" />
57+
<Reference Include="PresentationFramework" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<ApplicationDefinition Include="App.xaml">
61+
<Generator>MSBuild:Compile</Generator>
62+
<SubType>Designer</SubType>
63+
</ApplicationDefinition>
64+
<Compile Include="Selector\CalenderDataTemplateSelector.cs" />
65+
<Page Include="MainWindow.xaml">
66+
<Generator>MSBuild:Compile</Generator>
67+
<SubType>Designer</SubType>
68+
</Page>
69+
<Compile Include="App.xaml.cs">
70+
<DependentUpon>App.xaml</DependentUpon>
71+
<SubType>Code</SubType>
72+
</Compile>
73+
<Compile Include="MainWindow.xaml.cs">
74+
<DependentUpon>MainWindow.xaml</DependentUpon>
75+
<SubType>Code</SubType>
76+
</Compile>
77+
</ItemGroup>
78+
<ItemGroup>
79+
<Compile Include="Properties\AssemblyInfo.cs">
80+
<SubType>Code</SubType>
81+
</Compile>
82+
<Compile Include="Properties\Resources.Designer.cs">
83+
<AutoGen>True</AutoGen>
84+
<DesignTime>True</DesignTime>
85+
<DependentUpon>Resources.resx</DependentUpon>
86+
</Compile>
87+
<Compile Include="Properties\Settings.Designer.cs">
88+
<AutoGen>True</AutoGen>
89+
<DependentUpon>Settings.settings</DependentUpon>
90+
<DesignTimeSharedInput>True</DesignTimeSharedInput>
91+
</Compile>
92+
<EmbeddedResource Include="Properties\Resources.resx">
93+
<Generator>ResXFileCodeGenerator</Generator>
94+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
95+
</EmbeddedResource>
96+
<None Include="packages.config" />
97+
<None Include="Properties\Settings.settings">
98+
<Generator>SettingsSingleFileGenerator</Generator>
99+
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
100+
</None>
101+
</ItemGroup>
102+
<ItemGroup>
103+
<None Include="App.config" />
104+
</ItemGroup>
105+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
106+
</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 Version 16
4+
VisualStudioVersion = 16.0.30128.74
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CalenderEdit-DataTemplateSelector", "CalenderEdit-DataTemplateSelector.csproj", "{B8560160-D9D6-4609-8998-A0498A2392DD}"
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+
{B8560160-D9D6-4609-8998-A0498A2392DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{B8560160-D9D6-4609-8998-A0498A2392DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{B8560160-D9D6-4609-8998-A0498A2392DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{B8560160-D9D6-4609-8998-A0498A2392DD}.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 = {F84B61F8-693E-4223-BB24-4C7D5B8A2295}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
<Window x:Class="CalenderEdit_DataTemplateSelector.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:CalenderEdit_DataTemplateSelector"
7+
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
8+
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
9+
Title="CalendarEdit - DataTemplateSelector" Height="400" Width="400">
10+
11+
<Window.Resources>
12+
13+
<!--Day Cell Templates-->
14+
<local:CalendarDataTemplateSelector x:Key="Selector">
15+
<local:CalendarDataTemplateSelector.DayCellTemplate1>
16+
<DataTemplate>
17+
<Grid>
18+
<TextBlock Text="{Binding}"
19+
TextAlignment="Center"
20+
Height="17" Width="20"
21+
Background="Green"
22+
Foreground="Yellow"/>
23+
</Grid>
24+
</DataTemplate>
25+
</local:CalendarDataTemplateSelector.DayCellTemplate1>
26+
27+
<local:CalendarDataTemplateSelector.DayCellTemplate2>
28+
<DataTemplate>
29+
<Grid>
30+
<TextBlock Text="{Binding}"
31+
TextAlignment="Center"
32+
Height="17" Width="20"
33+
Background="Blue"
34+
Foreground="Yellow"/>
35+
</Grid>
36+
</DataTemplate>
37+
</local:CalendarDataTemplateSelector.DayCellTemplate2>
38+
39+
<!--DayName Cell Templates-->
40+
<local:CalendarDataTemplateSelector.DayNameCellTemplate1>
41+
<DataTemplate>
42+
<Grid>
43+
<TextBlock Text="{Binding}"
44+
TextAlignment="Center"
45+
Height="17" Width="20"
46+
Background="Red"
47+
Foreground="Yellow"/>
48+
</Grid>
49+
</DataTemplate>
50+
</local:CalendarDataTemplateSelector.DayNameCellTemplate1>
51+
52+
<local:CalendarDataTemplateSelector.DayNameCellTemplate2>
53+
<DataTemplate>
54+
<Grid>
55+
<TextBlock Text="{Binding}"
56+
TextAlignment="Center"
57+
Height="17" Width="20"
58+
Background="Black"
59+
Foreground="Yellow"/>
60+
</Grid>
61+
</DataTemplate>
62+
</local:CalendarDataTemplateSelector.DayNameCellTemplate2>
63+
64+
<!--Month Cell Templates-->
65+
<local:CalendarDataTemplateSelector.MonthCellTemplate1>
66+
<DataTemplate>
67+
<Grid>
68+
<TextBlock Text="{Binding}"
69+
TextAlignment="Center"
70+
Height="25" Width="40"
71+
FontSize="15"
72+
Background="Orange"
73+
Foreground="Yellow"/>
74+
</Grid>
75+
</DataTemplate>
76+
</local:CalendarDataTemplateSelector.MonthCellTemplate1>
77+
78+
<local:CalendarDataTemplateSelector.MonthCellTemplate2>
79+
<DataTemplate>
80+
<Grid>
81+
<TextBlock Text="{Binding}"
82+
TextAlignment="Center"
83+
Height="25" Width="40"
84+
FontSize="15"
85+
Background="DarkCyan"
86+
Foreground="Yellow"/>
87+
</Grid>
88+
</DataTemplate>
89+
</local:CalendarDataTemplateSelector.MonthCellTemplate2>
90+
91+
<!--Year Cell Templates-->
92+
<local:CalendarDataTemplateSelector.YearCellTemplate1>
93+
<DataTemplate>
94+
<Grid>
95+
<TextBlock Text="{Binding}"
96+
TextAlignment="Center"
97+
Height="25" Width="40"
98+
FontSize="15"
99+
Background="LightGreen"
100+
Foreground="Red"/>
101+
</Grid>
102+
</DataTemplate>
103+
</local:CalendarDataTemplateSelector.YearCellTemplate1>
104+
105+
<local:CalendarDataTemplateSelector.YearCellTemplate2>
106+
<DataTemplate>
107+
<Grid>
108+
<TextBlock Text="{Binding}"
109+
TextAlignment="Center"
110+
Height="25" Width="40"
111+
FontSize="15"
112+
Background="Yellow"
113+
Foreground="Blue"/>
114+
</Grid>
115+
</DataTemplate>
116+
</local:CalendarDataTemplateSelector.YearCellTemplate2>
117+
118+
<!--Year range Cell Templates-->
119+
<local:CalendarDataTemplateSelector.YearRangeCellTemplate1>
120+
<DataTemplate>
121+
<Grid>
122+
<TextBlock Text="{Binding}"
123+
TextAlignment="Center"
124+
Height="30" Width="40"
125+
Background="Aqua"
126+
Foreground="Red"/>
127+
</Grid>
128+
</DataTemplate>
129+
</local:CalendarDataTemplateSelector.YearRangeCellTemplate1>
130+
131+
<local:CalendarDataTemplateSelector.YearRangeCellTemplate2>
132+
<DataTemplate>
133+
<Grid>
134+
<TextBlock Text="{Binding}"
135+
TextAlignment="Center"
136+
Height="30" Width="40"
137+
Background="Brown"
138+
Foreground="White"/>
139+
</Grid>
140+
</DataTemplate>
141+
</local:CalendarDataTemplateSelector.YearRangeCellTemplate2>
142+
143+
<!--Week numbers cell Templates-->
144+
<local:CalendarDataTemplateSelector.WeekNumberCellTemplate1>
145+
<DataTemplate>
146+
<Grid>
147+
<TextBlock Text="{Binding}"
148+
TextAlignment="Center"
149+
Height="18" Width="20"
150+
Background="Orange"
151+
Foreground="Red"/>
152+
</Grid>
153+
</DataTemplate>
154+
</local:CalendarDataTemplateSelector.WeekNumberCellTemplate1>
155+
156+
<local:CalendarDataTemplateSelector.WeekNumberCellTemplate2>
157+
<DataTemplate>
158+
<Grid>
159+
<TextBlock Text="{Binding}"
160+
TextAlignment="Center"
161+
Height="18" Width="20"
162+
Background="Aqua"
163+
Foreground="Blue"/>
164+
</Grid>
165+
</DataTemplate>
166+
</local:CalendarDataTemplateSelector.WeekNumberCellTemplate2>
167+
</local:CalendarDataTemplateSelector>
168+
</Window.Resources>
169+
<Grid>
170+
<syncfusion:CalendarEdit CalenderEditDataTemplateSelector="{StaticResource Selector}"
171+
ShowWeekNumbers="True"
172+
Width="190" Height="190"
173+
Name="calendarEdit" />
174+
</Grid>
175+
</Window>
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 CalenderEdit_DataTemplateSelector
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+
}

0 commit comments

Comments
 (0)