Skip to content

Commit 3df063f

Browse files
Merge pull request #1 from SyncfusionExamples/ContentSpacingForCheckBox
Content spacing for check box
2 parents 5aeb59d + 0b7857d commit 3df063f

40 files changed

+9106
-0
lines changed

CheckBox/App.xaml

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

CheckBox/App.xaml.cs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace CheckBox
2+
{
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
}
9+
10+
protected override Window CreateWindow(IActivationState? activationState)
11+
{
12+
return new Window(new AppShell());
13+
}
14+
}
15+
}

CheckBox/AppShell.xaml

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

CheckBox/AppShell.xaml.cs

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

CheckBox/CheckBox.csproj

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks>
5+
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net9.0-windows10.0.19041.0</TargetFrameworks>
6+
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
8+
9+
<!-- Note for MacCatalyst:
10+
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
11+
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
12+
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
13+
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
14+
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
15+
16+
<OutputType>Exe</OutputType>
17+
<RootNamespace>CheckBox</RootNamespace>
18+
<UseMaui>true</UseMaui>
19+
<SingleProject>true</SingleProject>
20+
<ImplicitUsings>enable</ImplicitUsings>
21+
<Nullable>enable</Nullable>
22+
23+
<!-- Display name -->
24+
<ApplicationTitle>CheckBox</ApplicationTitle>
25+
26+
<!-- App Identifier -->
27+
<ApplicationId>com.companyname.checkbox</ApplicationId>
28+
29+
<!-- Versions -->
30+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
31+
<ApplicationVersion>1</ApplicationVersion>
32+
33+
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
34+
<WindowsPackageType>None</WindowsPackageType>
35+
36+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
37+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
38+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
39+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
40+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
41+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
42+
</PropertyGroup>
43+
44+
<ItemGroup>
45+
<!-- App Icon -->
46+
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
47+
48+
<!-- Splash Screen -->
49+
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
50+
51+
<!-- Images -->
52+
<MauiImage Include="Resources\Images\*" />
53+
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="300,185" />
54+
55+
<!-- Custom Fonts -->
56+
<MauiFont Include="Resources\Fonts\*" />
57+
58+
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
59+
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
60+
</ItemGroup>
61+
62+
<ItemGroup>
63+
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
64+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0" />
65+
<PackageReference Include="Syncfusion.Maui.Buttons" Version="*" />
66+
</ItemGroup>
67+
68+
</Project>

CheckBox/CheckBox.csproj.user

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen>
5+
<ActiveDebugFramework>net9.0-windows10.0.19041.0</ActiveDebugFramework>
6+
<ActiveDebugProfile>Windows Machine</ActiveDebugProfile>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<None Update="App.xaml">
10+
<SubType>Designer</SubType>
11+
</None>
12+
<None Update="AppShell.xaml">
13+
<SubType>Designer</SubType>
14+
</None>
15+
<None Update="MainPage.xaml">
16+
<SubType>Designer</SubType>
17+
</None>
18+
<None Update="Platforms\Windows\App.xaml">
19+
<SubType>Designer</SubType>
20+
</None>
21+
<None Update="Platforms\Windows\Package.appxmanifest">
22+
<SubType>Designer</SubType>
23+
</None>
24+
<None Update="Resources\Styles\Colors.xaml">
25+
<SubType>Designer</SubType>
26+
</None>
27+
<None Update="Resources\Styles\Styles.xaml">
28+
<SubType>Designer</SubType>
29+
</None>
30+
</ItemGroup>
31+
</Project>

CheckBox/CheckBox.sln

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.12.35506.116 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CheckBox", "CheckBox.csproj", "{17946154-D903-4535-BE76-C03387CBC7AD}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{17946154-D903-4535-BE76-C03387CBC7AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{17946154-D903-4535-BE76-C03387CBC7AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{17946154-D903-4535-BE76-C03387CBC7AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{17946154-D903-4535-BE76-C03387CBC7AD}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

CheckBox/MainPage.xaml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
x:Class="CheckBox.MainPage"
5+
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Buttons;assembly=Syncfusion.Maui.Buttons">
6+
7+
<StackLayout Padding="20">
8+
<syncfusion:SfCheckBox Text="I accept the terms and conditions"
9+
ContentSpacing="15"
10+
IsChecked="True"
11+
HorizontalOptions="Start"/>
12+
13+
<syncfusion:SfCheckBox Text="Subscribe to newsletter"
14+
ContentSpacing="15"
15+
IsChecked="False"
16+
HorizontalOptions="Start"/>
17+
18+
<syncfusion:SfCheckBox Text="Enable email notifications"
19+
ContentSpacing="15"
20+
IsChecked="True"
21+
HorizontalOptions="Start"/>
22+
23+
<syncfusion:SfCheckBox Text="Remember me on this device"
24+
ContentSpacing="15"
25+
IsChecked="False"
26+
HorizontalOptions="Start"/>
27+
28+
<syncfusion:SfCheckBox Text="Allow location access"
29+
ContentSpacing="15"
30+
IsChecked="True"
31+
HorizontalOptions="Start"/>
32+
</StackLayout>
33+
34+
</ContentPage>

CheckBox/MainPage.xaml.cs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace CheckBox
2+
{
3+
public partial class MainPage : ContentPage
4+
{
5+
6+
public MainPage()
7+
{
8+
InitializeComponent();
9+
}
10+
11+
}
12+
13+
}

CheckBox/MauiProgram.cs

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

0 commit comments

Comments
 (0)