diff --git a/README.md b/README.md index f24f246..5cdb843 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,48 @@ # Modify-the-header-image-color-in-the-MAUI-Tab-View + This sample demonstrates how to modify the header image color in the MAUI Tab View control within a .NET MAUI application. + +## Sample + +```xaml + + + + + + + + + + + + + + + + + + + James + Richard + Michael + Alex + Clara + + + + + + +``` + +## Requirements to run the demo + +To run the demo, refer to [System Requirements for .NET MAUI](https://help.syncfusion.com/maui/system-requirements) + +## Troubleshooting: + +### Path too long exception + +If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project. diff --git a/TabViewSample/TabViewSample.sln b/TabViewSample/TabViewSample.sln new file mode 100644 index 0000000..537bea6 --- /dev/null +++ b/TabViewSample/TabViewSample.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36414.22 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TabViewSample", "TabViewSample\TabViewSample.csproj", "{66FF6784-A21A-4372-AEC6-86020745A9C5}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {66FF6784-A21A-4372-AEC6-86020745A9C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66FF6784-A21A-4372-AEC6-86020745A9C5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66FF6784-A21A-4372-AEC6-86020745A9C5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66FF6784-A21A-4372-AEC6-86020745A9C5}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0AC4B5AC-EFFC-4B11-BA6E-C432569B9749} + EndGlobalSection +EndGlobal diff --git a/TabViewSample/TabViewSample/App.xaml b/TabViewSample/TabViewSample/App.xaml new file mode 100644 index 0000000..54afd00 --- /dev/null +++ b/TabViewSample/TabViewSample/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/TabViewSample/TabViewSample/App.xaml.cs b/TabViewSample/TabViewSample/App.xaml.cs new file mode 100644 index 0000000..f4224c7 --- /dev/null +++ b/TabViewSample/TabViewSample/App.xaml.cs @@ -0,0 +1,15 @@ +namespace TabViewSample +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + } + + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new AppShell()); + } + } +} \ No newline at end of file diff --git a/TabViewSample/TabViewSample/AppShell.xaml b/TabViewSample/TabViewSample/AppShell.xaml new file mode 100644 index 0000000..b2a94a9 --- /dev/null +++ b/TabViewSample/TabViewSample/AppShell.xaml @@ -0,0 +1,13 @@ + + + + + + diff --git a/TabViewSample/TabViewSample/AppShell.xaml.cs b/TabViewSample/TabViewSample/AppShell.xaml.cs new file mode 100644 index 0000000..a1fec07 --- /dev/null +++ b/TabViewSample/TabViewSample/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace TabViewSample +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/TabViewSample/TabViewSample/GlobalXmlns.cs b/TabViewSample/TabViewSample/GlobalXmlns.cs new file mode 100644 index 0000000..97b9d57 --- /dev/null +++ b/TabViewSample/TabViewSample/GlobalXmlns.cs @@ -0,0 +1,2 @@ +[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "TabViewSample")] +[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "TabViewSample.Pages")] diff --git a/TabViewSample/TabViewSample/MainPage.xaml b/TabViewSample/TabViewSample/MainPage.xaml new file mode 100644 index 0000000..f4e447b --- /dev/null +++ b/TabViewSample/TabViewSample/MainPage.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + James + Richard + Michael + Alex + Clara + + + + + + + + + diff --git a/TabViewSample/TabViewSample/MainPage.xaml.cs b/TabViewSample/TabViewSample/MainPage.xaml.cs new file mode 100644 index 0000000..9534fb7 --- /dev/null +++ b/TabViewSample/TabViewSample/MainPage.xaml.cs @@ -0,0 +1,21 @@ +using Syncfusion.Maui.Toolkit.TabView; + +namespace TabViewSample +{ + public partial class MainPage : ContentPage + { + public MainPage() + { + InitializeComponent(); + } + + private void OnSelectionChanged(object sender, TabSelectionChangedEventArgs e) + { + if (e.NewIndex >= 0 && e.OldIndex >= 0) + { + viewModel.TabItems[e.OldIndex].SelectedColor = Colors.Gray; + viewModel.TabItems[e.NewIndex].SelectedColor = Colors.Red; + } + } + } +} diff --git a/TabViewSample/TabViewSample/MauiProgram.cs b/TabViewSample/TabViewSample/MauiProgram.cs new file mode 100644 index 0000000..072e82d --- /dev/null +++ b/TabViewSample/TabViewSample/MauiProgram.cs @@ -0,0 +1,29 @@ +using CommunityToolkit.Maui; +using Microsoft.Extensions.Logging; +using Syncfusion.Maui.Toolkit.Hosting; + +namespace TabViewSample +{ + public static class MauiProgram + { + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .UseMauiCommunityToolkit() + .ConfigureSyncfusionToolkit() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }); + +#if DEBUG + builder.Logging.AddDebug(); +#endif + + return builder.Build(); + } + } +} diff --git a/TabViewSample/TabViewSample/Model.cs b/TabViewSample/TabViewSample/Model.cs new file mode 100644 index 0000000..225c84c --- /dev/null +++ b/TabViewSample/TabViewSample/Model.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TabViewSample +{ + public class Model : INotifyPropertyChanged + { + public event PropertyChangedEventHandler? PropertyChanged; + + protected void OnPropertyChanged(string propertyName) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new PropertyChangedEventArgs(propertyName)); + } + + private string? image; + public string? ImageName + { + get { return image; } + set + { + image = value; + OnPropertyChanged("ImageName"); + } + } + private Color? selectedColor; + public Color? SelectedColor + { + get => selectedColor; + set + { + selectedColor = value; + OnPropertyChanged(nameof(SelectedColor)); + } + } + } +} diff --git a/TabViewSample/TabViewSample/Platforms/Android/AndroidManifest.xml b/TabViewSample/TabViewSample/Platforms/Android/AndroidManifest.xml new file mode 100644 index 0000000..e9937ad --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/TabViewSample/TabViewSample/Platforms/Android/MainActivity.cs b/TabViewSample/TabViewSample/Platforms/Android/MainActivity.cs new file mode 100644 index 0000000..ddd3e7e --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/Android/MainActivity.cs @@ -0,0 +1,11 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace TabViewSample +{ + [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] + public class MainActivity : MauiAppCompatActivity + { + } +} diff --git a/TabViewSample/TabViewSample/Platforms/Android/MainApplication.cs b/TabViewSample/TabViewSample/Platforms/Android/MainApplication.cs new file mode 100644 index 0000000..c22b7a7 --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/Android/MainApplication.cs @@ -0,0 +1,16 @@ +using Android.App; +using Android.Runtime; + +namespace TabViewSample +{ + [Application] + public class MainApplication : MauiApplication + { + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/TabViewSample/TabViewSample/Platforms/Android/Resources/values/colors.xml b/TabViewSample/TabViewSample/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 0000000..c04d749 --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/TabViewSample/TabViewSample/Platforms/MacCatalyst/AppDelegate.cs b/TabViewSample/TabViewSample/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 0000000..635f30d --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,10 @@ +using Foundation; + +namespace TabViewSample +{ + [Register("AppDelegate")] + public class AppDelegate : MauiUIApplicationDelegate + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/TabViewSample/TabViewSample/Platforms/MacCatalyst/Entitlements.plist b/TabViewSample/TabViewSample/Platforms/MacCatalyst/Entitlements.plist new file mode 100644 index 0000000..de4adc9 --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/MacCatalyst/Entitlements.plist @@ -0,0 +1,14 @@ + + + + + + + com.apple.security.app-sandbox + + + com.apple.security.network.client + + + + diff --git a/TabViewSample/TabViewSample/Platforms/MacCatalyst/Info.plist b/TabViewSample/TabViewSample/Platforms/MacCatalyst/Info.plist new file mode 100644 index 0000000..7268977 --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + UIDeviceFamily + + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/TabViewSample/TabViewSample/Platforms/MacCatalyst/Program.cs b/TabViewSample/TabViewSample/Platforms/MacCatalyst/Program.cs new file mode 100644 index 0000000..d898aaf --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,16 @@ +using ObjCRuntime; +using UIKit; + +namespace TabViewSample +{ + public class Program + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } + } +} diff --git a/TabViewSample/TabViewSample/Platforms/Tizen/Main.cs b/TabViewSample/TabViewSample/Platforms/Tizen/Main.cs new file mode 100644 index 0000000..a3d19ea --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/Tizen/Main.cs @@ -0,0 +1,17 @@ +using System; +using Microsoft.Maui; +using Microsoft.Maui.Hosting; + +namespace TabViewSample +{ + internal class Program : MauiApplication + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } + } +} diff --git a/TabViewSample/TabViewSample/Platforms/Tizen/tizen-manifest.xml b/TabViewSample/TabViewSample/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 0000000..b5b46cd --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + + maui-appicon-placeholder + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/TabViewSample/TabViewSample/Platforms/Windows/App.xaml b/TabViewSample/TabViewSample/Platforms/Windows/App.xaml new file mode 100644 index 0000000..703fd11 --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/TabViewSample/TabViewSample/Platforms/Windows/App.xaml.cs b/TabViewSample/TabViewSample/Platforms/Windows/App.xaml.cs new file mode 100644 index 0000000..d43cef5 --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/Windows/App.xaml.cs @@ -0,0 +1,25 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace TabViewSample.WinUI +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : MauiWinUIApplication + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } + +} diff --git a/TabViewSample/TabViewSample/Platforms/Windows/Package.appxmanifest b/TabViewSample/TabViewSample/Platforms/Windows/Package.appxmanifest new file mode 100644 index 0000000..c1d386c --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,46 @@ + + + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TabViewSample/TabViewSample/Platforms/Windows/app.manifest b/TabViewSample/TabViewSample/Platforms/Windows/app.manifest new file mode 100644 index 0000000..f0ac048 --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/TabViewSample/TabViewSample/Platforms/iOS/AppDelegate.cs b/TabViewSample/TabViewSample/Platforms/iOS/AppDelegate.cs new file mode 100644 index 0000000..635f30d --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,10 @@ +using Foundation; + +namespace TabViewSample +{ + [Register("AppDelegate")] + public class AppDelegate : MauiUIApplicationDelegate + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/TabViewSample/TabViewSample/Platforms/iOS/Info.plist b/TabViewSample/TabViewSample/Platforms/iOS/Info.plist new file mode 100644 index 0000000..0004a4f --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/iOS/Info.plist @@ -0,0 +1,32 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/TabViewSample/TabViewSample/Platforms/iOS/Program.cs b/TabViewSample/TabViewSample/Platforms/iOS/Program.cs new file mode 100644 index 0000000..d898aaf --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/iOS/Program.cs @@ -0,0 +1,16 @@ +using ObjCRuntime; +using UIKit; + +namespace TabViewSample +{ + public class Program + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } + } +} diff --git a/TabViewSample/TabViewSample/Platforms/iOS/Resources/PrivacyInfo.xcprivacy b/TabViewSample/TabViewSample/Platforms/iOS/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..24ab3b4 --- /dev/null +++ b/TabViewSample/TabViewSample/Platforms/iOS/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,51 @@ + + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryDiskSpace + NSPrivacyAccessedAPITypeReasons + + E174.1 + + + + + + diff --git a/TabViewSample/TabViewSample/Properties/launchSettings.json b/TabViewSample/TabViewSample/Properties/launchSettings.json new file mode 100644 index 0000000..4f85793 --- /dev/null +++ b/TabViewSample/TabViewSample/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "Project", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/TabViewSample/TabViewSample/Resources/AppIcon/appicon.svg b/TabViewSample/TabViewSample/Resources/AppIcon/appicon.svg new file mode 100644 index 0000000..9d63b65 --- /dev/null +++ b/TabViewSample/TabViewSample/Resources/AppIcon/appicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/TabViewSample/TabViewSample/Resources/AppIcon/appiconfg.svg b/TabViewSample/TabViewSample/Resources/AppIcon/appiconfg.svg new file mode 100644 index 0000000..21dfb25 --- /dev/null +++ b/TabViewSample/TabViewSample/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/TabViewSample/TabViewSample/Resources/Fonts/OpenSans-Regular.ttf b/TabViewSample/TabViewSample/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..1aed1f2 Binary files /dev/null and b/TabViewSample/TabViewSample/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/TabViewSample/TabViewSample/Resources/Fonts/OpenSans-Semibold.ttf b/TabViewSample/TabViewSample/Resources/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 0000000..69ec877 Binary files /dev/null and b/TabViewSample/TabViewSample/Resources/Fonts/OpenSans-Semibold.ttf differ diff --git a/TabViewSample/TabViewSample/Resources/Images/call.png b/TabViewSample/TabViewSample/Resources/Images/call.png new file mode 100644 index 0000000..3e6b4e6 Binary files /dev/null and b/TabViewSample/TabViewSample/Resources/Images/call.png differ diff --git a/TabViewSample/TabViewSample/Resources/Images/contacts.png b/TabViewSample/TabViewSample/Resources/Images/contacts.png new file mode 100644 index 0000000..5cd0f99 Binary files /dev/null and b/TabViewSample/TabViewSample/Resources/Images/contacts.png differ diff --git a/TabViewSample/TabViewSample/Resources/Images/dotnet_bot.png b/TabViewSample/TabViewSample/Resources/Images/dotnet_bot.png new file mode 100644 index 0000000..1d1b981 Binary files /dev/null and b/TabViewSample/TabViewSample/Resources/Images/dotnet_bot.png differ diff --git a/TabViewSample/TabViewSample/Resources/Images/favorite.png b/TabViewSample/TabViewSample/Resources/Images/favorite.png new file mode 100644 index 0000000..fc6c77e Binary files /dev/null and b/TabViewSample/TabViewSample/Resources/Images/favorite.png differ diff --git a/TabViewSample/TabViewSample/Resources/Raw/AboutAssets.txt b/TabViewSample/TabViewSample/Resources/Raw/AboutAssets.txt new file mode 100644 index 0000000..89dc758 --- /dev/null +++ b/TabViewSample/TabViewSample/Resources/Raw/AboutAssets.txt @@ -0,0 +1,15 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories). Deployment of the asset to your application +is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. + + + +These files will be deployed with your package and will be accessible using Essentials: + + async Task LoadMauiAsset() + { + using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); + using var reader = new StreamReader(stream); + + var contents = reader.ReadToEnd(); + } diff --git a/TabViewSample/TabViewSample/Resources/Splash/splash.svg b/TabViewSample/TabViewSample/Resources/Splash/splash.svg new file mode 100644 index 0000000..21dfb25 --- /dev/null +++ b/TabViewSample/TabViewSample/Resources/Splash/splash.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/TabViewSample/TabViewSample/Resources/Styles/Colors.xaml b/TabViewSample/TabViewSample/Resources/Styles/Colors.xaml new file mode 100644 index 0000000..30307a5 --- /dev/null +++ b/TabViewSample/TabViewSample/Resources/Styles/Colors.xaml @@ -0,0 +1,45 @@ + + + + + + + #512BD4 + #ac99ea + #242424 + #DFD8F7 + #9880e5 + #2B0B98 + + White + Black + #D600AA + #190649 + #1f1f1f + + #E1E1E1 + #C8C8C8 + #ACACAC + #919191 + #6E6E6E + #404040 + #212121 + #141414 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/TabViewSample/TabViewSample/Resources/Styles/Styles.xaml b/TabViewSample/TabViewSample/Resources/Styles/Styles.xaml new file mode 100644 index 0000000..fdb0cd7 --- /dev/null +++ b/TabViewSample/TabViewSample/Resources/Styles/Styles.xaml @@ -0,0 +1,444 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TabViewSample/TabViewSample/TabViewSample.csproj b/TabViewSample/TabViewSample/TabViewSample.csproj new file mode 100644 index 0000000..2d84b6a --- /dev/null +++ b/TabViewSample/TabViewSample/TabViewSample.csproj @@ -0,0 +1,69 @@ + + + + net9.0-android;net9.0-ios;net9.0-maccatalyst + $(TargetFrameworks);net9.0-windows10.0.19041.0 + + + + + + + Exe + TabViewSample + true + true + enable + enable + + + TabViewSample + + + com.companyname.tabviewsample + + + 1.0 + 1 + + + None + + 15.0 + 15.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TabViewSample/TabViewSample/ViewModel.cs b/TabViewSample/TabViewSample/ViewModel.cs new file mode 100644 index 0000000..051cd6a --- /dev/null +++ b/TabViewSample/TabViewSample/ViewModel.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace TabViewSample +{ + public class TabItemsSourceViewModel : INotifyPropertyChanged + { + public event PropertyChangedEventHandler? PropertyChanged; + + protected void OnPropertyChanged(string propertyName) + { + var handler = PropertyChanged; + if (handler != null) + handler(this, new PropertyChangedEventArgs(propertyName)); + } + + private ObservableCollection? tabItems; + public ObservableCollection? TabItems + { + get { return tabItems; } + set + { + tabItems = value; + OnPropertyChanged("TabItems"); + } + } + public TabItemsSourceViewModel() + { + TabItems = new ObservableCollection(); + TabItems.Add(new Model() { ImageName = "call.png", SelectedColor = Colors.Red }); + TabItems.Add(new Model() { ImageName = "contacts.png", SelectedColor = Colors.Gray }); + TabItems.Add(new Model() { ImageName = "favorite.png", SelectedColor = Colors.Gray }); + } + } +}