Skip to content

Commit 32fd18f

Browse files
Merge pull request #1 from SyncfusionExamples/Toolkit-controls
Prepared Toolkit sample and read me file
2 parents ba86872 + 7eb99b7 commit 32fd18f

39 files changed

+9107
-1
lines changed

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,49 @@
11
# Getting-Started-with-the-.NET-MAUI-Toolkit
2-
This sample demonstrates how to get started with the MAUI Toolkit controls within a .NET MAUI application.
2+
This sample demonstrates how to get started with the MAUI Toolkit controls within a .NET MAUI application.
3+
4+
## Sample
5+
6+
```xaml
7+
<chart:SfCartesianChart>
8+
9+
<chart:SfCartesianChart.Title>
10+
<Label Text="Visualizing Temperature Variations" FontSize="20" FontAttributes="Bold" HorizontalTextAlignment="Center"/>
11+
</chart:SfCartesianChart.Title>
12+
13+
<chart:SfCartesianChart.XAxes>
14+
<chart:DateTimeAxis Interval="5"/>
15+
</chart:SfCartesianChart.XAxes>
16+
17+
<chart:SfCartesianChart.YAxes>
18+
<chart:NumericalAxis Interval="10" Minimum="0" Maximum="40">
19+
<chart:NumericalAxis.LabelStyle>
20+
<chart:ChartAxisLabelStyle LabelFormat="0'C" />
21+
</chart:NumericalAxis.LabelStyle>
22+
</chart:NumericalAxis>
23+
</chart:SfCartesianChart.YAxes>
24+
25+
<chart:SplineRangeAreaSeries ItemsSource="{Binding Temperature}"
26+
XBindingPath="Date"
27+
Low="MinValue"
28+
High="MaxValue"
29+
Stroke="Teal"
30+
Fill="LightGreen"
31+
Opacity="0.8"/>
32+
33+
</chart:SfCartesianChart>
34+
```
35+
36+
## Requirements to run the demo
37+
38+
To run the demo, refer to [System Requirements for .NET MAUI](https://help.syncfusion.com/maui/system-requirements)
39+
40+
## Troubleshooting:
41+
### Path too long exception
42+
43+
If you are facing path too long exception when building this example project, close Visual Studio and rename the repository to short and build the project.
44+
45+
## License
46+
47+
Syncfusion has no liability for any damage or consequence that may arise from using or viewing the samples. The samples are for demonstrative purposes. If you choose to use or access the samples, you agree to not hold Syncfusion liable, in any form, for any damage related to use, for accessing, or viewing the samples. By accessing, viewing, or seeing the samples, you acknowledge and agree Syncfusion's samples will not allow you seek injunctive relief in any form for any claim related to the sample. If you do not agree to this, do not view, access, utilize, or otherwise do anything with Syncfusion's samples.
48+
49+

ToolkitSample/ToolkitSample.sln

Lines changed: 22 additions & 0 deletions
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}") = "ToolkitSample", "ToolkitSample\ToolkitSample.csproj", "{E53F3E17-ED11-4A8F-81C3-C1DCC6AE738F}"
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+
{E53F3E17-ED11-4A8F-81C3-C1DCC6AE738F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{E53F3E17-ED11-4A8F-81C3-C1DCC6AE738F}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{E53F3E17-ED11-4A8F-81C3-C1DCC6AE738F}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{E53F3E17-ED11-4A8F-81C3-C1DCC6AE738F}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

ToolkitSample/ToolkitSample/App.xaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version = "1.0" encoding = "UTF-8" ?>
2+
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:local="clr-namespace:ToolkitSample"
5+
x:Class="ToolkitSample.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>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace ToolkitSample
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+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<Shell
3+
x:Class="ToolkitSample.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:ToolkitSample"
7+
Shell.FlyoutBehavior="Flyout"
8+
Title="ToolkitSample">
9+
10+
<ShellContent
11+
ContentTemplate="{DataTemplate local:MainPage}"
12+
Route="MainPage" />
13+
14+
</Shell>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace ToolkitSample
2+
{
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4+
xmlns:chart="clr-namespace:Syncfusion.Maui.Toolkit.Charts;assembly=Syncfusion.Maui.Toolkit"
5+
xmlns:local="clr-namespace:ToolkitSample"
6+
x:Class="ToolkitSample.MainPage">
7+
8+
<ContentPage.BindingContext>
9+
<local:ViewModel/>
10+
</ContentPage.BindingContext>
11+
12+
<chart:SfCartesianChart>
13+
14+
<chart:SfCartesianChart.Title>
15+
<Label Text="Visualizing Temperature Variations" FontSize="20" FontAttributes="Bold" HorizontalTextAlignment="Center"/>
16+
</chart:SfCartesianChart.Title>
17+
18+
<chart:SfCartesianChart.XAxes>
19+
<chart:DateTimeAxis Interval="5"/>
20+
</chart:SfCartesianChart.XAxes>
21+
22+
<chart:SfCartesianChart.YAxes>
23+
<chart:NumericalAxis Interval="10" Minimum="0" Maximum="40">
24+
<chart:NumericalAxis.LabelStyle>
25+
<chart:ChartAxisLabelStyle LabelFormat="0'C" />
26+
</chart:NumericalAxis.LabelStyle>
27+
</chart:NumericalAxis>
28+
</chart:SfCartesianChart.YAxes>
29+
30+
<chart:SplineRangeAreaSeries ItemsSource="{Binding Temperature}"
31+
XBindingPath="Date"
32+
Low="MinValue"
33+
High="MaxValue"
34+
Stroke="Teal"
35+
Fill="LightGreen"
36+
Opacity="0.8"/>
37+
38+
</chart:SfCartesianChart>
39+
40+
</ContentPage>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System.Collections.ObjectModel;
2+
3+
namespace ToolkitSample
4+
{
5+
public partial class MainPage : ContentPage
6+
{
7+
public MainPage()
8+
{
9+
InitializeComponent();
10+
}
11+
}
12+
13+
public class Model
14+
{
15+
public DateTime Date { get; set; }
16+
public double MinValue { get; set; }
17+
public double MaxValue { get; set; }
18+
}
19+
20+
public class ViewModel
21+
{
22+
public ObservableCollection<Model> Temperature { get; set; }
23+
24+
public ViewModel()
25+
{
26+
Temperature = new ObservableCollection<Model>
27+
{
28+
new Model { Date = new DateTime(2024,11,5), MinValue = 16, MaxValue = 20 },
29+
new Model { Date = new DateTime(2024,11,10), MinValue = 20, MaxValue = 25 },
30+
new Model { Date = new DateTime(2024,11,15), MinValue = 11, MaxValue = 15 },
31+
new Model { Date = new DateTime(2024,11,20), MinValue = 15, MaxValue = 20 },
32+
new Model { Date = new DateTime(2024,11,25), MinValue = 10, MaxValue = 15 },
33+
new Model { Date = new DateTime(2024,11,30), MinValue = 21, MaxValue = 25 }
34+
};
35+
}
36+
}
37+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.Extensions.Logging;
2+
using Syncfusion.Maui.Toolkit.Hosting;
3+
4+
namespace ToolkitSample
5+
{
6+
public static class MauiProgram
7+
{
8+
public static MauiApp CreateMauiApp()
9+
{
10+
var builder = MauiApp.CreateBuilder();
11+
builder
12+
.UseMauiApp<App>()
13+
.ConfigureSyncfusionToolkit()
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+
}
Lines changed: 6 additions & 0 deletions
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>
Lines changed: 11 additions & 0 deletions
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 ToolkitSample
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+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Android.App;
2+
using Android.Runtime;
3+
4+
namespace ToolkitSample
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+
}
Lines changed: 6 additions & 0 deletions
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>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using Foundation;
2+
3+
namespace ToolkitSample
4+
{
5+
[Register("AppDelegate")]
6+
public class AppDelegate : MauiUIApplicationDelegate
7+
{
8+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
9+
}
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!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+
Lines changed: 38 additions & 0 deletions
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>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using ObjCRuntime;
2+
using UIKit;
3+
4+
namespace ToolkitSample
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+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using Microsoft.Maui;
3+
using Microsoft.Maui.Hosting;
4+
5+
namespace ToolkitSample
6+
{
7+
internal class Program : MauiApplication
8+
{
9+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
10+
11+
static void Main(string[] args)
12+
{
13+
var app = new Program();
14+
app.Run(args);
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)