This commit is contained in:
SyncfusionBuild 2022-07-05 11:10:53 +05:30
Родитель dc8407882e
Коммит 3bd645996e
1504 изменённых файлов: 78730 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,16 @@
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="Local Syncfusion MAUI Source Package 20.2.0.36" value="../../../nuget" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<activePackageSource>
<add key="Local Syncfusion MAUI Source Package 20.2.0.36" value="../../../nuget" />
</activePackageSource>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
</configuration>

Просмотреть файл

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleBrowser.Maui.AvatarView", "SampleBrowser.Maui.AvatarView\SampleBrowser.Maui.AvatarView.csproj", "{FFF8474B-FAB6-4FF2-BE38-C0405027F4D5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Release-Xml|Any CPU = Release-Xml|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FFF8474B-FAB6-4FF2-BE38-C0405027F4D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFF8474B-FAB6-4FF2-BE38-C0405027F4D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFF8474B-FAB6-4FF2-BE38-C0405027F4D5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{FFF8474B-FAB6-4FF2-BE38-C0405027F4D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFF8474B-FAB6-4FF2-BE38-C0405027F4D5}.Release|Any CPU.Build.0 = Release|Any CPU
{FFF8474B-FAB6-4FF2-BE38-C0405027F4D5}.Release|Any CPU.Deploy.0 = Release|Any CPU
{FFF8474B-FAB6-4FF2-BE38-C0405027F4D5}.Release-Xml|Any CPU.ActiveCfg = Release-Xml|Any CPU
{FFF8474B-FAB6-4FF2-BE38-C0405027F4D5}.Release-Xml|Any CPU.Build.0 = Release-Xml|Any CPU
{FFF8474B-FAB6-4FF2-BE38-C0405027F4D5}.Release-Xml|Any CPU.Deploy.0 = Release-Xml|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:SampleBrowser.Maui.AvatarView"
xmlns:base="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
x:Class="SampleBrowser.Maui.AvatarView.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<base:SampleBrowserStyles/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

Просмотреть файл

@ -0,0 +1,24 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System.Reflection;
namespace SampleBrowser.Maui.AvatarView;
public partial class App : Application
{
public App()
{
InitializeComponent();
//MainPage = new AppShell();
var appInfo = typeof(App).GetTypeInfo().Assembly;
SampleBrowser.Maui.Base.BaseConfig.IsIndividualSB = true;
MainPage = SampleBrowser.Maui.Base.BaseConfig.MainPageInit(appInfo);
}
}

Просмотреть файл

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<SyncfusionControls>
<ControlCategory Name="Miscellaneous">
<Control Title="Avatar View" IsPreview="True" StatusTag="New" ControlName="SfAvatarView" Description="Display the user's initials or images on mobile and desktop layouts. Users can customize the background, text, etc." Image="avatarview.png">
<Sample Title="Getting Started" SampleName="AvatarViewGettingStarted" SearchTags="getting started, avatar, avatarview, image, initials" CodeViewerPath="AvatarView/AvatarViewGettingStarted/" />
<Sample Title="Group View" SampleName="GroupView" SearchTags="avatar, avatarview, groupview, group, view" CodeViewerPath="AvatarView/GroupView/" />
<Sample Title="Visual Style" SampleName="VisualStyleSample" SearchTags="avatar, avatar view, visual style" CodeViewerPath="AvatarView/VisualStyleSample/" />
</Control>
</ControlCategory>
</SyncfusionControls>

Просмотреть файл

@ -0,0 +1,14 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
namespace SampleBrowser.Maui.AvatarView
{
// All the code in this file is included in all platforms.
public class ControlConfig
{
}
}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleBrowser>
<Assemblies Prefix="SampleBrowser.Maui.AvatarView" QualifiedInfo="Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<Assembly Name="AvatarView" />
</Assemblies>
</SampleBrowser>

Просмотреть файл

@ -0,0 +1,30 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
namespace SampleBrowser.Maui.AvatarView;
using Syncfusion.Maui.Core.Hosting;
using SampleBrowser.Maui.Base.Hosting;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureSyncfusionCore()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
builder.ConfigureSampleBrowserBase();
return builder.Build();
}
}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

Просмотреть файл

@ -0,0 +1,17 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Android.App;
using Android.Content.PM;
using Android.OS;
namespace SampleBrowser.Maui.AvatarView;
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}

Просмотреть файл

@ -0,0 +1,22 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Android.App;
using Android.Runtime;
namespace SampleBrowser.Maui.AvatarView;
[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#2B0B98</color>
<color name="colorAccent">#2B0B98</color>
</resources>

Просмотреть файл

@ -0,0 +1,16 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Foundation;
namespace SampleBrowser.Maui.AvatarView;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Просмотреть файл

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,22 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using ObjCRuntime;
using UIKit;
namespace SampleBrowser.Maui.AvatarView;
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));
}
}

Просмотреть файл

@ -0,0 +1,23 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
namespace SampleBrowser.Maui.AvatarView;
class Program : MauiApplication
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
static void Main(string[] args)
{
var app = new Program();
app.Run(args);
}
}

Просмотреть файл

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.companyname.SampleBrowser.Maui.AvatarView" version="1.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="com.companyname.SampleBrowser.Maui.AvatarView" exec="SampleBrowser.Maui.AvatarView.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>SampleBrowser.Maui.AvatarView</label>
<icon>appicon.xhigh.png</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
</ui-application>
<shortcut-list />
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>
<dependencies />
<provides-appdefined-privileges />
</manifest>

Просмотреть файл

@ -0,0 +1,8 @@
<maui:MauiWinUIApplication
x:Class="SampleBrowser.Maui.AvatarView.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:SampleBrowser.Maui.AvatarView.WinUI">
</maui:MauiWinUIApplication>

Просмотреть файл

@ -0,0 +1,51 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using WinRT.Interop;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace SampleBrowser.Maui.AvatarView.WinUI;
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : MauiWinUIApplication
{
/// <summary>
/// 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().
/// </summary>
public App()
{
this.InitializeComponent();
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
base.OnLaunched(args);
foreach (var item in Application.Windows)
{
var platformWindow = (item?.Handler?.PlatformView as Microsoft.UI.Xaml.Window);
if (platformWindow != null)
{
platformWindow.ExtendsContentIntoTitleBar = false;
platformWindow.Title = ".NET MAUI Avatar View Demo";
}
}
}
}

Просмотреть файл

@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
<Properties>
<DisplayName>$placeholder$</DisplayName>
<PublisherDisplayName>User Name</PublisherDisplayName>
<Logo>$placeholder$.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="$placeholder$"
Description="$placeholder$"
Square150x150Logo="$placeholder$.png"
Square44x44Logo="$placeholder$.png"
BackgroundColor="transparent">
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
<uap:SplashScreen Image="$placeholder$.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

Просмотреть файл

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="SampleBrowser.Maui.AvatarView.WinUI.app"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<!-- The combination of below two tags have the following effect:
1) Per-Monitor for >= Windows 10 Anniversary Update
2) System < Windows 10 Anniversary Update
-->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>

Просмотреть файл

@ -0,0 +1,16 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Foundation;
namespace SampleBrowser.Maui.AvatarView;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,22 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using ObjCRuntime;
using UIKit;
namespace SampleBrowser.Maui.AvatarView;
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));
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"profiles": {
"Windows Machine": {
"commandName": "MsixPackage",
"nativeDebugging": false
}
}
}

Просмотреть файл

@ -0,0 +1,3 @@
<svg width="456" height="456" viewBox="0 0 456 456" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M456 0H0V456H456V0Z" fill="#4822E3"/>
</svg>

После

Ширина:  |  Высота:  |  Размер: 154 B

Просмотреть файл

@ -0,0 +1,14 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M48 0H0V48H48V0Z" fill="#4822E3"/>
<g opacity="0.9">
<rect x="15" y="17.3984" width="4.8406" height="4.80195" fill="white"/>
<rect x="15" y="22.8086" width="4.8406" height="4.80195" fill="white"/>
<rect x="15" y="28.1992" width="4.8406" height="4.80195" fill="white"/>
<rect x="20.4473" y="17.3984" width="4.8406" height="4.80195" fill="white"/>
<rect x="20.4473" y="22.8086" width="4.8406" height="4.80195" fill="white"/>
<rect x="20.4473" y="28.1992" width="4.8406" height="4.80195" fill="white"/>
<rect width="4.82131" height="4.82131" transform="matrix(0.709935 0.704267 -0.709935 0.704267 30.5234 15)" fill="white"/>
<rect x="25.8906" y="22.8086" width="4.8406" height="4.80195" fill="white"/>
<rect x="25.8906" y="28.1992" width="4.8406" height="4.80195" fill="white"/>
</g>
</svg>

После

Ширина:  |  Высота:  |  Размер: 893 B

Двоичный файл не отображается.

Двоичный файл не отображается.

Просмотреть файл

@ -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`.
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
These files will be deployed with you 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();
}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

После

Ширина:  |  Высота:  |  Размер: 17 KiB

Просмотреть файл

@ -0,0 +1,87 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>SampleBrowser.Maui.AvatarView</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisLevelSecurity>latest-recommended</AnalysisLevelSecurity>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);NU1803</NoWarn>
<!-- Display name -->
<ApplicationTitle>SampleBrowser.Maui.AvatarView</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.syncfusion.samplebrowser.maui.avatarview</ApplicationId>
<ApplicationIdGuid>98983B4D-24C6-44A2-9D3F-15EFE7ABD3D0</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.18362.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.18362.0</TargetPlatformMinVersion>
<Configurations>Debug;Release;Release-Xml</Configurations>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineConstants>TRACE;DEBUG;</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>5</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DefineConstants>TRACE;RELEASE;</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>5</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Xml|AnyCPU' ">
<DefineConstants>TRACE;RELEASE;</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>5</WarningLevel>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#4822E3" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#4822E3" BaseSize="*,*" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<None Remove="AvatarViewSamplesList.xml" />
<None Remove="ControlList.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ControlList.xml" />
<EmbeddedResource Include="AvatarViewSamplesList.xml" />
<EmbeddedResource Include="SyncfusionLicense.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SampleBrowser.Maui.Base" version="20.2.36" />
<PackageReference Include="Syncfusion.Maui.Core" version="20.2.36" />
<PackageReference Include="Syncfusion.Maui.TabView" version="20.2.36" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>SampleBrowser.Maui.AvatarView</id>
<version>20.1.0.1</version>
<authors>Syncfusion Inc.</authors>
<owners>Syncfusion Inc.</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<licenseUrl>http://www.syncfusion.com/nuget/license</licenseUrl>
<projectUrl>http://www.syncfusion.com/</projectUrl>
<iconUrl>http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png</iconUrl>
<description>AvatarView component for Syncfusion .NET MAUI</description>
<copyright>Copyright 2001 - 2019 Syncfusion Inc.</copyright>
<dependencies>
<group targetFramework="net6.0">
<dependency id="Microsoft.Maui.Dependencies" version="*" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0-android30.0">
<dependency id="Microsoft.Maui.Dependencies" version="*" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0-ios13.6">
<dependency id="Microsoft.Maui.Dependencies" version="*" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0-maccatalyst13.5">
<dependency id="Microsoft.Maui.Dependencies" version="*" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0-windows10.0.19041.0">
<dependency id="Microsoft.Maui.Dependencies" version="*" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>
</package>

Просмотреть файл

@ -0,0 +1,41 @@
<Project>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\AvatarView\AvatarViewGettingStarted\AvatarViewGettingStarted.xaml.cs">
<Link>Samples\AvatarView\AvatarViewGettingStarted\AvatarViewGettingStarted.xaml.cs</Link>
<DependentUpon>AvatarViewGettingStarted.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\AvatarView\GroupView\GroupView.xaml.cs">
<Link>Samples\AvatarView\GroupView\GroupView.xaml.cs</Link>
<DependentUpon>GroupView.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\AvatarView\VisualStyleSample\VisualStyleSample.xaml.cs">
<Link>Samples\AvatarView\VisualStyleSample\VisualStyleSample.xaml.cs</Link>
<DependentUpon> VisualStyleSample.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)\AvatarViewSamplesList.xml" >
<Link>AvatarViewSamplesList.xml</Link>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\AvatarView\AvatarViewGettingStarted\AvatarViewGettingStarted.xaml">
<Link>Samples\AvatarView\AvatarViewGettingStarted\AvatarViewGettingStarted.xaml</Link>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\AvatarView\GroupView\GroupView.xaml">
<Link>Samples\AvatarView\GroupView\GroupView.xaml</Link>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\AvatarView\VisualStyleSample\VisualStyleSample.xaml">
<Link>Samples\AvatarView\VisualStyleSample\VisualStyleSample.xaml</Link>
</MauiXaml>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<localCore:SampleView x:Class="SampleBrowser.Maui.AvatarView.SfAvatarView.AvatarViewGettingStarted"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
xmlns:imageExtension="clr-namespace:SampleBrowser.Maui.Base.Converters;assembly=SampleBrowser.Maui.Base"
BackgroundColor="White">
<localCore:SampleView.Resources>
<ResourceDictionary>
<Style x:Key="MainAvatarStyle" TargetType="syncfusion:SfAvatarView">
<Setter Property="AvatarShape" Value="Circle"/>
<Setter Property="AvatarSize" Value="ExtraLarge"/>
<Setter Property="InitialsType" Value="{Binding InitialsType}"/>
<Setter Property="ImageSource" Value="{imageExtension:SfImageResource people_circle1.png}"/>
<Setter Property="AvatarName" Value="{Binding UserName}"/>
<Setter Property="BorderColor" Value="#9E9E9E"/>
<Setter Property="Background" Value="{Binding GradientBrush}"/>
<Setter Property="BackgroundColor" Value="{Binding ProfileColor}"/>
<Setter Property="InitialsColor" Value="{Binding TextColor}"/>
<Setter Property="ContentType" Value="{Binding ContentType}"/>
</Style>
<Style TargetType="Label">
<Setter Property="VerticalTextAlignment" Value="Center"/>
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="TextColor" Value="Black"/>
</Style>
</ResourceDictionary>
</localCore:SampleView.Resources>
<localCore:SampleView.Content>
<ScrollView VerticalScrollBarVisibility="Never" HorizontalScrollBarVisibility="Never">
<Grid RowSpacing="20"
Margin="10,15"
VerticalOptions="Fill"
HorizontalOptions="Fill">
<Grid.RowDefinitions>
<RowDefinition Height="105"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Label Text="{Binding TitleText}"
VerticalOptions="Start"
HorizontalOptions="Start"/>
<syncfusion:SfBadgeView x:Name="StatusBadge" Margin="0,30,0,0"
VerticalOptions="Center"
HorizontalOptions="Center"
HeightRequest="75"
WidthRequest="75">
<syncfusion:SfBadgeView.Content>
<syncfusion:SfAvatarView HorizontalOptions="Start" VerticalOptions="Start" Style="{StaticResource MainAvatarStyle}"/>
</syncfusion:SfBadgeView.Content>
<syncfusion:SfBadgeView.BadgeSettings>
<syncfusion:BadgeSettings Offset="-12,-12"
Animation="Scale"
Position="BottomRight"
Type="Success"
Icon="Available"/>
</syncfusion:SfBadgeView.BadgeSettings>
</syncfusion:SfBadgeView>
<Grid Grid.Row="1" >
<VerticalStackLayout Spacing="40" HorizontalOptions="Center" WidthRequest="{OnPlatform iOS='350',MacCatalyst='400',Android='350',WinUI='400'}">
<StackLayout IsVisible="{Binding EditionIsVisible}">
<Grid ColumnSpacing="20" RowSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="2"/>
</Grid.RowDefinitions>
<Entry Text="{Binding FirstName}" Margin="2,0,0,0" VerticalOptions="End" VerticalTextAlignment="Center" Placeholder="Enter the First Name" TextColor="Black"/>
<Entry Text="{Binding LastName}" Margin="{OnPlatform Default='2,8,0,0', Android='2,0,0,0'}" Grid.Column="1" VerticalOptions="Center" VerticalTextAlignment="Center" Placeholder="Enter the Last Name" TextColor="Black" />
<BoxView HeightRequest="2" Color="#6200EE" Grid.Row="1" IsVisible="{OnPlatform Android='True', Default='False'}" />
<BoxView HeightRequest="2" Color="#6200EE" Grid.Row="1" Grid.Column="1" IsVisible="{OnPlatform Android='True', Default='False'}" />
</Grid>
<Grid Margin="0,50,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<Label HorizontalOptions="Start" Text="Show status indicator"/>
<CheckBox IsChecked="True" Grid.Column="1" Color="#6200EE" x:Name="StatusIndicatorCheck" HorizontalOptions="End"/>
</Grid>
<Grid Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<Label HorizontalOptions="Start" Text="Use custom picture"/>
<CheckBox HorizontalOptions="End" Grid.Column="1" Color="#6200EE" IsChecked="{Binding UseCustomAvatar}"/>
</Grid>
<Grid Margin="0,5,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="40"/>
</Grid.ColumnDefinitions>
<Label HorizontalOptions="Start" Text="Show double character" />
<CheckBox HorizontalOptions="End" Grid.Column="1" Color="#6200EE" IsChecked="{Binding UseDoubleCharacter}"/>
</Grid>
<Grid Margin="0,15,0,0" IsEnabled="{Binding UseInitialAvatar}" Opacity="{Binding ColorPickerOpacity}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="130"/>
</Grid.RowDefinitions>
<Label HorizontalOptions="Start" Text="Choose gradient background"/>
<FlexLayout Grid.Row="1" Wrap="Wrap" x:Name="gradientcollection" BindableLayout.ItemsSource="{Binding ColorItemCollection}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<ContentView Content="{Binding}" Margin="5"/>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</Grid>
</StackLayout>
</VerticalStackLayout>
</Grid>
</Grid>
</ScrollView>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,496 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using SampleBrowser.Maui.Base;
using Syncfusion.Maui.Core;
using System.Collections.ObjectModel;
namespace SampleBrowser.Maui.AvatarView.SfAvatarView;
public partial class AvatarViewGettingStarted : SampleView
{
private bool usedoublecharacter = false;
public bool UseDoubleCharacter
{
get
{
return usedoublecharacter;
}
set
{
usedoublecharacter = value;
if (value)
{
usedoublecharacter = true;
InitialsType = InitialsType.DoubleCharacter;
//SetAvatarName();
}
else
{
usedoublecharacter = false;
InitialsType = InitialsType.SingleCharacter;
//SetAvatarName();
}
this.OnPropertyChanged();
}
}
private InitialsType initials;
public InitialsType InitialsType
{
get
{
return initials;
}
set
{
initials = value;
this.OnPropertyChanged();
}
}
private GradientBrush? gradientBrush;
public GradientBrush? GradientBrush
{
get
{
return gradientBrush;
}
set
{
gradientBrush = value;
this.OnPropertyChanged();
}
}
private bool useCustomAvatar = false;
public bool UseCustomAvatar
{
get
{
return useCustomAvatar;
}
set
{
useCustomAvatar = value;
if (value)
{
UseInitialAvatar = false;
ContentType = ContentType.Custom;
}
else
{
ContentType = ContentType.Initials;
UseInitialAvatar = true;
}
this.OnPropertyChanged();
}
}
private ContentType contentType = ContentType.Initials;
public ContentType ContentType
{
get
{
return contentType;
}
set
{
contentType = value;
this.OnPropertyChanged();
}
}
private bool editionIsVisible = true;
public bool EditionIsVisible
{
get
{
return editionIsVisible;
}
set
{
editionIsVisible = value;
this.OnPropertyChanged();
}
}
private bool useInitialAvatar = true;
public bool UseInitialAvatar
{
get
{
return useInitialAvatar;
}
set
{
useInitialAvatar = value;
if (value)
ColorPickerOpacity = 1;
else
ColorPickerOpacity = 0.3;
this.OnPropertyChanged();
}
}
private bool useGradients;
public bool UseGradients
{
get
{
return useGradients;
}
set
{
useGradients = value;
if (useGradients)
{
SetGradients();
SetColorToAvatar();
}
else
{
SetGradients();
PopulateColorCollection();
SetColorToAvatar();
}
this.OnPropertyChanged();
}
}
private String firstName = "Ellana";
public String FirstName
{
get
{
return firstName;
}
set
{
firstName = value;
UserName = FirstName + " " + LastName;
this.OnPropertyChanged();
}
}
private String? lastName;
public String? LastName
{
get
{
return lastName;
}
set
{
lastName = value;
UserName = FirstName + " " + LastName;
this.OnPropertyChanged();
}
}
private String? userName;
public String? UserName
{
get
{
return userName;
}
set
{
userName = value;
TitleText = value;
this.OnPropertyChanged();
}
}
private String? titleText;
public String? TitleText
{
get
{
if (UserName == String.Empty || UserName == " ")
return String.Empty;
return "Hi " + titleText;
}
set
{
titleText = value;
this.OnPropertyChanged();
}
}
private Color? profileColor;
public Color? ProfileColor
{
get
{
return profileColor;
}
set
{
profileColor = value;
this.OnPropertyChanged();
}
}
private Color? textColor;
public Color? TextColor
{
get
{
return textColor;
}
set
{
textColor = value;
this.OnPropertyChanged();
}
}
private double colorPickerOpacity = 1;
public double ColorPickerOpacity
{
get
{
return colorPickerOpacity;
}
set
{
colorPickerOpacity = value;
this.OnPropertyChanged();
}
}
private ObservableCollection<ColorBackgroundAvatar> colorItemCollection = new ObservableCollection<ColorBackgroundAvatar>();
public ObservableCollection<ColorBackgroundAvatar> ColorItemCollection
{
get
{
return colorItemCollection;
}
set
{
colorItemCollection = value;
this.OnPropertyChanged();
}
}
public AvatarViewGettingStarted()
{
InitializeComponent();
this.StatusIndicatorCheck.CheckedChanged += StatusIndicatorSwitch_Toggled;
PopulateColorCollection();
tappedAvatar = ColorItemCollection[0];
UseGradients = true;
this.BindingContext = this;
}
private void StatusIndicatorSwitch_Toggled(object? sender, CheckedChangedEventArgs e)
{
if (this.StatusIndicatorCheck.IsChecked)
{
this.StatusBadge.BadgeSettings!.Icon = BadgeIcon.Available;
}
else
{
this.StatusBadge.BadgeSettings!.Type = BadgeType.None;
this.StatusBadge.BadgeSettings.Icon = BadgeIcon.None;
}
}
private void SetAvatarName()
{
if (tappedAvatar == null)
{ return; }
if (InitialsType == InitialsType.DoubleCharacter)
{
if (UserName != null)
{
tappedAvatar.AvatarName = UserName;
tappedAvatar.InitialsType = InitialsType;
}
}
else
{
if (UserName != null)
{
tappedAvatar.AvatarName = UserName;
tappedAvatar.InitialsType = InitialsType;
}
}
UserName = tappedAvatar.AvatarName;
InitialsType = tappedAvatar.InitialsType;
}
private void PopulateColorCollection()
{
ColorItemCollection.Clear();
ColorItemCollection.Add(GetColorPickerItem(Color.FromArgb("#976F0C"), Color.FromArgb("#58B7C6"), Color.FromArgb("#7FB3E8")));
ColorItemCollection.Add(GetColorPickerItem(Color.FromArgb("#740A1C"), Color.FromArgb("#95479B"), Color.FromArgb("#FF8F8F")));
ColorItemCollection.Add(GetColorPickerItem(Color.FromArgb("#5C2E91"), Color.FromArgb("#3C7F91"), Color.FromArgb("#71B280")));
ColorItemCollection.Add(GetColorPickerItem(Color.FromArgb("#004E8C"), Color.FromArgb("#525CE5"), Color.FromArgb("#9437C3")));
ColorItemCollection.Add(GetColorPickerItem(Color.FromArgb("#B73EAA"), Color.FromArgb("#80C6CF"), Color.FromArgb("#87DFAC")));
ColorItemCollection.Add(GetColorPickerItem(Color.FromArgb("#90DDFE"), Color.FromArgb("#E7A8FA"), Color.FromArgb("#F3DED6")));
ColorItemCollection.Add(GetColorPickerItem(Color.FromArgb("#9FCC69"), Color.FromArgb("#FFDBC7"), Color.FromArgb("#FC9F9F")));
ColorItemCollection.Add(GetColorPickerItem(Color.FromArgb("#FCCE65"), Color.FromArgb("#A6F0FF"), Color.FromArgb("#BCC1FF")));
ColorItemCollection.Add(GetColorPickerItem(Color.FromArgb("#FE9B90"), Color.FromArgb("#BCC2F4"), Color.FromArgb("#E8BEF7")));
ColorItemCollection.Add(GetColorPickerItem(Color.FromArgb("#9AA8F5"), Color.FromArgb("#96E6A1"), Color.FromArgb("#DCFA97")));
}
private ColorBackgroundAvatar GetColorPickerItem(Color backgroundColor, Color startcolor, Color stopcolor)
{
ColorBackgroundAvatar colorAvatar = new ColorBackgroundAvatar();
colorAvatar.BackgroundColor = backgroundColor;
colorAvatar.BorderColor = Color.FromArgb("#9E9E9E");
colorAvatar.InitialsColor = Colors.Transparent;
colorAvatar.AvatarShape = AvatarShape.Circle;
colorAvatar.AvatarSize = AvatarSize.Medium;
colorAvatar.VerticalOptions = LayoutOptions.Center;
colorAvatar.HorizontalOptions = LayoutOptions.Center;
colorAvatar.AvatarName = "";
TapGestureRecognizer tapGestureRecognizer = new TapGestureRecognizer();
tapGestureRecognizer.Tapped += ColorTapGestureRecognizer_Tapped;
colorAvatar.GestureRecognizers.Add(tapGestureRecognizer);
colorAvatar.StartColor = startcolor;
colorAvatar.StopColor = stopcolor;
return colorAvatar;
}
private void SetGradients()
{
foreach (var item in ColorItemCollection)
{
if (this.UseGradients)
if (ColorItemCollection.IndexOf(item) < 5)
item.Background = GetGradients(item.StartColor!, item.StopColor!);
else
item.Background = GetGradients(item.StartColor!, item.StopColor!);
}
}
private LinearGradientBrush GetGradients(Color startColor, Color endColor)
{
LinearGradientBrush linearGradientBrush = new LinearGradientBrush();
linearGradientBrush.GradientStops = new GradientStopCollection()
{
new GradientStop(){Color = startColor, Offset=0.0f},
new GradientStop(){Color = endColor, Offset=1.0f},
};
return linearGradientBrush;
}
ColorBackgroundAvatar tappedAvatar;
private void ColorTapGestureRecognizer_Tapped(object? sender, EventArgs e)
{
var colorBackgroundAvatar = sender as ColorBackgroundAvatar;
if (colorBackgroundAvatar != null)
{
tappedAvatar = colorBackgroundAvatar;
}
SetColorToAvatar();
}
private void SetColorToAvatar()
{
if (tappedAvatar == null)
return;
foreach (var item in ColorItemCollection)
{
item.InitialsColor = Colors.Transparent;
item.BorderColor = Color.FromArgb("#9E9E9E");
item.BorderThickness = 1;
}
tappedAvatar.BorderColor = Color.FromArgb("#6200EE");
tappedAvatar.BorderThickness = 2;
if (ColorItemCollection.IndexOf(tappedAvatar) < 5)
{
tappedAvatar.InitialsColor = Colors.White;
}
else
{
tappedAvatar.InitialsColor = Colors.Black;
}
ProfileColor = tappedAvatar.BackgroundColor;
TextColor = tappedAvatar.InitialsColor;
if (UseGradients)
{
GradientBrush = (GradientBrush)tappedAvatar.Background;
}
else
{
GradientBrush = null;
}
}
public class ColorBackgroundAvatar : Syncfusion.Maui.Core.SfAvatarView
{
private Color? startColor;
public Color? StartColor
{
get
{
return startColor;
}
set
{
startColor = value;
this.OnPropertyChanged();
}
}
private Color? stopcolor;
public Color? StopColor
{
get
{
return stopcolor;
}
set
{
stopcolor = value;
this.OnPropertyChanged();
}
}
}
}

Просмотреть файл

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8" ?>
<localCore:SampleView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:avatar="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
x:Class="SampleBrowser.Maui.AvatarView.SfAvatarView.GroupView"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
xmlns:imageExtension="clr-namespace:SampleBrowser.Maui.Base.Converters;assembly=SampleBrowser.Maui.Base"
BackgroundColor="White">
<localCore:SampleView.Content>
<Grid>
<Grid Margin="10">
<ListView ItemsSource="{Binding GroupCollection}" RowHeight="60"
SelectionMode="None">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<avatar:SfAvatarView GroupSource="{Binding PeopleCollection}"
Margin="5"
VerticalOptions="Center"
HorizontalOptions="Center"
ContentType="Group"
AvatarShape="{Binding AvatarShape}"
AvatarSize="Small"
BorderThickness="1"
ImageSourceMemberPath="Image"
BackgroundColorMemberPath="Backgroundcolor"
InitialsMemberPath="Name"/>
<Grid Grid.Column="1" VerticalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Label Text="{Binding GroupName}"
VerticalOptions="Center"
VerticalTextAlignment="Center"
FontSize="14"
TextColor="Black"/>
<Label Grid.Row="1"
Text="{Binding TotalParticipants}"
VerticalOptions="Center"
VerticalTextAlignment="Center"
FontSize="11"
TextColor="Gray"/>
</Grid>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Grid>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,191 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System.Collections.ObjectModel;
using SampleBrowser.Maui.Base;
using SampleBrowser.Maui.Base.Converters;
using System.Reflection;
namespace SampleBrowser.Maui.AvatarView.SfAvatarView;
public partial class GroupView : SampleView
{
private ObservableCollection<GroupModel> groupCollection = new ObservableCollection<GroupModel>();
public ObservableCollection<GroupModel> GroupCollection
{
get
{
return groupCollection;
}
set
{
groupCollection = value;
this.OnPropertyChanged();
}
}
public GroupView()
{
InitializeComponent();
this.GroupCollection.Add(new GroupModel(5) { GroupName = "Marketing Managers" });
this.GroupCollection.Add(new GroupModel(10) { GroupName = "Marketing Representative" });
this.GroupCollection.Add(new GroupModel(3) { GroupName = "Marketing Heads" });
this.GroupCollection.Add(new GroupModel(4) { GroupName = "Sales Managers" });
this.GroupCollection.Add(new GroupModel(9) { GroupName = "Sales Representative" });
this.GroupCollection.Add(new GroupModel(2) { GroupName = "Sales Heads" });
this.GroupCollection.Add(new GroupModel(5) { GroupName = "Process Managers" });
this.GroupCollection.Add(new GroupModel(10) { GroupName = "Process Representative" });
this.GroupCollection.Add(new GroupModel(2) { GroupName = "Process Heads" });
this.GroupCollection.Add(new GroupModel(3) { GroupName = "Coordinaters" });
this.GroupCollection.Add(new GroupModel(3) { GroupName = "Desinger" });
this.GroupCollection.Add(new GroupModel(2) { GroupName = "Field Managers" });
this.GroupCollection.Add(new GroupModel(2) { GroupName = "Server Team" });
this.BindingContext = this;
}
}
public class GroupModel
{
public String? GroupName { get; set; }
public ObservableCollection<People>? PeopleCollection { get; set; }
private ObservableCollection<People>? TotalPeople { get; set; }
public String? TotalParticipants { get; set; }
private Syncfusion.Maui.Core.AvatarShape avatarshape;
public Syncfusion.Maui.Core.AvatarShape AvatarShape
{
get
{
return avatarshape;
}
set
{
avatarshape = value;
}
}
public GroupModel(int peopleCount)
{
if (DeviceInfo.Platform == DevicePlatform.Android || DeviceInfo.Platform == DevicePlatform.WinUI)
avatarshape = Syncfusion.Maui.Core.AvatarShape.Circle;
else
avatarshape = Syncfusion.Maui.Core.AvatarShape.Square;
this.TotalParticipants = peopleCount.ToString() + " Participants";
this.PopulateAllPeople();
this.PopulatePeopleBasedOnCount(peopleCount);
}
private void PopulateAllPeople()
{
this.TotalPeople = new ObservableCollection<People>();
this.TotalPeople.Add(new People() { Name = "Kyle", Backgroundcolor = Color.FromArgb("#90DDFE") });
this.TotalPeople.Add(new People() { Name = "Gina", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Michael", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Oscar", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "William", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Bill", Backgroundcolor = Color.FromArgb("#D7E99C") });
this.TotalPeople.Add(new People() { Name = "Daniel", Backgroundcolor = Color.FromArgb("#D7E99C") });
this.TotalPeople.Add(new People() { Name = "Frank", Backgroundcolor = Color.FromArgb("#FE9B90") });
this.TotalPeople.Add(new People() { Name = "Howard", Backgroundcolor = Color.FromArgb("#D7E99C") });
this.TotalPeople.Add(new People() { Name = "Jack", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Holly", Backgroundcolor = Color.FromArgb("#FE9B90") });
this.TotalPeople.Add(new People() { Name = "Steve", Backgroundcolor = Color.FromArgb("#F5EF9A") });
this.TotalPeople.Add(new People() { Name = "Vince", Backgroundcolor = Color.FromArgb("#D7E99C") });
this.TotalPeople.Add(new People() { Name = "Zeke", Backgroundcolor = Color.FromArgb("#D7E99C") });
this.TotalPeople.Add(new People() { Name = "Aiden", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Jackson", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Mason", Backgroundcolor = Colors.BlanchedAlmond });
this.TotalPeople.Add(new People() { Name = "Liam", Backgroundcolor = Color.FromArgb("#F5EF9A") });
this.TotalPeople.Add(new People() { Name = "Jacob", Backgroundcolor = Color.FromArgb("#F5EF9A") });
this.TotalPeople.Add(new People() { Name = "Jayden", Backgroundcolor = Colors.Red });
this.TotalPeople.Add(new People() { Name = "Ethan", Backgroundcolor = Color.FromArgb("#F5EF9A") });
this.TotalPeople.Add(new People() { Name = "Alexander", Backgroundcolor = Colors.Red });
this.TotalPeople.Add(new People() { Name = "Sebastian", Backgroundcolor = Color.FromArgb("#F5EF9A") });
this.TotalPeople.Add(new People() { Name = "Clara", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Victoriya", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Ellie", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Gabriella", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Arianna", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Sarah", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Kaylee", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Adriana", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Finley", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Daleyza", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Leila", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Mckenna", Backgroundcolor = Colors.Blue });
this.TotalPeople.Add(new People() { Name = "Jacqueline", Backgroundcolor = Color.FromArgb("#9AA8F5") });
this.TotalPeople.Add(new People() { Name = "Brynn", Backgroundcolor = Color.FromArgb("#FCCE65") });
this.TotalPeople.Add(new People() { Name = "Sawyer", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Rosalie", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Maci", Backgroundcolor = Color.FromArgb("#FE9B90") });
this.TotalPeople.Add(new People() { Name = "Miranda", Backgroundcolor = Color.FromArgb("#90DDFE") });
this.TotalPeople.Add(new People() { Name = "Talia", Backgroundcolor = Color.FromArgb("#FE9B90") });
this.TotalPeople.Add(new People() { Name = "Shelby", Backgroundcolor = Color.FromArgb("#9FEFC5") });
this.TotalPeople.Add(new People() { Name = "Haven", Backgroundcolor = Color.FromArgb("#FE9B90") });
this.TotalPeople.Add(new People() { Name = "Brynn", Backgroundcolor = Color.FromArgb("#E79AF5") });
this.TotalPeople.Add(new People() { Name = "Yaretzi", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Zariah", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Karla", Backgroundcolor = Color.FromArgb("#D7E99C") });
this.TotalPeople.Add(new People() { Name = "Cassandra", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Pearl", Backgroundcolor = Color.FromArgb("#FBBC93") });
this.TotalPeople.Add(new People() { Name = "Irene", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Zelda", Backgroundcolor = Color.FromArgb("#F5EF9A") });
this.TotalPeople.Add(new People() { Name = "Wren", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Yamileth", Backgroundcolor = Color.FromArgb("#9AA8F5") });
this.TotalPeople.Add(new People() { Name = "Belen", Backgroundcolor = Color.FromArgb("#9AA8F5") });
this.TotalPeople.Add(new People() { Name = "Briley", Backgroundcolor = Color.FromArgb("#FE9B90") });
this.TotalPeople.Add(new People() { Name = "Jada", Backgroundcolor = Color.FromArgb("#9FCC69") });
this.TotalPeople.Add(new People() { Name = "Jaden", Backgroundcolor = Color.FromArgb("#FE9B90") });
this.TotalPeople.Add(new People() { Name = "George", Backgroundcolor = Color.FromArgb("#FCCE65") });
this.TotalPeople.Add(new People() { Name = "Ellanaa", Backgroundcolor = Color.FromArgb("#9AA8F5") });
this.TotalPeople.Add(new People() { Name = "James", Backgroundcolor = Color.FromArgb("#9FCC69") });
}
//Random random = new Random();
static int count = 0;
private void PopulatePeopleBasedOnCount(int peopleCount)
{
this.PeopleCollection = new ObservableCollection<People>();
for (int i = 0; i < peopleCount; i++)
{
while (true)
{
if(TotalPeople!=null)
{
if (this.TotalPeople.Count <= count)
count = 0;
var person = (this.TotalPeople?[count++]);
if (person != null && !this.PeopleCollection.Contains(person))
{
this.PeopleCollection.Add(person);
break;
}
}
}
}
}
}
public class People
{
public string? Name { get; set; }
public ImageSource? Image { get; set; }
public Color? Backgroundcolor { get; set; }
}

Просмотреть файл

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="utf-8" ?>
<localCore:SampleView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:avatar="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
x:Class="SampleBrowser.Maui.AvatarView.SfAvatarView.VisualStyleSample"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
xmlns:imageExtension="clr-namespace:SampleBrowser.Maui.Base.Converters;assembly=SampleBrowser.Maui.Base"
BackgroundColor="White">
<localCore:SampleView.Resources>
<ResourceDictionary>
<Style x:Key="AvatarViewStyle" TargetType="avatar:SfAvatarView">
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="HorizontalOptions" Value="Start"/>
<Setter Property="ImageSource" Value="{imageExtension:SfImageResource image5.png}"/>
<Setter Property="AvatarName" Value="SF"/>
<Setter Property="BackgroundColor" Value="#FF5490CC"/>
<Setter Property="InitialsColor" Value="White"/>
<Setter Property="ImageSourceMemberPath" Value="Image"/>
<Setter Property="InitialsMemberPath" Value="Name"/>
<Setter Property="ContentType" Value="{Binding AvatarType}"/>
<Setter Property="GroupSource" Value="{Binding TotalPeople}"/>
</Style>
<Style x:Key="MenuAvatarViewStyle" TargetType="avatar:SfAvatarView">
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="HorizontalOptions" Value="Start"/>
<Setter Property="Margin" Value="10"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="AvatarShape" Value="Square"/>
<Setter Property="AvatarSize" Value="Large"/>
</Style>
</ResourceDictionary>
</localCore:SampleView.Resources>
<localCore:SampleView.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="5*"/>
</Grid.RowDefinitions>
<ScrollView Grid.Row="1" Margin="10">
<StackLayout x:Name="mainstack" Orientation="Horizontal">
<StackLayout Orientation="Vertical">
<StackLayout Orientation="Horizontal" Spacing="10">
<avatar:SfAvatarView x:Name="customavatar"
AvatarShape="Custom"
Style="{StaticResource AvatarViewStyle}"
HorizontalOptions="Center"
WidthRequest="100"
HeightRequest="75"
BorderColor="LightBlue"
BorderThickness="5"
CornerRadius="0,20,0,20"/>
<avatar:SfAvatarView
x:Name="customavatar1"
AvatarShape="Custom"
Style="{StaticResource AvatarViewStyle}"
HorizontalOptions="Center"
WidthRequest="75"
HeightRequest="75"
BorderColor="LightBlue"
BorderThickness="5"
CornerRadius="0,0,37,37"/>
</StackLayout>
<Grid HeightRequest="10"/>
<Label Text="Default Visual Types" TextColor="Black"
FontSize="14"/>
<StackLayout Padding="0,10,0,0" Orientation="Horizontal">
<StackLayout Orientation="Vertical">
<avatar:SfAvatarView x:Name="ExtraLargeCircleAvatar"
AvatarShape="Circle"
AvatarSize="ExtraLarge"
Style="{StaticResource AvatarViewStyle}"/>
<Label Text="Extra Large Circle" TextColor="Black"
FontSize="12"/>
<Grid HeightRequest="10"/>
<avatar:SfAvatarView x:Name="LargeCircleAvatar"
AvatarShape="Circle"
AvatarSize="Large"
Style="{StaticResource AvatarViewStyle}"/>
<Label Text="Large Circle" TextColor="Black"
FontSize="12"/>
<Grid HeightRequest="10"/>
<avatar:SfAvatarView x:Name="MediumCircleAvatar"
AvatarShape="Circle"
AvatarSize="Medium"
Style="{StaticResource AvatarViewStyle}"/>
<Label Text="Medium Circle" TextColor="Black"
FontSize="12"/>
<Grid HeightRequest="10"/>
<avatar:SfAvatarView x:Name="SmallCircleAvatar"
AvatarShape="Circle"
AvatarSize="Small"
Style="{StaticResource AvatarViewStyle}"/>
<Label Text="Small Circle" TextColor="Black"
FontSize="12"/>
<Grid HeightRequest="10"/>
<avatar:SfAvatarView x:Name="ExtraSmallCircleAvatar"
AvatarShape="Circle"
AvatarSize="ExtraSmall"
Style="{StaticResource AvatarViewStyle}"/>
<Label Text="Extra Small Circle" TextColor="Black"
FontSize="12"/>
</StackLayout>
<StackLayout Orientation="Vertical" Margin="20,0,0,0">
<avatar:SfAvatarView x:Name="ExtraLargeSquareAvatar"
AvatarShape="Square"
AvatarSize="ExtraLarge"
Style="{StaticResource AvatarViewStyle}"/>
<Label Text="Extra Large Square" TextColor="Black"
FontSize="12"/>
<Grid HeightRequest="10"/>
<avatar:SfAvatarView x:Name="LargeSquareAvatar"
AvatarShape="Square"
AvatarSize="Large"
Style="{StaticResource AvatarViewStyle}"/>
<Label Text="Large Square" TextColor="Black"
FontSize="12"/>
<Grid HeightRequest="10"/>
<avatar:SfAvatarView x:Name="MediumSqaureAvatar"
AvatarShape="Square"
AvatarSize="Medium"
Style="{StaticResource AvatarViewStyle}"/>
<Label Text="Medium Square" TextColor="Black"
FontSize="12"/>
<Grid HeightRequest="10"/>
<avatar:SfAvatarView x:Name="SmallSqaureAvatar"
AvatarShape="Square"
AvatarSize="Small"
Style="{StaticResource AvatarViewStyle}"/>
<Label Text="Small Square" TextColor="Black"
FontSize="12"/>
<Grid HeightRequest="10"/>
<avatar:SfAvatarView x:Name="ExtraSmallSqaureAvatar"
AvatarShape="Square"
AvatarSize="ExtraSmall"
Style="{StaticResource AvatarViewStyle}"/>
<Label Text="Extra Small Square" TextColor="Black"
FontSize="12"/>
</StackLayout>
</StackLayout>
</StackLayout>
</StackLayout>
</ScrollView>
</Grid>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,63 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using SampleBrowser.Maui.Base;
using Syncfusion.Maui.Core;
using System.Collections.ObjectModel;
using Avatar = Syncfusion.Maui.Core;
namespace SampleBrowser.Maui.AvatarView.SfAvatarView;
public partial class VisualStyleSample : SampleView
{
private ContentType avatarType = ContentType.Initials;
public ContentType AvatarType
{
get
{
return avatarType;
}
set
{
avatarType = value;
this.OnPropertyChanged();
}
}
public ObservableCollection<People> TotalPeople { get; set; }
#region Constructor
public VisualStyleSample()
{
InitializeComponent();
this.TotalPeople = new ObservableCollection<People>();
this.TotalPeople.Add(new People() { Name = "Michael", Image = "SampleBrowser.Maui.Base.Resources.Images.people.png" });
this.TotalPeople.Add(new People() { Name = "Kyle", Image = "SampleBrowser.Maui.Base.Resources.Images.people.png" });
this.TotalPeople.Add(new People() { Name = "Nora" });
this.BindingContext = this;
}
#endregion
public class People
{
public String? Name { get; set; }
public String? Image { get; set; }
public Color? Backgroundcolor { get; set; }
}
}

Просмотреть файл

Просмотреть файл

@ -0,0 +1,16 @@
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="Local Syncfusion MAUI Source Package 20.2.0.36" value="../../../nuget" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<activePackageSource>
<add key="Local Syncfusion MAUI Source Package 20.2.0.36" value="../../../nuget" />
</activePackageSource>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
</configuration>

Просмотреть файл

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleBrowser.Maui.BadgeView", "SampleBrowser.Maui.BadgeView\SampleBrowser.Maui.BadgeView.csproj", "{450EEE40-B66A-413A-91C6-3CEF43187EF2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Release-Xml|Any CPU = Release-Xml|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{450EEE40-B66A-413A-91C6-3CEF43187EF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{450EEE40-B66A-413A-91C6-3CEF43187EF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{450EEE40-B66A-413A-91C6-3CEF43187EF2}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{450EEE40-B66A-413A-91C6-3CEF43187EF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{450EEE40-B66A-413A-91C6-3CEF43187EF2}.Release|Any CPU.Build.0 = Release|Any CPU
{450EEE40-B66A-413A-91C6-3CEF43187EF2}.Release|Any CPU.Deploy.0 = Release|Any CPU
{450EEE40-B66A-413A-91C6-3CEF43187EF2}.Release-Xml|Any CPU.ActiveCfg = Release-Xml|Any CPU
{450EEE40-B66A-413A-91C6-3CEF43187EF2}.Release-Xml|Any CPU.Build.0 = Release-Xml|Any CPU
{450EEE40-B66A-413A-91C6-3CEF43187EF2}.Release-Xml|Any CPU.Deploy.0 = Release-Xml|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:SampleBrowser.Maui.BadgeView"
xmlns:base="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
x:Class="SampleBrowser.Maui.BadgeView.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<base:SampleBrowserStyles/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

Просмотреть файл

@ -0,0 +1,24 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System.Reflection;
namespace SampleBrowser.Maui.BadgeView;
public partial class App : Application
{
public App()
{
InitializeComponent();
//MainPage = new AppShell();
var appInfo = typeof(App).GetTypeInfo().Assembly;
SampleBrowser.Maui.Base.BaseConfig.IsIndividualSB = true;
MainPage = SampleBrowser.Maui.Base.BaseConfig.MainPageInit(appInfo);
}
}

Просмотреть файл

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<SyncfusionControls>
<ControlCategory Name="Notification">
<Control IsPreview="True" Title="BadgeView" ControlName="SfBadgeView" Description="Badge shows a circle or rectangle which contain a number or message." Image="badgeview.png">
<Category Title="Features">
<Sample Title="Offset" SampleName="Offset" Description="Showcases the badge with different offset values." SearchTags="badgeView, badge, offset" CodeViewerPath="BadgeView/Customization/" />
<Sample Title="Type" SampleName="Type" Description="Showcases the different badge types available in the Badge View" SearchTags="badgeView, badge, type, badge type" CodeViewerPath="BadgeView/Customization/" />
<Sample Title="Position" SampleName="Position" Description="Showcases different badge positions in Badge View." SearchTags="badgeView, badge, badge position, position" CodeViewerPath="BadgeView/Customization/" />
<Sample Title="Border" SampleName="Border" Description="Showcases the border customization in Badge View." SearchTags="badgeView, badge, border, customization" CodeViewerPath="BadgeView/Customization/" />
<Sample Title="Font" SampleName="Font" Description="Showcases the font customization in Badge View." SearchTags="badgeView, badge, customization, font" CodeViewerPath="BadgeView/Customization/" />
<Sample Title="Alignment" SampleName="Alignment" Description="This sample shows the different alignments available to align the badge." SearchTags="badgeView, badge, alignment, customization" CodeViewerPath="BadgeView/Customization/" />
<Sample Title="Icon" SampleName="Icon" Description="This sample shows the pre-defined icons available in Badge View." SearchTags="badgeView, badge, customization, icon" CodeViewerPath="BadgeView/Customization/" />
</Category>
<Sample Title="Notification" SampleName="Notification" SearchTags="listview, badge, badgeView, badge view, notification" CodeViewerPath="BadgeView/Notification/" />
</Control>
</ControlCategory>
</SyncfusionControls>

Просмотреть файл

@ -0,0 +1,14 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
namespace SampleBrowser.Maui.BadgeView
{
// All the code in this file is included in all platforms.
public class ControlConfig
{
}
}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleBrowser>
<Assemblies Prefix="SampleBrowser.Maui.BadgeView" QualifiedInfo="Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
<Assembly Name="BadgeView" />
</Assemblies>
</SampleBrowser>

Просмотреть файл

@ -0,0 +1,30 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
namespace SampleBrowser.Maui.BadgeView;
using Syncfusion.Maui.Core.Hosting;
using SampleBrowser.Maui.Base.Hosting;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureSyncfusionCore()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
builder.ConfigureSampleBrowserBase();
return builder.Build();
}
}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

Просмотреть файл

@ -0,0 +1,17 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Android.App;
using Android.Content.PM;
using Android.OS;
namespace SampleBrowser.Maui.BadgeView;
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity
{
}

Просмотреть файл

@ -0,0 +1,22 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Android.App;
using Android.Runtime;
namespace SampleBrowser.Maui.BadgeView;
[Application]
public class MainApplication : MauiApplication
{
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership)
{
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#2B0B98</color>
<color name="colorAccent">#2B0B98</color>
</resources>

Просмотреть файл

@ -0,0 +1,16 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Foundation;
namespace SampleBrowser.Maui.BadgeView;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Просмотреть файл

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,22 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using ObjCRuntime;
using UIKit;
namespace SampleBrowser.Maui.BadgeView;
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));
}
}

Просмотреть файл

@ -0,0 +1,23 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
namespace SampleBrowser.Maui.BadgeView;
class Program : MauiApplication
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
static void Main(string[] args)
{
var app = new Program();
app.Run(args);
}
}

Просмотреть файл

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.companyname.SampleBrowser.Maui.BadgeView" version="1.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="com.companyname.SampleBrowser.Maui.BadgeView" exec="SampleBrowser.Maui.BadgeView.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>SampleBrowser.Maui.BadgeView</label>
<icon>appicon.xhigh.png</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
</ui-application>
<shortcut-list />
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>
<dependencies />
<provides-appdefined-privileges />
</manifest>

Просмотреть файл

@ -0,0 +1,8 @@
<maui:MauiWinUIApplication
x:Class="SampleBrowser.Maui.BadgeView.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:SampleBrowser.Maui.BadgeView.WinUI">
</maui:MauiWinUIApplication>

Просмотреть файл

@ -0,0 +1,51 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
using Microsoft.UI;
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using WinRT.Interop;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace SampleBrowser.Maui.BadgeView.WinUI;
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : MauiWinUIApplication
{
/// <summary>
/// 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().
/// </summary>
public App()
{
this.InitializeComponent();
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
base.OnLaunched(args);
foreach (var item in Application.Windows)
{
var platformWindow = (item?.Handler?.PlatformView as Microsoft.UI.Xaml.Window);
if (platformWindow != null)
{
platformWindow.ExtendsContentIntoTitleBar = false;
platformWindow.Title = ".NET MAUI Badge View Demo";
}
}
}
}

Просмотреть файл

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">
<Identity Publisher="CN=User Name" />
<Properties>
<PublisherDisplayName>User Name</PublisherDisplayName>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<PackageDependency Name="Microsoft.VCLibs.140.00" MinVersion="14.0.24217.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
<PackageDependency Name="Microsoft.VCLibs.140.00.UWPDesktop" MinVersion="14.0.24217.0" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements />
</Application>
</Applications>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>

Просмотреть файл

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="SampleBrowser.Maui.BadgeView.WinUI.app"/>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<!-- The combination of below two tags have the following effect:
1) Per-Monitor for >= Windows 10 Anniversary Update
2) System < Windows 10 Anniversary Update
-->
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>
</assembly>

Просмотреть файл

@ -0,0 +1,16 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using Foundation;
namespace SampleBrowser.Maui.BadgeView;
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,22 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using ObjCRuntime;
using UIKit;
namespace SampleBrowser.Maui.BadgeView;
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));
}
}

Просмотреть файл

@ -0,0 +1,8 @@
{
"profiles": {
"Windows Machine": {
"commandName": "MsixPackage",
"nativeDebugging": false
}
}
}

Просмотреть файл

@ -0,0 +1,3 @@
<svg width="456" height="456" viewBox="0 0 456 456" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M456 0H0V456H456V0Z" fill="#4822E3"/>
</svg>

После

Ширина:  |  Высота:  |  Размер: 154 B

Просмотреть файл

@ -0,0 +1,14 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M48 0H0V48H48V0Z" fill="#4822E3"/>
<g opacity="0.9">
<rect x="15" y="17.3984" width="4.8406" height="4.80195" fill="white"/>
<rect x="15" y="22.8086" width="4.8406" height="4.80195" fill="white"/>
<rect x="15" y="28.1992" width="4.8406" height="4.80195" fill="white"/>
<rect x="20.4473" y="17.3984" width="4.8406" height="4.80195" fill="white"/>
<rect x="20.4473" y="22.8086" width="4.8406" height="4.80195" fill="white"/>
<rect x="20.4473" y="28.1992" width="4.8406" height="4.80195" fill="white"/>
<rect width="4.82131" height="4.82131" transform="matrix(0.709935 0.704267 -0.709935 0.704267 30.5234 15)" fill="white"/>
<rect x="25.8906" y="22.8086" width="4.8406" height="4.80195" fill="white"/>
<rect x="25.8906" y="28.1992" width="4.8406" height="4.80195" fill="white"/>
</g>
</svg>

После

Ширина:  |  Высота:  |  Размер: 893 B

Двоичный файл не отображается.

Двоичный файл не отображается.

Двоичный файл не отображается.

Просмотреть файл

@ -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`.
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
These files will be deployed with you 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();
}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

После

Ширина:  |  Высота:  |  Размер: 17 KiB

Просмотреть файл

@ -0,0 +1,87 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>SampleBrowser.Maui.BadgeView</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisLevelSecurity>latest-recommended</AnalysisLevelSecurity>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<Nullable>enable</Nullable>
<NoWarn>$(NoWarn);NU1803</NoWarn>
<!-- Display name -->
<ApplicationTitle>SampleBrowser.Maui.BadgeView</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.syncfusion.samplebrowser.maui.badgeview</ApplicationId>
<ApplicationIdGuid>32834211-1C75-4567-96F2-754A4412C763</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.18362.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.18362.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<Configurations>Debug;Release;Release-Xml</Configurations>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DefineConstants>TRACE;DEBUG;</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>5</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DefineConstants>TRACE;RELEASE;</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>5</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Xml|AnyCPU' ">
<DefineConstants>TRACE;RELEASE;</DefineConstants>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>5</WarningLevel>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#4822E3" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#4822E3" BaseSize="*,*" />
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="BadgeViewSamplesList.xml" />
<EmbeddedResource Include="ControlList.xml" />
<EmbeddedResource Include="SyncfusionLicense.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SampleBrowser.Maui.Base" version="20.2.36" />
<PackageReference Include="Syncfusion.Maui.Core" version="20.2.36" />
<PackageReference Include="Syncfusion.Maui.TabView" version="20.2.36" />
</ItemGroup>
<ItemGroup>
<Folder Include="Samples\BadgeView\" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>SampleBrowser.Maui.BadgeView</id>
<version>20.1.0.1</version>
<authors>Syncfusion Inc.</authors>
<owners>Syncfusion Inc.</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<licenseUrl>http://www.syncfusion.com/nuget/license</licenseUrl>
<projectUrl>http://www.syncfusion.com/</projectUrl>
<iconUrl>http://www.syncfusion.com/content/images/nuget/sync_logo_icon.png</iconUrl>
<description>BadgeView component for Syncfusion .NET MAUI</description>
<copyright>Copyright 2001 - 2019 Syncfusion Inc.</copyright>
<dependencies>
<group targetFramework="net6.0">
<dependency id="Microsoft.Maui.Dependencies" version="*" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0-android30.0">
<dependency id="Microsoft.Maui.Dependencies" version="*" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0-ios13.6">
<dependency id="Microsoft.Maui.Dependencies" version="*" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0-maccatalyst13.5">
<dependency id="Microsoft.Maui.Dependencies" version="*" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0-windows10.0.19041.0">
<dependency id="Microsoft.Maui.Dependencies" version="*" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>
</package>

Просмотреть файл

@ -0,0 +1,100 @@
<Project>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Alignment.xaml.cs">
<Link>Samples\BadgeView\Customization\Alignment.xaml.cs</Link>
<DependentUpon>Alignment.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Border.xaml.cs">
<Link>Samples\BadgeView\Customization\Border.xaml.cs</Link>
<DependentUpon>Border.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Font.xaml.cs">
<Link>Samples\BadgeView\Customization\Font.xaml.cs</Link>
<DependentUpon> Font.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Icon.xaml.cs">
<Link>Samples\BadgeView\Customization\Icon.xaml.cs</Link>
<DependentUpon> Icon.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Offset.xaml.cs">
<Link>Samples\BadgeView\Customization\Offset.xaml.cs</Link>
<DependentUpon> Offset.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Position.xaml.cs">
<Link>Samples\BadgeView\Customization\Position.xaml.cs</Link>
<DependentUpon> Position.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Type.xaml.cs">
<Link>Samples\BadgeView\Customization\Type.xaml.cs</Link>
<DependentUpon> Type.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Notification\Notification.xaml.cs">
<Link>Samples\BadgeView\Notification\Notification.xaml.cs</Link>
<DependentUpon> Notification.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Notification\NotificationModel.cs">
<Link>Samples\BadgeView\Notification\NotificationModel.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Notification\NotificationViewModel.cs">
<Link>Samples\BadgeView\Notification\NotificationViewModel.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)\BadgeViewSamplesList.xml" >
<Link>BadgeViewSamplesList.xml</Link>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Alignment.xaml">
<Link>Samples\BadgeView\Customization\Alignment.xaml</Link>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Border.xaml">
<Link>Samples\BadgeView\Customization\Border.xaml</Link>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Font.xaml">
<Link>Samples\BadgeView\Customization\Font.xaml</Link>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Icon.xaml">
<Link>Samples\BadgeView\Customization\Icon.xaml</Link>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Offset.xaml">
<Link>Samples\BadgeView\Customization\Offset.xaml</Link>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Position.xaml">
<Link>Samples\BadgeView\Customization\Position.xaml</Link>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Customization\Type.xaml">
<Link>Samples\BadgeView\Customization\Type.xaml</Link>
</MauiXaml>
</ItemGroup>
<ItemGroup>
<MauiXaml Include="$(MSBuildThisFileDirectory)\Samples\BadgeView\Notification\Notification.xaml">
<Link>Samples\BadgeView\Notification\Notification.xaml</Link>
</MauiXaml>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8" ?>
<localCore:SampleView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:badge="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
x:Class="SampleBrowser.Maui.BadgeView.SfBadgeView.Alignment">
<localCore:SampleView.Resources>
<Style x:Key="DemoLabelStyle" TargetType="Label">
<Setter Property="FontSize" Value="18"/>
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="TextColor" Value="Black"/>
</Style>
</localCore:SampleView.Resources>
<localCore:SampleView.Content>
<ScrollView HorizontalScrollBarVisibility="Never" VerticalScrollBarVisibility="Never">
<VerticalStackLayout Spacing="20"
VerticalOptions="Center"
HorizontalOptions="Center"
Padding="10">
<badge:SfBadgeView BadgeText="5"
HorizontalOptions="Center"
WidthRequest="150"
HeightRequest="90">
<Grid BackgroundColor="#EEEEEE">
<Label Text="Start"
Style="{StaticResource DemoLabelStyle}" />
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings BadgeAlignment="Start" CornerRadius="0" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView BadgeText="5"
HorizontalOptions="Center"
WidthRequest="150"
HeightRequest="80">
<Grid BackgroundColor="#EEEEEE" >
<Label Text="Center"
Style="{StaticResource DemoLabelStyle}" />
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings BadgeAlignment="Center" CornerRadius="0" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView BadgeText="5"
HorizontalOptions="Center"
WidthRequest="150"
HeightRequest="70">
<Grid BackgroundColor="#EEEEEE">
<Label Text="End"
Style="{StaticResource DemoLabelStyle}" />
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings BadgeAlignment="End" CornerRadius="0" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
</VerticalStackLayout>
</ScrollView>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,19 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using SampleBrowser.Maui.Base;
namespace SampleBrowser.Maui.BadgeView.SfBadgeView;
public partial class Alignment : SampleView
{
public Alignment()
{
InitializeComponent();
}
}

Просмотреть файл

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8" ?>
<localCore:SampleView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:badge="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
x:Class="SampleBrowser.Maui.BadgeView.SfBadgeView.Border">
<localCore:SampleView.Resources>
<Style x:Key="DemoLabelStyle" TargetType="Label">
<Setter Property="FontSize" Value="18"/>
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="TextColor" Value="Black"/>
</Style>
</localCore:SampleView.Resources>
<localCore:SampleView.Content>
<ScrollView HorizontalScrollBarVisibility="Never" VerticalScrollBarVisibility="Never">
<VerticalStackLayout WidthRequest="250"
VerticalOptions="Center"
HorizontalOptions="Center"
Spacing="20"
Padding="10">
<badge:SfBadgeView BadgeText="5"
HorizontalOptions="Center"
WidthRequest="200"
HeightRequest="100">
<Grid BackgroundColor="#EEEEEE"
Margin="10">
<Label Text="Corner Radius"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings CornerRadius="10"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView BadgeText="5"
HorizontalOptions="Center"
WidthRequest="200"
HeightRequest="100">
<Grid BackgroundColor="#EEEEEE"
Margin="10">
<Label Text="Border Width"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Stroke="DeepPink"
Type="None"
Background="White"
TextColor="DeepPink"
BorderWidth="3"
Offset="-1,1"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView BadgeText="5"
HorizontalOptions="Center"
WidthRequest="200"
HeightRequest="100">
<Grid BackgroundColor="#EEEEEE"
Margin="10">
<Label Text="Border Color"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Stroke="Red"
Type="None"
Background="White"
TextColor="Red"
BorderWidth="2"
Offset="-1,1"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
</VerticalStackLayout>
</ScrollView>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,21 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using SampleBrowser.Maui.Base;
namespace SampleBrowser.Maui.BadgeView.SfBadgeView
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Border : SampleView
{
public Border()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8" ?>
<localCore:SampleView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:badge="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
x:Class="SampleBrowser.Maui.BadgeView.SfBadgeView.Font">
<localCore:SampleView.Resources>
<Style x:Key="DemoLabelStyle" TargetType="Label">
<Setter Property="FontSize" Value="18"/>
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="TextColor" Value="Black"/>
</Style>
</localCore:SampleView.Resources>
<localCore:SampleView.Content>
<ScrollView HorizontalScrollBarVisibility="Never" VerticalScrollBarVisibility="Never">
<VerticalStackLayout WidthRequest="300"
VerticalOptions="Center"
HorizontalOptions="Center">
<Grid RowDefinitions="90,90" RowSpacing="20" ColumnSpacing="20"
ColumnDefinitions="*,*">
<badge:SfBadgeView Grid.Row="0"
Grid.Column="0"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE"
Margin="10">
<Label Text="Size"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings FontSize="20"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="0"
Grid.Column="1"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE"
Margin="10">
<Label Text="Font Attributes" LineBreakMode="WordWrap" HorizontalTextAlignment="Center"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings FontAttributes="Bold"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="1"
Grid.Column="0"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE"
Margin="10">
<Label Text="Padding"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings TextPadding="10"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="1"
Grid.Column="1"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE"
Margin="10">
<Label Text="Color"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings FontAttributes="Bold"
TextColor="Red"
Stroke="Red"
BorderWidth="2"
Type="None"
Background="White"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
</Grid>
</VerticalStackLayout>
</ScrollView>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,22 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using SampleBrowser.Maui.Base;
namespace SampleBrowser.Maui.BadgeView.SfBadgeView
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Font : SampleView
{
public Font()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -0,0 +1,215 @@
<?xml version="1.0" encoding="utf-8" ?>
<localCore:SampleView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:badge="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
xmlns:imageExtension="clr-namespace:SampleBrowser.Maui.Base.Converters;assembly=SampleBrowser.Maui.Base"
x:Class="SampleBrowser.Maui.BadgeView.SfBadgeView.Icon">
<localCore:SampleView.Resources>
<Style x:Key="DemoLabelStyle" TargetType="Label">
<Setter Property="FontSize" Value="18"/>
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="TextColor" Value="Black"/>
</Style>
</localCore:SampleView.Resources>
<localCore:SampleView.Content>
<ScrollView HorizontalScrollBarVisibility="Never" VerticalScrollBarVisibility="Never">
<VerticalStackLayout VerticalOptions="Center"
HorizontalOptions="Center"
MaximumWidthRequest="300">
<Grid Margin="0,16,0,0"
RowDefinitions="120,120,120"
ColumnSpacing="20"
ColumnDefinitions="Auto,Auto,Auto">
<VerticalStackLayout Spacing="2"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'>
<badge:SfBadgeView WidthRequest="60"
HeightRequest="60"
HorizontalOptions="Center"
BackgroundColor="White">
<Image Source="{imageExtension:SfImageResource people_circle1.png}"
HorizontalOptions="Center"
WidthRequest="60"
HeightRequest="60"
VerticalOptions="Start" />
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Icon="Add" Type="Success"
Offset="0,0"
Position="BottomRight" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<Label Text="Add"
TextColor="Black"
HorizontalOptions="Center" />
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="2"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'>
<badge:SfBadgeView WidthRequest="60"
HeightRequest="60"
HorizontalOptions="Center"
BackgroundColor="White">
<Image Source="{imageExtension:SfImageResource people_circle1.png}"
HorizontalOptions="Center"
WidthRequest="60"
HeightRequest="60"
VerticalOptions="Start" />
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Icon="Available" Type="Success"
Offset="0,0"
Position="BottomRight" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<Label Text="Available"
TextColor="Black"
HorizontalOptions="Center" />
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="2" Spacing="2"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'>
<badge:SfBadgeView WidthRequest="60"
HeightRequest="60"
HorizontalOptions="Center"
BackgroundColor="White">
<Image Source="{imageExtension:SfImageResource people_circle1.png}"
HorizontalOptions="Center"
WidthRequest="60"
HeightRequest="60"
VerticalOptions="Start" />
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Icon="Away" Type="Warning"
Offset="0,0"
Position="BottomRight" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<Label Text="Away"
TextColor="Black"
HorizontalOptions="Center" />
</VerticalStackLayout>
<VerticalStackLayout Grid.Row="1" Spacing="2"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'>
<badge:SfBadgeView WidthRequest="60"
HeightRequest="60"
HorizontalOptions="Center"
BackgroundColor="White">
<Image Source="{imageExtension:SfImageResource people_circle1.png}"
HorizontalOptions="Center"
WidthRequest="60"
HeightRequest="60"
VerticalOptions="Start" />
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Icon="Busy" Type="Error"
Offset="0,0"
Position="BottomRight" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<Label Text="Busy"
TextColor="Black"
HorizontalOptions="Center" />
</VerticalStackLayout>
<VerticalStackLayout Grid.Row="1" Grid.Column="1" Spacing="2"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'>
<badge:SfBadgeView WidthRequest="60"
HeightRequest="60"
HorizontalOptions="Center"
BackgroundColor="White">
<Image Source="{imageExtension:SfImageResource people_circle1.png}"
HorizontalOptions="Center"
WidthRequest="60"
HeightRequest="60"
VerticalOptions="Start" />
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Icon="Delete" Type="Error"
Offset="0,0"
Position="BottomRight" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<Label Text="Delete"
TextColor="Black"
HorizontalOptions="Center" />
</VerticalStackLayout>
<VerticalStackLayout Grid.Row="1" Grid.Column="2" Spacing="2"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'>
<badge:SfBadgeView WidthRequest="60"
HeightRequest="60"
HorizontalOptions="Center"
BackgroundColor="White">
<Image Source="{imageExtension:SfImageResource people_circle1.png}"
HorizontalOptions="Center"
WidthRequest="60"
HeightRequest="60"
VerticalOptions="Start" />
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Icon="Dot" Type="Error"
Offset="-4,-4"
Position="BottomRight" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<Label Text="Dot"
TextColor="Black"
HorizontalOptions="Center" />
</VerticalStackLayout>
<VerticalStackLayout Grid.Row="2" Spacing="2"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'>
<badge:SfBadgeView WidthRequest="60"
HeightRequest="60"
HorizontalOptions="Center"
BackgroundColor="White">
<Image Source="{imageExtension:SfImageResource people_circle1.png}"
HorizontalOptions="Center"
WidthRequest="60"
HeightRequest="60"
VerticalOptions="Start" />
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Icon="Prohibit1" Type="Warning"
Offset="0,0"
Position="BottomRight" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<Label Text="Prohibit1"
TextColor="Black"
HorizontalOptions="Center" />
</VerticalStackLayout>
<VerticalStackLayout Grid.Row="2" Grid.Column="1" Spacing="2"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'>
<badge:SfBadgeView WidthRequest="60"
HeightRequest="60"
HorizontalOptions="Center"
BackgroundColor="White">
<Image Source="{imageExtension:SfImageResource people_circle1.png}"
HorizontalOptions="Center"
WidthRequest="60"
HeightRequest="60"
VerticalOptions="Start" />
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Icon="Prohibit2" Type="Warning"
Offset="0,0"
Position="BottomRight" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<Label Text="Prohibit2"
TextColor="Black"
HorizontalOptions="Center" />
</VerticalStackLayout>
</Grid>
</VerticalStackLayout>
</ScrollView>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,20 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using SampleBrowser.Maui.Base;
namespace SampleBrowser.Maui.BadgeView.SfBadgeView;
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Icon : SampleView
{
public Icon()
{
InitializeComponent();
}
}

Просмотреть файл

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8" ?>
<localCore:SampleView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:badge="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
x:Class="SampleBrowser.Maui.BadgeView.SfBadgeView.Offset">
<localCore:SampleView.Resources>
<Style x:Key="DemoLabelStyle" TargetType="Label">
<Setter Property="FontSize" Value="18"/>
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="TextColor" Value="Black"/>
</Style>
</localCore:SampleView.Resources>
<localCore:SampleView.Content>
<ScrollView HorizontalScrollBarVisibility="Never" VerticalScrollBarVisibility="Never">
<VerticalStackLayout WidthRequest="250"
VerticalOptions="Center"
HorizontalOptions="Center"
Spacing="40"
Padding="0">
<badge:SfBadgeView BadgeText="5" x:Name="badgeView"
HorizontalOptions="Center"
WidthRequest="200"
HeightRequest="100">
<Grid BackgroundColor="#EEEEEE" Margin="5">
<Label Text="With Offset"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Offset="-20,30"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<VerticalStackLayout Spacing="0">
<Label HorizontalTextAlignment="Center" Text="Horizontal Offset" Margin="0,20,0,0" />
<Slider Minimum="-30" Maximum="0" Value="-20" ValueChanged="Slider_ValueChanged" />
</VerticalStackLayout>
<VerticalStackLayout Spacing="0">
<Label HorizontalTextAlignment="Center" Text="Vertical Offset" />
<Slider Minimum="0" Maximum="45" Value="30" ValueChanged="Slider_ValueChanged1" />
</VerticalStackLayout>
</VerticalStackLayout>
</ScrollView>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,40 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using SampleBrowser.Maui.Base;
namespace SampleBrowser.Maui.BadgeView.SfBadgeView
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Offset : SampleView
{
public Offset()
{
InitializeComponent();
}
private void Slider_ValueChanged(object sender, ValueChangedEventArgs e)
{
if (this.badgeView.BadgeSettings != null)
{
var oldValue = this.badgeView.BadgeSettings.Offset;
this.badgeView.BadgeSettings.Offset = new Point(e.NewValue, oldValue.Y);
}
}
private void Slider_ValueChanged1(object sender, ValueChangedEventArgs e)
{
if (this.badgeView.BadgeSettings != null)
{
var oldValue = this.badgeView.BadgeSettings.Offset;
this.badgeView.BadgeSettings.Offset = new Point(oldValue.X, e.NewValue);
}
}
}
}

Просмотреть файл

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="utf-8" ?>
<localCore:SampleView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:badge="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
x:Class="SampleBrowser.Maui.BadgeView.SfBadgeView.Position">
<localCore:SampleView.Resources>
<Style x:Key="DemoLabelStyle" TargetType="Label">
<Setter Property="FontSize" Value="16"/>
<Setter Property="VerticalOptions" Value="Center"/>
<Setter Property="HorizontalOptions" Value="Center"/>
<Setter Property="TextColor" Value="Black"/>
</Style>
</localCore:SampleView.Resources>
<localCore:SampleView.Content>
<ScrollView>
<VerticalStackLayout MaximumWidthRequest='{OnPlatform iOS="380", Android="380", MacCatalyst="450", WinUI="450"}'
VerticalOptions="Center" HorizontalOptions="Center" Padding="10">
<Grid RowDefinitions="80,80,80"
ColumnDefinitions='{OnPlatform WinUI="140,140,140", Default="*,*,*"}'>
<badge:SfBadgeView BadgeText="5">
<Grid BackgroundColor="#EEEEEE" Margin="10">
<Label Text="TopLeft"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Position="TopLeft"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Column="1"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE" Margin="10">
<Label Text="Top"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Position="Top"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Column="2"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE" Margin="10">
<Label Text="TopRight"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Position="TopRight"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="1"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE" Margin="10">
<Label Text="Left"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Position="Left"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="1"
Grid.Column="2"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE" Margin="10">
<Label Text="Right"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Position="Right"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="2"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE" Margin="10">
<Label Text="BottomLeft"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Position="BottomLeft"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="2"
Grid.Column="1"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE" Margin="10">
<Label Text="Bottom"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Position="Bottom"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="2"
Grid.Column="2"
BadgeText="5">
<Grid BackgroundColor="#EEEEEE" Margin="10">
<Label Text="BottomRight"
Style="{StaticResource DemoLabelStyle}"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Position="BottomRight"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
</Grid>
</VerticalStackLayout>
</ScrollView>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,21 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using SampleBrowser.Maui.Base;
namespace SampleBrowser.Maui.BadgeView.SfBadgeView
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Position : SampleView
{
public Position()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -0,0 +1,258 @@
<?xml version="1.0" encoding="utf-8" ?>
<localCore:SampleView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:badge="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
xmlns:imageExtension="clr-namespace:SampleBrowser.Maui.Base.Converters;assembly=SampleBrowser.Maui.Base"
x:Class="SampleBrowser.Maui.BadgeView.SfBadgeView.Type">
<localCore:SampleView.Content>
<ScrollView HorizontalScrollBarVisibility="Never" VerticalScrollBarVisibility="Never">
<VerticalStackLayout VerticalOptions="Center"
HorizontalOptions="Center"
MaximumWidthRequest="300">
<Grid RowDefinitions="120,120,120"
ColumnSpacing="20"
ColumnDefinitions="Auto,Auto,Auto">
<badge:SfBadgeView Grid.Row="0"
Grid.Column="0"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'
HeightRequest="80"
BadgeText="99"
BackgroundColor="White">
<Grid RowDefinitions="*,20">
<Image Source="{imageExtension:SfImageResource facebook.png}"
HorizontalOptions="Center"
WidthRequest="50"
HeightRequest="50"
VerticalOptions="Start" />
<Label Grid.Row="1"
Text="Success"
TextColor="Black"
HorizontalOptions="Center"
VerticalOptions="End"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Type="Success"
Stroke="White"
BorderWidth="2"
FontSize="15"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="0"
Grid.Column="1"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'
HeightRequest="80"
BadgeText="99"
BackgroundColor="White">
<Grid RowDefinitions="*,20">
<Image Source="{imageExtension:SfImageResource facebook.png}"
HorizontalOptions="Center"
WidthRequest="50"
HeightRequest="50"
VerticalOptions="Start" />
<Label Grid.Row="1"
Text="Dark"
TextColor="Black"
HorizontalOptions="Center"
VerticalOptions="End"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Type="Dark"
Stroke="White"
BorderWidth="2"
FontSize="15"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="0"
Grid.Column="2"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'
HeightRequest="80"
BadgeText="99"
BackgroundColor="White">
<Grid RowDefinitions="*,20">
<Image Source="{imageExtension:SfImageResource facebook.png}"
HorizontalOptions="Center"
WidthRequest="50"
HeightRequest="50"
VerticalOptions="Start" />
<Label Grid.Row="1"
Text="Info"
TextColor="Black"
HorizontalOptions="Center"
VerticalOptions="End"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Type="Info"
Stroke="White"
BorderWidth="2"
FontSize="15"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="1"
Grid.Column="0"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'
HeightRequest="80"
BadgeText="99"
BackgroundColor="White">
<Grid RowDefinitions="*,20">
<Image Source="{imageExtension:SfImageResource facebook.png}"
HorizontalOptions="Center"
WidthRequest="50"
HeightRequest="50"
VerticalOptions="Start" />
<Label Grid.Row="1"
Text="Light"
TextColor="Black"
HorizontalOptions="Center"
VerticalOptions="End"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings TextColor="Black"
Type="Light"
Stroke="Black"
BorderWidth="1"
FontSize="15"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="1"
Grid.Column="1"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'
HeightRequest="80"
BadgeText="99"
BackgroundColor="White">
<Grid RowDefinitions="*,20">
<Image Source="{imageExtension:SfImageResource facebook.png}"
HorizontalOptions="Center"
WidthRequest="50"
HeightRequest="50"
VerticalOptions="Start" />
<Label Grid.Row="1"
Text="Primary"
TextColor="Black"
HorizontalOptions="Center"
VerticalOptions="End"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Type="Primary"
Stroke="White"
BorderWidth="2"
FontSize="15"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="1"
Grid.Column="2" WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'
HeightRequest="80"
BadgeText="99"
BackgroundColor="White">
<Grid RowDefinitions="*,20" ColumnDefinitions="Auto">
<Image Grid.Row="0" Source="{imageExtension:SfImageResource facebook.png}"
HorizontalOptions="Center"
WidthRequest="50"
HeightRequest="50"
VerticalOptions="Start" />
<Label Grid.Row="1"
Text="Secondary"
FontSize="13"
TextColor="Black"
HorizontalOptions="Center"
VerticalOptions="End"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Type="Secondary"
Stroke="White"
BorderWidth="2"
FontSize="15"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="2"
Grid.Column="0"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'
HeightRequest="80"
BadgeText="99"
BackgroundColor="White">
<Grid RowDefinitions="*,20">
<Image Source="{imageExtension:SfImageResource facebook.png}"
HorizontalOptions="Center"
WidthRequest="50"
HeightRequest="50"
VerticalOptions="Start" />
<Label Grid.Row="1"
Text="Warning"
TextColor="Black"
HorizontalOptions="Center"
VerticalOptions="End"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Type="Warning"
Stroke="White"
BorderWidth="2"
FontSize="15"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="2"
Grid.Column="1"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'
HeightRequest="80"
BadgeText="99"
BackgroundColor="White">
<Grid RowDefinitions="*,20">
<Image Source="{imageExtension:SfImageResource facebook.png}"
HorizontalOptions="Center"
WidthRequest="50"
HeightRequest="50"
VerticalOptions="Start" />
<Label Grid.Row="1"
Text="Error"
TextColor="Black"
HorizontalOptions="Center"
VerticalOptions="End"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Type="Error"
Stroke="White"
BorderWidth="2"
FontSize="15"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<badge:SfBadgeView Grid.Row="2"
Grid.Column="2"
WidthRequest='{OnPlatform MacCatalyst="90", iOS="90", Default="80"}'
HeightRequest="80"
BadgeText="99"
BackgroundColor="White">
<Grid RowDefinitions="*,20">
<Image Source="{imageExtension:SfImageResource facebook.png}"
HorizontalOptions="Center"
WidthRequest="50"
HeightRequest="50"
VerticalOptions="Start" />
<Label Grid.Row="1"
Text="None"
TextColor="Black"
HorizontalOptions="Center"
VerticalOptions="End"/>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Type="None"
Background="DeepPink"
Stroke="White"
BorderWidth="2"
FontSize="15"/>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
</Grid>
</VerticalStackLayout>
</ScrollView>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,22 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using SampleBrowser.Maui.Base;
namespace SampleBrowser.Maui.BadgeView.SfBadgeView
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Type : SampleView
{
public Type()
{
InitializeComponent();
}
}
}

Просмотреть файл

@ -0,0 +1,269 @@
<?xml version="1.0" encoding="utf-8" ?>
<localCore:SampleView x:Class="SampleBrowser.Maui.BadgeView.SfBadgeView.Notification"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:badge="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:localCore="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
xmlns:imageExtension="clr-namespace:SampleBrowser.Maui.Base.Converters;assembly=SampleBrowser.Maui.Base"
xmlns:local="clr-namespace:SampleBrowser.Maui.BadgeView.SfBadgeView"
BackgroundColor="White">
<localCore:SampleView.Resources>
<imageExtension:SfImageSourceConverter x:Key="imageConverter"/>
</localCore:SampleView.Resources>
<localCore:SampleView.BindingContext>
<local:NotificationViewModel />
</localCore:SampleView.BindingContext>
<localCore:SampleView.Content>
<Grid BackgroundColor="#f7f7f7">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="70"/>
</Grid.RowDefinitions>
<ScrollView HorizontalScrollBarVisibility="Never" VerticalScrollBarVisibility="Never">
<VerticalStackLayout x:Name="listView"
BackgroundColor="White"
BindableLayout.ItemsSource="{Binding Collection}">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid x:Name="grid" RowSpacing="0" HeightRequest="70">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="1" />
</Grid.RowDefinitions>
<Grid RowSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="70"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="70"/>
</Grid.ColumnDefinitions>
<Image Source="{Binding Image,Converter={StaticResource imageConverter}}"
VerticalOptions="Center"
HorizontalOptions="Center"
HeightRequest="50" WidthRequest="50"/>
<Grid Grid.Column="1"
RowSpacing="1"
Padding="10,0,0,0"
VerticalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label LineBreakMode="NoWrap"
TextColor="Black"
VerticalOptions="End"
FontSize="{OnIdiom Phone='16',Desktop='20',Tablet='18'}"
Text="{Binding Name}" />
<Label Grid.Row="1"
Grid.Column="0"
TextColor="#777777"
VerticalOptions="Start"
LineBreakMode="NoWrap"
FontSize="12"
Text="{Binding Message}" />
</Grid>
<Grid Grid.Row="0"
Grid.Column="2"
RowSpacing="1"
VerticalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition Height="0.4*" />
<RowDefinition Height="0.6*" />
</Grid.RowDefinitions>
<Label LineBreakMode="NoWrap" Grid.Row="0"
Margin="0,0,10,0"
HorizontalOptions="Center"
VerticalOptions="Center"
TextColor="Black"
FontSize="12"
Text="{Binding Time}" />
<badge:SfBadgeView HeightRequest="22" BadgeText="{Binding Count}" Grid.Row="1">
<Label Text=""
HorizontalOptions="Center"
FontSize="10"/>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings Animation="None" Offset="-20,0" Type="Primary" />
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
</Grid>
</Grid>
<StackLayout Grid.Row="1" BackgroundColor="#E4E4E4" HeightRequest="1"/>
</Grid>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</ScrollView>
<Grid Grid.Row="1" HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" BackgroundColor="#f7f7f7">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid x:Name="statusBadgeGrid" Grid.Column="0" HorizontalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="20" />
</Grid.RowDefinitions>
<Label Text="&#xe703;"
HorizontalOptions="FillAndExpand"
HorizontalTextAlignment="Center"
VerticalOptions="End"
FontAttributes="Bold"
TextColor="#777777"
FontSize="28">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" >
<On Platform="iOS,MacCatalyst" Value="FONT Sf Badge view" />
<On Platform="WinUI" Value="BadgeViewFont.ttf#FONT Sf Badge view" />
<On Platform="Android" Value="BadgeViewFont.ttf#FONT Sf Badge view" />
</OnPlatform>
</Label.FontFamily>
</Label>
<Label Grid.Row="1" FontSize="12" HorizontalTextAlignment="Center"
VerticalTextAlignment="Center" Margin="0,-5,0,0" Text="Status"
TextColor="#777777"/>
</Grid>
<Grid x:Name="callsBadgeGrid" Grid.Column="1" HorizontalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<badge:SfBadgeView x:Name="callsBadge"
WidthRequest="60"
HorizontalOptions="Center"
BadgeText="3">
<Grid WidthRequest="60">
<Label Text="&#xe700;"
FontAttributes="Bold"
HorizontalOptions="Center"
VerticalOptions="End"
TextColor="#777777"
FontSize="28">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" >
<On Platform="iOS,MacCatalyst" Value="FONT Sf Badge view" />
<On Platform="WinUI" Value="BadgeViewFont.ttf#FONT Sf Badge view" />
<On Platform="Android" Value="BadgeViewFont.ttf#FONT Sf Badge view" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings FontSize="12"
Offset="-6,10"
Type="Error">
</badge:BadgeSettings>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<Label Text="Calls" Grid.Row="1" Margin="-8,-5,0,0"
FontSize="12" HorizontalTextAlignment="Center"
VerticalTextAlignment="Center" TextColor="#777777"/>
</Grid>
<Grid x:Name="chatBadgeGrid" Grid.Column="3" HorizontalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<badge:SfBadgeView x:Name="chatBadge"
WidthRequest="60"
HorizontalOptions="Center"
BadgeText="8">
<Grid WidthRequest="60" >
<Label Text="&#xe701;"
FontAttributes="Bold"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
VerticalOptions="End"
TextColor="#777777"
FontSize="28">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" >
<On Platform="iOS,MacCatalyst" Value="FONT Sf Badge view" />
<On Platform="WinUI" Value="BadgeViewFont.ttf#FONT Sf Badge view" />
<On Platform="Android" Value="BadgeViewFont.ttf#FONT Sf Badge view" />
</OnPlatform>
</Label.FontFamily>
</Label>
</Grid>
<badge:SfBadgeView.BadgeSettings>
<badge:BadgeSettings FontSize="12"
Offset="-4,10"
Type="Error"
Animation="Scale">
</badge:BadgeSettings>
</badge:SfBadgeView.BadgeSettings>
</badge:SfBadgeView>
<Label Text="Chats" Grid.Row="1" Margin="0,-5,0,0"
FontSize="12" HorizontalTextAlignment="Center"
VerticalTextAlignment="Center" TextColor="#777777"/>
</Grid>
<Grid Grid.Column="2" BackgroundColor="#f7f7f7" HorizontalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<Label x:Name="fontIconLabel2" Text="&#xe702;"
FontAttributes="Bold" TextColor="#777777"
FontSize="28" HorizontalOptions="FillAndExpand"
HorizontalTextAlignment="Center"
VerticalOptions="End">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" >
<On Platform="iOS,MacCatalyst" Value="FONT Sf Badge view" />
<On Platform="WinUI" Value="BadgeViewFont.ttf#FONT Sf Badge view" />
<On Platform="Android" Value="BadgeViewFont.ttf#FONT Sf Badge view" />
</OnPlatform>
</Label.FontFamily>
</Label>
<Label Text="Camera" Grid.Row="1" FontSize="12" Margin="0,-5,0,0"
HorizontalTextAlignment="Center" VerticalTextAlignment="Center"
TextColor="#777777"/>
</Grid>
<Grid Grid.Column="4" BackgroundColor="#f7f7f7" HorizontalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<Label x:Name="fontIconLabel4"
Text="&#xe704;" FontAttributes="Bold"
TextColor="#777777" FontSize="28"
HorizontalOptions="FillAndExpand"
HorizontalTextAlignment="Center"
VerticalOptions="End">
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String" >
<On Platform="iOS,MacCatalyst" Value="FONT Sf Badge view" />
<On Platform="WinUI" Value="BadgeViewFont.ttf#FONT Sf Badge view" />
<On Platform="Android" Value="BadgeViewFont.ttf#FONT Sf Badge view" />
</OnPlatform>
</Label.FontFamily>
</Label>
<Label Text="Settings" Grid.Row="1" FontSize="12" Margin="0,-5,0,0"
HorizontalTextAlignment="Center" VerticalTextAlignment="Center"
TextColor="#777777"/>
</Grid>
</Grid>
</Grid>
</localCore:SampleView.Content>
</localCore:SampleView>

Просмотреть файл

@ -0,0 +1,53 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using SampleBrowser.Maui.Base;
namespace SampleBrowser.Maui.BadgeView.SfBadgeView
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Notification : SampleView
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="Notification" /> class.
/// </summary>
public Notification()
{
InitializeComponent();
this.DynamicUpdate();
//TODO: Badge renders far away from the icons in Windows. Below is the workaround for that.
if (DeviceInfo.Platform == DevicePlatform.WinUI || DeviceInfo.Platform == DevicePlatform.MacCatalyst)
{
statusBadgeGrid.WidthRequest = 100;
callsBadgeGrid.WidthRequest = 100;
chatBadgeGrid.WidthRequest = 100;
}
}
#endregion
#region Methods
private async void DynamicUpdate()
{
double badgeText = 1;
while (true)
{
badgeText += 1;
this.chatBadge.BadgeText = badgeText.ToString();
await Task.Delay(2000);
}
}
#endregion
}
}

Просмотреть файл

@ -0,0 +1,37 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
namespace SampleBrowser.Maui.BadgeView.SfBadgeView
{
public class NotificationModel
{
/// <summary>
/// Gets or sets the image
/// </summary>
public string? Image { get; set; }
/// <summary>
/// Gets or sets the Name
/// </summary>
public string? Name { get; set; }
/// <summary>
/// Gets or sets the Time
/// </summary>
public string? Time { get; set; }
/// <summary>
/// Gets or sets the Count for BadgeView
/// </summary>
public string? Count { get; set; }
/// <summary>
/// Gets or sets the Message
/// </summary>
public string? Message { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,109 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System.Collections.ObjectModel;
namespace SampleBrowser.Maui.BadgeView.SfBadgeView
{
internal class NotificationViewModel
{
#region Constructor
/// <summary>
/// Initializes a new instance of the <see cref="NotificationViewModel" /> class
/// </summary>
public NotificationViewModel()
{
this.Collection = new ObservableCollection<NotificationModel>
{
new NotificationModel()
{
Image = "people_circle1.png",
Name = "Blessy",
Message = "Hi, I have sent you a photo",
Time = "Monday",
Count = string.Empty
},
new NotificationModel()
{
Image = "people_circle5.png",
Name = "Aaron",
Message = "Family meeting tomorrow at 6:30 PM",
Time = "11:30 PM",
Count = "99+"
},
new NotificationModel()
{
Image = "people_circle2.png",
Name = "Tara",
Message = "Hi, I am Tara, How are you?",
Time = "11:12 PM",
Count = "3"
},
new NotificationModel()
{
Image = "people_circle3.png",
Name = "Jeni",
Message = "video",
Time = "07:53 PM",
Count = "137",
},
new NotificationModel()
{
Image = "people_circle4.png",
Name = "Flora",
Message = "I have received your gift",
Time = "04:40 PM",
Count = string.Empty
},
new NotificationModel()
{
Image = "people_circle6.png",
Name = "Sara",
Count = "47",
Message = "done thanks",
Time = "Yesterday"
},
new NotificationModel()
{
Image = "people_circle8.png",
Name = "Stephan",
Count = string.Empty,
Time = "07.46 PM",
Message = "ok fine"
},
new NotificationModel()
{
Image = "people_circle7.png",
Name = "Maria",
Count = string.Empty,
Time = "07.46 PM",
Message = "Hi, How are you?"
},
new NotificationModel()
{
Image = "people_circle9.png",
Name = "Ancy",
Message = "Hi, i have sent you a photo",
Time = "Monday",
Count = "8"
}
};
}
#endregion Constructor
#region Properties
/// <summary>
/// Gets or sets the collection of Badge Model
/// </summary>
public ObservableCollection<NotificationModel> Collection { get; set; }
#endregion Properties
}
}

Просмотреть файл

16
MAUI/Barcode/NuGet.config Normal file
Просмотреть файл

@ -0,0 +1,16 @@
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="Local Syncfusion MAUI Source Package 20.2.0.36" value="../../../nuget" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
<activePackageSource>
<add key="Local Syncfusion MAUI Source Package 20.2.0.36" value="../../../nuget" />
</activePackageSource>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
</configuration>

Просмотреть файл

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleBrowser.Maui.Barcode", "SampleBrowser.Maui.Barcode\SampleBrowser.Maui.Barcode.csproj", "{06A07939-846C-48D4-A44D-C35AA6E6416B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Release-Xml|Any CPU = Release-Xml|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{06A07939-846C-48D4-A44D-C35AA6E6416B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06A07939-846C-48D4-A44D-C35AA6E6416B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06A07939-846C-48D4-A44D-C35AA6E6416B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{06A07939-846C-48D4-A44D-C35AA6E6416B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06A07939-846C-48D4-A44D-C35AA6E6416B}.Release|Any CPU.Build.0 = Release|Any CPU
{06A07939-846C-48D4-A44D-C35AA6E6416B}.Release|Any CPU.Deploy.0 = Release|Any CPU
{06A07939-846C-48D4-A44D-C35AA6E6416B}.Release-Xml|Any CPU.ActiveCfg = Release-Xml|Any CPU
{06A07939-846C-48D4-A44D-C35AA6E6416B}.Release-Xml|Any CPU.Build.0 = Release-Xml|Any CPU
{06A07939-846C-48D4-A44D-C35AA6E6416B}.Release-Xml|Any CPU.Deploy.0 = Release-Xml|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {61F7FB11-1E47-470C-91E2-47F8143E1572}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:SampleBrowser.Maui.Barcode"
xmlns:base="clr-namespace:SampleBrowser.Maui.Base;assembly=SampleBrowser.Maui.Base"
x:Class="SampleBrowser.Maui.Barcode.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<base:SampleBrowserStyles/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

Просмотреть файл

@ -0,0 +1,25 @@
#region Copyright Syncfusion Inc. 2001-2022.
// Copyright Syncfusion Inc. 2001-2022. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System.Reflection;
namespace SampleBrowser.Maui.Barcode;
public partial class App : Application
{
public App()
{
InitializeComponent();
//MainPage = new AppShell();
var appInfo = typeof(App).GetTypeInfo().Assembly;
SampleBrowser.Maui.Base.BaseConfig.IsIndividualSB = true;
MainPage = SampleBrowser.Maui.Base.BaseConfig.MainPageInit(appInfo);
}
}

Просмотреть файл

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<SyncfusionControls>
<ControlCategory Name="Data Visualization">
<Control Title="Barcode Generator" ControlName="SfBarcodeGenerator" Image="barcode.png" StatusTag="Updated" Description="Generate and display data in machine-readable 1D and 2D barcodes.">
<Category Title="Showcase">
<Sample Title="Boarding Pass" SampleName="BoardingPass" SearchTags="BoardingPass" CodeViewerPath="Barcode/BoardingPass/"/>
<Sample Title="Wi-Fi" SampleName="Wifi" SearchTags="Wifi" CodeViewerPath="Barcode/Wifi/"/>
</Category>
<Sample Title="One Dimensional" SampleName="OneDimensional" SearchTags="OneDimensional" CodeViewerPath="Barcode/OneDimensional/"/>
<Sample Title="QR Code" SampleName="QRCode" StatusTag="Updated" SearchTags="QRCode" CodeViewerPath="Barcode/QRCode/"/>
<Sample Title="Data Matrix" SampleName="DataMatrix" StatusTag="Updated" SearchTags="DataMatrix" CodeViewerPath="Barcode/DataMatrix/"/>
</Control>
</ControlCategory>
</SyncfusionControls>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше