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

0 commit comments

Comments
 (0)