Skip to content

Commit d7e8532

Browse files
Merge pull request #2 from SyncfusionExamples/private
How to work with .NET MAUI Expander (SfExpander) using C#?
2 parents d32ca8d + cb51894 commit d7e8532

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+8122
-90
lines changed

ExpanderMaui/ExpanderMaui.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}") = "ExpanderMaui", "ExpanderMaui\ExpanderMaui.csproj", "{181DC4CB-F676-4F19-AC17-A674D4871C2E}"
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+
{181DC4CB-F676-4F19-AC17-A674D4871C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{181DC4CB-F676-4F19-AC17-A674D4871C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{181DC4CB-F676-4F19-AC17-A674D4871C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{181DC4CB-F676-4F19-AC17-A674D4871C2E}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

GettingStarted/App.xaml renamed to ExpanderMaui/ExpanderMaui/App.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version = "1.0" encoding = "UTF-8" ?>
22
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
33
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4-
xmlns:local="clr-namespace:GettingStarted"
5-
x:Class="GettingStarted.App">
4+
xmlns:local="clr-namespace:ExpanderMaui"
5+
x:Class="ExpanderMaui.App">
66
<Application.Resources>
77
<ResourceDictionary>
88
<ResourceDictionary.MergedDictionaries>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace ExpanderMaui
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+
}

GettingStarted/AppShell.xaml renamed to ExpanderMaui/ExpanderMaui/AppShell.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<Shell
3-
x:Class="GettingStarted.AppShell"
3+
x:Class="ExpanderMaui.AppShell"
44
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
55
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
6-
xmlns:local="clr-namespace:GettingStarted"
7-
Shell.FlyoutBehavior="Disabled"
8-
Title="GettingStarted">
6+
xmlns:local="clr-namespace:ExpanderMaui"
7+
Shell.FlyoutBehavior="Flyout"
8+
Title="ExpanderMaui">
99

1010
<ShellContent
1111
Title="Home"

GettingStarted/AppShell.xaml.cs renamed to ExpanderMaui/ExpanderMaui/AppShell.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace GettingStarted
1+
namespace ExpanderMaui
22
{
33
public partial class AppShell : Shell
44
{

GettingStarted/GettingStarted.csproj renamed to ExpanderMaui/ExpanderMaui/ExpanderMaui.csproj

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
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>
66
<!-- 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);net8.0-tizen</TargetFrameworks> -->
7+
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
88

99
<!-- Note for MacCatalyst:
1010
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
@@ -14,24 +14,27 @@
1414
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
1515

1616
<OutputType>Exe</OutputType>
17-
<RootNamespace>GettingStarted</RootNamespace>
17+
<RootNamespace>ExpanderMaui</RootNamespace>
1818
<UseMaui>true</UseMaui>
1919
<SingleProject>true</SingleProject>
2020
<ImplicitUsings>enable</ImplicitUsings>
2121
<Nullable>enable</Nullable>
2222

2323
<!-- Display name -->
24-
<ApplicationTitle>GettingStarted</ApplicationTitle>
24+
<ApplicationTitle>ExpanderMaui</ApplicationTitle>
2525

2626
<!-- App Identifier -->
27-
<ApplicationId>com.companyname.gettingstarted</ApplicationId>
27+
<ApplicationId>com.companyname.expandermaui</ApplicationId>
2828

2929
<!-- Versions -->
3030
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
3131
<ApplicationVersion>1</ApplicationVersion>
3232

33-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
34-
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
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>
3538
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
3639
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
3740
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
@@ -58,9 +61,9 @@
5861

5962
<ItemGroup>
6063
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
61-
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
62-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
64+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(MauiVersion)" />
6365
<PackageReference Include="Syncfusion.Maui.Expander" Version="*" />
66+
6467
</ItemGroup>
6568

6669
</Project>
Lines changed: 31 additions & 0 deletions
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>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
33
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
4-
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Expander;assembly=Syncfusion.Maui.Expander"
5-
x:Class="GettingStarted.MainPage">
4+
xmlns:syncfusion="clr-namespace:Syncfusion.Maui.Expander;assembly=Syncfusion.Maui.Expander"
5+
x:Class="ExpanderMaui.MainPage">
66

77
</ContentPage>

GettingStarted/MainPage.xaml.cs renamed to ExpanderMaui/ExpanderMaui/MainPage.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using Syncfusion.Maui.Expander;
22

3-
namespace GettingStarted
3+
namespace ExpanderMaui
44
{
55
public partial class MainPage : ContentPage
66
{
7+
78
StackLayout stack;
89
SfExpander expander1, expander2;
910

@@ -83,4 +84,5 @@ public MainPage()
8384
this.Content = stack;
8485
}
8586
}
87+
8688
}

GettingStarted/MauiProgram.cs renamed to ExpanderMaui/ExpanderMaui/MauiProgram.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Microsoft.Extensions.Logging;
22
using Syncfusion.Maui.Core.Hosting;
33

4-
namespace GettingStarted
4+
namespace ExpanderMaui
55
{
66
public static class MauiProgram
77
{
@@ -10,12 +10,13 @@ public static MauiApp CreateMauiApp()
1010
var builder = MauiApp.CreateBuilder();
1111
builder
1212
.UseMauiApp<App>()
13+
.ConfigureSyncfusionCore()
1314
.ConfigureFonts(fonts =>
1415
{
1516
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
1617
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
1718
});
18-
builder.ConfigureSyncfusionCore();
19+
1920
#if DEBUG
2021
builder.Logging.AddDebug();
2122
#endif

0 commit comments

Comments
 (0)