Skip to content

Commit f0f7f3a

Browse files
author
prabakaran.sangameswaran
committed
TabListContextMenuOptions and TabItemLayout sample committed
1 parent 41f547a commit f0f7f3a

29 files changed

+1454
-0
lines changed
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>

Samples/TabControlLayout/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="TabControlLayout.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:TabControlLayout"
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 TabControlLayout
10+
{
11+
/// <summary>
12+
/// Interaction logic for App.xaml
13+
/// </summary>
14+
public partial class App : Application
15+
{
16+
}
17+
}
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
<Window x:Class="TabControlLayout.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:TabControlLayout"
7+
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
8+
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
9+
Title="TabControl - TabItem Layout" Height="700" Width="995">
10+
<Window.Resources>
11+
<Style TargetType="syncfusion:TabItemExt"
12+
x:Key="TabItemTemplate" >
13+
<Setter Property="HeaderTemplate">
14+
<Setter.Value>
15+
<DataTemplate>
16+
<TextBlock Text="{Binding Header, Mode=TwoWay}" />
17+
</DataTemplate>
18+
</Setter.Value>
19+
</Setter>
20+
</Style>
21+
<DataTemplate x:Key="EditHeaderTemplate">
22+
<TextBox Text="{Binding Header, Mode=TwoWay}"/>
23+
</DataTemplate>
24+
<DataTemplate x:Key="TabContentTemplate">
25+
<TextBlock Height="20"
26+
TextAlignment="Center" T
27+
ext="{Binding Content}" />
28+
</DataTemplate>
29+
</Window.Resources>
30+
<Window.DataContext>
31+
<local:ViewModel/>
32+
</Window.DataContext>
33+
34+
<Grid >
35+
<Grid.RowDefinitions>
36+
<RowDefinition />
37+
<RowDefinition />
38+
<RowDefinition />
39+
</Grid.RowDefinitions>
40+
<Grid.ColumnDefinitions>
41+
<ColumnDefinition />
42+
<ColumnDefinition />
43+
</Grid.ColumnDefinitions>
44+
<StackPanel Grid.Row="0"
45+
Grid.Column="0"
46+
Margin="10">
47+
<Label
48+
HorizontalAlignment="Left"
49+
VerticalAlignment="Center"
50+
Content="SingleLine"
51+
FontWeight="SemiBold"
52+
Height="30"
53+
Width="100"/>
54+
<syncfusion:TabControlExt IsNewButtonEnabled="True"
55+
ItemsSource="{Binding TabItems}"
56+
TabItemLayout="SingleLine"
57+
EditHeaderTemplate="{StaticResource EditHeaderTemplate}"
58+
ContentTemplate="{StaticResource TabContentTemplate}"
59+
ItemContainerStyle="{StaticResource TabItemTemplate}"
60+
Name="tabControlExt">
61+
</syncfusion:TabControlExt>
62+
</StackPanel>
63+
<StackPanel Grid.Row="0"
64+
Grid.Column="1"
65+
Margin="10" >
66+
<Label
67+
HorizontalAlignment="Left"
68+
VerticalAlignment="Center"
69+
Content="SingleLineStar"
70+
FontWeight="SemiBold"
71+
Height="30"
72+
Width="100" />
73+
<syncfusion:TabControlExt
74+
ItemsSource="{Binding Multiline_Tabitems}"
75+
TabItemLayout="SingleLineStar"
76+
EditHeaderTemplate="{StaticResource EditHeaderTemplate}"
77+
ContentTemplate="{StaticResource TabContentTemplate}"
78+
ItemContainerStyle="{StaticResource TabItemTemplate}"
79+
Name="tabControlExt1" >
80+
</syncfusion:TabControlExt>
81+
</StackPanel>
82+
<StackPanel Grid.Row="1"
83+
Grid.Column="0"
84+
Margin="10">
85+
<Label
86+
HorizontalAlignment="Left"
87+
VerticalAlignment="Center"
88+
Content="MultiLine"
89+
FontWeight="SemiBold"
90+
Height="30"
91+
Width="100"/>
92+
93+
<syncfusion:TabControlExt
94+
ItemsSource="{Binding TabItems}"
95+
TabItemLayout="MultiLine"
96+
EditHeaderTemplate="{StaticResource EditHeaderTemplate}"
97+
ContentTemplate="{StaticResource TabContentTemplate}"
98+
ItemContainerStyle="{StaticResource TabItemTemplate}"
99+
Name="tabControlExt2">
100+
</syncfusion:TabControlExt>
101+
</StackPanel>
102+
<StackPanel Grid.Row="1" Grid.Column="1" Margin="10">
103+
<Label
104+
HorizontalAlignment="Left"
105+
VerticalAlignment="Center"
106+
Content="MultiLineStar"
107+
FontWeight="SemiBold"
108+
Height="30"
109+
Width="100"/>
110+
<syncfusion:TabControlExt
111+
ItemsSource="{Binding TabItems}"
112+
TabItemLayout="MultiLineStar"
113+
EditHeaderTemplate="{StaticResource EditHeaderTemplate}"
114+
ContentTemplate="{StaticResource TabContentTemplate}"
115+
ItemContainerStyle="{StaticResource TabItemTemplate}"
116+
Name="tabControlExt3">
117+
</syncfusion:TabControlExt>
118+
</StackPanel>
119+
<StackPanel Grid.Row="2"
120+
Grid.Column="0"
121+
Margin="10">
122+
<Label
123+
HorizontalAlignment="Left"
124+
VerticalAlignment="Center"
125+
Content="MultiLineWithFullWidth"
126+
FontWeight="SemiBold"
127+
Height="30"
128+
Width="auto"/>
129+
<syncfusion:TabControlExt
130+
ItemsSource="{Binding TabItems}"
131+
TabItemLayout="MultiLineWithFullWidth"
132+
EditHeaderTemplate="{StaticResource EditHeaderTemplate}"
133+
ContentTemplate="{StaticResource TabContentTemplate}"
134+
ItemContainerStyle="{StaticResource TabItemTemplate}"
135+
Name="tabControlExt4">
136+
</syncfusion:TabControlExt>
137+
</StackPanel>
138+
</Grid>
139+
</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 TabControlLayout
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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace TabControlLayout
8+
{
9+
10+
public class Model
11+
{
12+
public string Header { get; set; }
13+
public string Content { get; set; }
14+
public Model()
15+
{
16+
17+
}
18+
}
19+
20+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using System.Reflection;
2+
using System.Resources;
3+
using System.Runtime.CompilerServices;
4+
using System.Runtime.InteropServices;
5+
using System.Windows;
6+
7+
// General Information about an assembly is controlled through the following
8+
// set of attributes. Change these attribute values to modify the information
9+
// associated with an assembly.
10+
[assembly: AssemblyTitle("TabControlLayout")]
11+
[assembly: AssemblyDescription("")]
12+
[assembly: AssemblyConfiguration("")]
13+
[assembly: AssemblyCompany("")]
14+
[assembly: AssemblyProduct("TabControlLayout")]
15+
[assembly: AssemblyCopyright("Copyright © 2020")]
16+
[assembly: AssemblyTrademark("")]
17+
[assembly: AssemblyCulture("")]
18+
19+
// Setting ComVisible to false makes the types in this assembly not visible
20+
// to COM components. If you need to access a type in this assembly from
21+
// COM, set the ComVisible attribute to true on that type.
22+
[assembly: ComVisible(false)]
23+
24+
//In order to begin building localizable applications, set
25+
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
26+
//inside a <PropertyGroup>. For example, if you are using US english
27+
//in your source files, set the <UICulture> to en-US. Then uncomment
28+
//the NeutralResourceLanguage attribute below. Update the "en-US" in
29+
//the line below to match the UICulture setting in the project file.
30+
31+
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32+
33+
34+
[assembly: ThemeInfo(
35+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36+
//(used if a resource is not found in the page,
37+
// or application resource dictionaries)
38+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39+
//(used if a resource is not found in the page,
40+
// app, or any theme specific resource dictionaries)
41+
)]
42+
43+
44+
// Version information for an assembly consists of the following four values:
45+
//
46+
// Major Version
47+
// Minor Version
48+
// Build Number
49+
// Revision
50+
//
51+
// You can specify all the values or you can default the Build and Revision Numbers
52+
// by using the '*' as shown below:
53+
// [assembly: AssemblyVersion("1.0.*")]
54+
[assembly: AssemblyVersion("1.0.0.0")]
55+
[assembly: AssemblyFileVersion("1.0.0.0")]

Samples/TabControlLayout/Properties/Resources.Designer.cs

Lines changed: 71 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)