Skip to content

Commit 4308242

Browse files
committed
Sample Added
1 parent 8bd9ee1 commit 4308242

38 files changed

+1198
-0
lines changed

TabviewSample/App.xaml

+14
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

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

TabviewSample/AppShell.xaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
Title="TabviewSample">
9+
10+
<ShellContent
11+
Title="Home"
12+
ContentTemplate="{DataTemplate local:MainPage}"
13+
Route="MainPage" />
14+
15+
</Shell>

TabviewSample/AppShell.xaml.cs

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace TabviewSample {
2+
public partial class AppShell : Shell {
3+
public AppShell() {
4+
InitializeComponent();
5+
}
6+
}
7+
}

TabviewSample/MainPage.xaml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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+
x:Class="TabviewSample.MainPage"
5+
xmlns:core="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
6+
xmlns:local="clr-namespace:TabviewSample"
7+
xmlns:tabView="clr-namespace:Syncfusion.Maui.TabView;assembly=Syncfusion.Maui.TabView">
8+
9+
10+
<ContentPage.BindingContext>
11+
<local:TabItemsSourceViewModel />
12+
</ContentPage.BindingContext>
13+
14+
<ContentPage.Content>
15+
<tabView:SfTabView ItemsSource="{Binding TabItems}" TabWidthMode="Default" >
16+
<tabView:SfTabView.HeaderItemTemplate>
17+
<DataTemplate>
18+
<Grid >
19+
<Grid.ColumnDefinitions>
20+
<ColumnDefinition Width="2*"/>
21+
<ColumnDefinition Width="8*"/>
22+
</Grid.ColumnDefinitions>
23+
<core:SfBadgeView HorizontalOptions="Center"
24+
VerticalOptions="Center"
25+
BadgeText="20"
26+
Grid.Column="1"
27+
Margin="0,30,0,0" >
28+
<core:SfBadgeView.Content>
29+
<Label Text="{Binding ID}"
30+
WidthRequest="100"
31+
HeightRequest="60"
32+
Grid.Column="2" />
33+
</core:SfBadgeView.Content>
34+
</core:SfBadgeView>
35+
</Grid>
36+
</DataTemplate>
37+
</tabView:SfTabView.HeaderItemTemplate>
38+
<tabView:SfTabView.ContentItemTemplate>
39+
<DataTemplate>
40+
<Grid BackgroundColor="White" x:Name="AllContactsGrid" >
41+
<ListView x:Name="ContactListView"
42+
ItemsSource="{Binding TabItems}"
43+
RowHeight="75">
44+
<ListView.BindingContext>
45+
<local:TabItemsSourceViewModel />
46+
</ListView.BindingContext>
47+
<ListView.ItemTemplate>
48+
<DataTemplate>
49+
<ViewCell>
50+
<StackLayout Orientation="Vertical" Margin="30,0,0,0">
51+
<Label Text="{Binding ID}"
52+
FontSize="24" />
53+
</StackLayout>
54+
</ViewCell>
55+
</DataTemplate>
56+
</ListView.ItemTemplate>
57+
</ListView>
58+
</Grid>
59+
</DataTemplate>
60+
</tabView:SfTabView.ContentItemTemplate>
61+
</tabView:SfTabView>
62+
</ContentPage.Content>
63+
</ContentPage>

TabviewSample/MainPage.xaml.cs

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
using Syncfusion.Maui.TabView;
2+
using System.Collections.ObjectModel;
3+
using System.ComponentModel;
4+
5+
namespace TabviewSample {
6+
public partial class MainPage : ContentPage
7+
{
8+
public MainPage() {
9+
InitializeComponent();
10+
}
11+
}
12+
13+
public class Model : INotifyPropertyChanged {
14+
15+
public event PropertyChangedEventHandler PropertyChanged;
16+
17+
protected void OnPropertyChanged(string propertyName) {
18+
var handler = PropertyChanged;
19+
if (handler != null)
20+
handler(this, new PropertyChangedEventArgs(propertyName));
21+
}
22+
23+
private string name;
24+
25+
public string Name {
26+
get { return name; }
27+
set {
28+
name = value;
29+
30+
}
31+
}
32+
33+
private string id;
34+
35+
public string ID {
36+
get { return id; }
37+
set {
38+
id = value;
39+
40+
}
41+
}
42+
}
43+
44+
public class TabItemsSourceViewModel : INotifyPropertyChanged {
45+
public event PropertyChangedEventHandler PropertyChanged;
46+
47+
protected void OnPropertyChanged(string propertyName) {
48+
var handler = PropertyChanged;
49+
if (handler != null)
50+
handler(this, new PropertyChangedEventArgs(propertyName));
51+
}
52+
53+
private ObservableCollection<Model> tabItems;
54+
public ObservableCollection<Model> TabItems {
55+
get { return tabItems; }
56+
set {
57+
tabItems = value;
58+
OnPropertyChanged("TabItems");
59+
}
60+
}
61+
public TabItemsSourceViewModel() {
62+
TabItems = new ObservableCollection<Model>();
63+
TabItems.Add(new Model() { ID = "Calls" });
64+
TabItems.Add(new Model() { ID = "Message" });
65+
TabItems.Add(new Model() { ID = "Photos" });
66+
}
67+
}
68+
}
69+
70+
71+
72+

TabviewSample/MauiProgram.cs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Microsoft.Extensions.Logging;
2+
using Syncfusion.Maui.Core.Hosting;
3+
4+
namespace TabviewSample {
5+
public static class MauiProgram {
6+
public static MauiApp CreateMauiApp() {
7+
var builder = MauiApp.CreateBuilder();
8+
builder
9+
.UseMauiApp<App>()
10+
.ConfigureSyncfusionCore()
11+
.ConfigureFonts(fonts => {
12+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
13+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
14+
});
15+
16+
#if DEBUG
17+
builder.Logging.AddDebug();
18+
#endif
19+
20+
return builder.Build();
21+
}
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
4+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
5+
<uses-permission android:name="android.permission.INTERNET" />
6+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Android.App;
2+
using Android.Content.PM;
3+
using Android.OS;
4+
5+
namespace TabviewSample {
6+
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
7+
public class MainActivity : MauiAppCompatActivity {
8+
}
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Android.App;
2+
using Android.Runtime;
3+
4+
namespace TabviewSample {
5+
[Application]
6+
public class MainApplication : MauiApplication {
7+
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
8+
: base(handle, ownership) {
9+
}
10+
11+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="colorPrimary">#512BD4</color>
4+
<color name="colorPrimaryDark">#2B0B98</color>
5+
<color name="colorAccent">#2B0B98</color>
6+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Foundation;
2+
3+
namespace TabviewSample {
4+
[Register("AppDelegate")]
5+
public class AppDelegate : MauiUIApplicationDelegate {
6+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
7+
}
8+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<!-- Enable this value to use browser developer tools while debugging.-->
6+
<!-- See https://aka.ms/blazor-hybrid-developer-tools -->
7+
<key>com.apple.security.get-task-allow</key>
8+
<true/>
9+
</dict>
10+
</plist>
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<!-- See https://aka.ms/maui-publish-app-store#add-entitlements for more information about adding entitlements.-->
5+
<dict>
6+
<key>com.apple.security.app-sandbox</key>
7+
<true/>
8+
<key>com.apple.security.network.client</key>
9+
<true/>
10+
</dict>
11+
</plist>
12+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<!-- The Mac App Store requires you specify if the app uses encryption. -->
6+
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption -->
7+
<!-- <key>ITSAppUsesNonExemptEncryption</key> -->
8+
<!-- Please indicate <true/> or <false/> here. -->
9+
10+
<!-- Specify the category for your app here. -->
11+
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype -->
12+
<!-- <key>LSApplicationCategoryType</key> -->
13+
<!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> -->
14+
<key>UIDeviceFamily</key>
15+
<array>
16+
<integer>2</integer>
17+
</array>
18+
<key>UIRequiredDeviceCapabilities</key>
19+
<array>
20+
<string>arm64</string>
21+
</array>
22+
<key>UISupportedInterfaceOrientations</key>
23+
<array>
24+
<string>UIInterfaceOrientationPortrait</string>
25+
<string>UIInterfaceOrientationLandscapeLeft</string>
26+
<string>UIInterfaceOrientationLandscapeRight</string>
27+
</array>
28+
<key>UISupportedInterfaceOrientations~ipad</key>
29+
<array>
30+
<string>UIInterfaceOrientationPortrait</string>
31+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
32+
<string>UIInterfaceOrientationLandscapeLeft</string>
33+
<string>UIInterfaceOrientationLandscapeRight</string>
34+
</array>
35+
<key>XSAppIconAssets</key>
36+
<string>Assets.xcassets/appicon.appiconset</string>
37+
</dict>
38+
</plist>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using ObjCRuntime;
2+
using UIKit;
3+
4+
namespace TabviewSample {
5+
public class Program {
6+
// This is the main entry point of the application.
7+
static void Main(string[] args) {
8+
// if you want to use a different Application Delegate class from "AppDelegate"
9+
// you can specify it here.
10+
UIApplication.Main(args, null, typeof(AppDelegate));
11+
}
12+
}
13+
}

TabviewSample/Platforms/Tizen/Main.cs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using Microsoft.Maui;
2+
using Microsoft.Maui.Hosting;
3+
using System;
4+
5+
namespace TabviewSample {
6+
internal class Program : MauiApplication {
7+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
8+
9+
static void Main(string[] args) {
10+
var app = new Program();
11+
app.Run(args);
12+
}
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest package="maui-application-id-placeholder" version="0.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
3+
<profile name="common" />
4+
<ui-application appid="maui-application-id-placeholder" exec="TabviewSample.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
5+
<label>maui-application-title-placeholder</label>
6+
<icon>maui-appicon-placeholder</icon>
7+
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
8+
</ui-application>
9+
<shortcut-list />
10+
<privileges>
11+
<privilege>http://tizen.org/privilege/internet</privilege>
12+
</privileges>
13+
<dependencies />
14+
<provides-appdefined-privileges />
15+
</manifest>
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<maui:MauiWinUIApplication
2+
x:Class="TabviewSample.WinUI.App"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:maui="using:Microsoft.Maui"
6+
xmlns:local="using:TabviewSample.WinUI">
7+
8+
</maui:MauiWinUIApplication>

0 commit comments

Comments
 (0)