Skip to content

Commit 6724cb7

Browse files
ranjithsf4081ranjithsf4081
authored andcommitted
Prepared the sample for checking TabView KB document.
1 parent 73d4677 commit 6724cb7

38 files changed

+1120
-0
lines changed

TabViewSample.sln

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.0.31611.283
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TabViewSample", "TabViewSample\TabViewSample.csproj", "{6EA6BA9A-1E17-483F-B73D-400131F5F1C7}"
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+
{6EA6BA9A-1E17-483F-B73D-400131F5F1C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{6EA6BA9A-1E17-483F-B73D-400131F5F1C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{6EA6BA9A-1E17-483F-B73D-400131F5F1C7}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{6EA6BA9A-1E17-483F-B73D-400131F5F1C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{6EA6BA9A-1E17-483F-B73D-400131F5F1C7}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{6EA6BA9A-1E17-483F-B73D-400131F5F1C7}.Release|Any CPU.Deploy.0 = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(ExtensibilityGlobals) = postSolution
25+
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
26+
EndGlobalSection
27+
EndGlobal
Binary file not shown.
Binary file not shown.

TabViewSample/App.xaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version = "1.0" encoding = "UTF-8" ?>
2+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:local="clr-namespace:TabViewSample"
5+
x:Class="TabViewSample.App">
6+
<Application.Resources>
7+
<ResourceDictionary>
8+
<ResourceDictionary.MergedDictionaries>
9+
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
10+
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
11+
</ResourceDictionary.MergedDictionaries>
12+
</ResourceDictionary>
13+
</Application.Resources>
14+
</Application>

TabViewSample/App.xaml.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
namespace TabViewSample;
2+
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = new AppShell();
10+
}
11+
}

TabViewSample/AppShell.xaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<Shell
3+
x:Class="TabViewSample.AppShell"
4+
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
6+
xmlns:local="clr-namespace:TabViewSample"
7+
Shell.FlyoutBehavior="Disabled">
8+
9+
<ShellContent
10+
Title="Home"
11+
ContentTemplate="{DataTemplate local:MainPage}"
12+
Route="MainPage" />
13+
14+
</Shell>

TabViewSample/AppShell.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace TabViewSample;
2+
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}

TabViewSample/MainPage.xaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:tabView="clr-namespace:Syncfusion.Maui.TabView;assembly=Syncfusion.Maui.TabView"
5+
x:Class="TabViewSample.MainPage"
6+
xmlns:local="clr-namespace:TabViewSample">
7+
8+
<ContentPage.BindingContext>
9+
<local:ViewModel/>
10+
</ContentPage.BindingContext>
11+
12+
<tabView:SfTabView TabBarBackground="{Binding TabHeaderBackGround, Mode=TwoWay}" >
13+
<tabView:SfTabItem Header="Calls">
14+
<tabView:SfTabItem.Content>
15+
<Grid BackgroundColor="White" x:Name="AllContactsGrid" >
16+
<ListView x:Name="ContactListView"
17+
ItemsSource="{Binding ContactList}"
18+
RowHeight="75">
19+
<ListView.ItemTemplate>
20+
<DataTemplate>
21+
<ViewCell>
22+
<StackLayout Orientation="Vertical" Margin="30,0,0,0">
23+
<Label
24+
Text="{Binding Name}"
25+
FontSize="24"
26+
/>
27+
<Label
28+
Text="{Binding Number}"
29+
FontSize="20"
30+
TextColor="LightSlateGray" />
31+
</StackLayout>
32+
</ViewCell>
33+
</DataTemplate>
34+
</ListView.ItemTemplate>
35+
</ListView>
36+
</Grid>
37+
</tabView:SfTabItem.Content>
38+
</tabView:SfTabItem>
39+
<tabView:SfTabItem Header="Favorites">
40+
<tabView:SfTabItem.Content>
41+
<Grid BackgroundColor="Green" x:Name="FavoritesGrid" />
42+
</tabView:SfTabItem.Content>
43+
</tabView:SfTabItem>
44+
<tabView:SfTabItem Header="Contacts">
45+
<tabView:SfTabItem.Content>
46+
<Grid BackgroundColor="Red" x:Name="AllContacts" />
47+
</tabView:SfTabItem.Content>
48+
</tabView:SfTabItem>
49+
</tabView:SfTabView>
50+
51+
</ContentPage>

TabViewSample/MainPage.xaml.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using Syncfusion.Maui.TabView;
2+
using System.Collections.ObjectModel;
3+
using System.ComponentModel;
4+
5+
namespace TabViewSample;
6+
7+
public partial class MainPage : ContentPage
8+
{
9+
public MainPage()
10+
{
11+
InitializeComponent();
12+
}
13+
14+
}
15+
16+
public class Model
17+
{
18+
public string Name { get; set; }
19+
public long Number { get; set; }
20+
}
21+
public class ViewModel
22+
{
23+
24+
public Color TabHeaderBackGround { get; set; }
25+
26+
public ObservableCollection<Model> ContactList { get; set; }
27+
28+
public ViewModel()
29+
{
30+
TabHeaderBackGround = Colors.Aqua;
31+
32+
ContactList = new ObservableCollection<Model>();
33+
ContactList.Add(new Model { Name = "Aaron", Number = 7363750 });
34+
ContactList.Add(new Model { Name = "Adam", Number = 7323250 });
35+
ContactList.Add(new Model { Name = "Adrian", Number = 7239121 });
36+
ContactList.Add(new Model { Name = "Alwin", Number = 2329823 });
37+
ContactList.Add(new Model { Name = "Alex", Number = 8013481 });
38+
ContactList.Add(new Model { Name = "Alexander", Number = 7872329 });
39+
ContactList.Add(new Model { Name = "Barry", Number = 7317750 });
40+
}
41+
42+
}
43+

TabViewSample/MauiProgram.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Microsoft.Extensions.Logging;
2+
using Syncfusion.Maui.Core.Hosting;
3+
4+
namespace TabViewSample;
5+
6+
public static class MauiProgram
7+
{
8+
public static MauiApp CreateMauiApp()
9+
{
10+
var builder = MauiApp.CreateBuilder();
11+
builder
12+
.UseMauiApp<App>()
13+
.ConfigureSyncfusionCore()
14+
.ConfigureFonts(fonts =>
15+
{
16+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
17+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
18+
});
19+
20+
#if DEBUG
21+
builder.Logging.AddDebug();
22+
#endif
23+
24+
return builder.Build();
25+
}
26+
}

0 commit comments

Comments
 (0)