Skip to content

Commit 5e05451

Browse files
Add the sample
1 parent 50e6d49 commit 5e05451

39 files changed

Lines changed: 9118 additions & 0 deletions
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.35527.113 d17.12
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComboBoxSoftInputAdjustHandling", "ComboBoxSoftInputAdjustHandling\ComboBoxSoftInputAdjustHandling.csproj", "{8544761C-916B-43D1-94C5-D8DB2821247C}"
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+
{8544761C-916B-43D1-94C5-D8DB2821247C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{8544761C-916B-43D1-94C5-D8DB2821247C}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{8544761C-916B-43D1-94C5-D8DB2821247C}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{8544761C-916B-43D1-94C5-D8DB2821247C}.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:ComboBoxSoftInputAdjustHandling"
5+
x:Class="ComboBoxSoftInputAdjustHandling.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 ComboBoxSoftInputAdjustHandling
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: 15 additions & 0 deletions
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="ComboBoxSoftInputAdjustHandling.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:ComboBoxSoftInputAdjustHandling"
7+
Shell.FlyoutBehavior="Flyout"
8+
Title="ComboBoxSoftInputAdjustHandling">
9+
10+
<ShellContent
11+
Title="Home"
12+
ContentTemplate="{DataTemplate local:MainPage}"
13+
Route="MainPage" />
14+
15+
</Shell>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace ComboBoxSoftInputAdjustHandling
2+
{
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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>ComboBoxSoftInputAdjustHandling</RootNamespace>
18+
<UseMaui>true</UseMaui>
19+
<SingleProject>true</SingleProject>
20+
<ImplicitUsings>enable</ImplicitUsings>
21+
<Nullable>enable</Nullable>
22+
23+
<!-- Display name -->
24+
<ApplicationTitle>ComboBoxSoftInputAdjustHandling</ApplicationTitle>
25+
26+
<!-- App Identifier -->
27+
<ApplicationId>com.companyname.comboboxsoftinputadjusthandling</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.Inputs" Version="28.2.6" />
66+
67+
</ItemGroup>
68+
69+
</Project>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.5.2.0
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComboBoxSoftInputAdjustHandling", "ComboBoxSoftInputAdjustHandling.csproj", "{4721A47E-74CE-20B2-08B2-16EAD64F7CB8}"
6+
EndProject
7+
Global
8+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
9+
Debug|Any CPU = Debug|Any CPU
10+
Release|Any CPU = Release|Any CPU
11+
EndGlobalSection
12+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
13+
{4721A47E-74CE-20B2-08B2-16EAD64F7CB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
14+
{4721A47E-74CE-20B2-08B2-16EAD64F7CB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
15+
{4721A47E-74CE-20B2-08B2-16EAD64F7CB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
16+
{4721A47E-74CE-20B2-08B2-16EAD64F7CB8}.Release|Any CPU.Build.0 = Release|Any CPU
17+
EndGlobalSection
18+
GlobalSection(SolutionProperties) = preSolution
19+
HideSolutionNode = FALSE
20+
EndGlobalSection
21+
GlobalSection(ExtensibilityGlobals) = postSolution
22+
SolutionGuid = {7333FF17-9600-4477-9171-AC8012E04AF1}
23+
EndGlobalSection
24+
EndGlobal
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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="ComboBoxSoftInputAdjustHandling.MainPage"
5+
xmlns:editors="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs">
6+
7+
8+
<ScrollView>
9+
<VerticalStackLayout>
10+
<Label Text="Label1"></Label>
11+
<Entry></Entry>
12+
<Label Text="Label1"></Label>
13+
<Entry></Entry>
14+
<Label Text="Label1"></Label>
15+
<Entry></Entry>
16+
<Label Text="Label1"></Label>
17+
<Entry></Entry>
18+
<Label Text="Label1"></Label>
19+
<Entry></Entry>
20+
<Label Text="Label1"></Label>
21+
<Entry></Entry>
22+
<Label Text="Label1"></Label>
23+
<Entry></Entry>
24+
<Label Text="Label1"></Label>
25+
<Entry></Entry>
26+
<Label Text="Label1"></Label>
27+
<Entry></Entry>
28+
<Label Text="SfComboBox"></Label>
29+
<editors:SfComboBox
30+
DropDownClosing="SfComboBox_DropDownClosing"
31+
WidthRequest="250"
32+
HeightRequest="50"
33+
IsEditable="True"
34+
SelectionMode="Multiple">
35+
<editors:SfComboBox.ItemsSource>
36+
<x:Array Type="{x:Type x:String}">
37+
<x:String>Baboon</x:String>
38+
<x:String>Capuchin Monkey</x:String>
39+
<x:String>Blue Monkey</x:String>
40+
<x:String>Squirrel Monkey</x:String>
41+
<x:String>Golden Lion Tamarin</x:String>
42+
<x:String>Howler Monkey</x:String>
43+
<x:String>Japanese Macaque</x:String>
44+
</x:Array>
45+
</editors:SfComboBox.ItemsSource>
46+
</editors:SfComboBox>
47+
<Label Text="SfComboBox"></Label>
48+
<editors:SfComboBox
49+
WidthRequest="250"
50+
HeightRequest="50"
51+
IsEditable="True"
52+
DropDownClosing="SfComboBox_DropDownClosing"
53+
SelectionMode="Multiple">
54+
<editors:SfComboBox.ItemsSource>
55+
<x:Array Type="{x:Type x:String}">
56+
<x:String>Baboon</x:String>
57+
<x:String>Capuchin Monkey</x:String>
58+
<x:String>Blue Monkey</x:String>
59+
<x:String>Squirrel Monkey</x:String>
60+
<x:String>Golden Lion Tamarin</x:String>
61+
<x:String>Howler Monkey</x:String>
62+
<x:String>Japanese Macaque</x:String>
63+
</x:Array>
64+
</editors:SfComboBox.ItemsSource>
65+
</editors:SfComboBox>
66+
</VerticalStackLayout>
67+
</ScrollView>
68+
69+
70+
71+
</ContentPage>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+

2+
using Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific;
3+
4+
namespace ComboBoxSoftInputAdjustHandling
5+
{
6+
public partial class MainPage : ContentPage
7+
{
8+
9+
public MainPage()
10+
{
11+
InitializeComponent();
12+
App.Current.On<Microsoft.Maui.Controls.PlatformConfiguration.Android>().UseWindowSoftInputModeAdjust(WindowSoftInputModeAdjust.Resize);
13+
14+
}
15+
16+
private bool isResizing; // Flag to track resizing
17+
18+
protected override void OnSizeAllocated(double width, double height)
19+
{
20+
base.OnSizeAllocated(width, height);
21+
isResizing = true;
22+
}
23+
24+
private async void SfComboBox_DropDownClosing(object sender, Syncfusion.Maui.Core.DropDownCancelEventArgs e)
25+
{
26+
if (isResizing)
27+
{
28+
e.Cancel = true; // Prevent closing during resizing
29+
}
30+
31+
await Task.Delay(400); // Short delay to update UI after resizing
32+
isResizing = false;
33+
}
34+
35+
}
36+
37+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using Microsoft.Extensions.Logging;
2+
using Syncfusion.Maui.Core.Hosting;
3+
4+
5+
namespace ComboBoxSoftInputAdjustHandling
6+
{
7+
public static class MauiProgram
8+
{
9+
public static MauiApp CreateMauiApp()
10+
{
11+
var builder = MauiApp.CreateBuilder();
12+
builder
13+
.UseMauiApp<App>()
14+
.ConfigureSyncfusionCore()
15+
16+
.ConfigureFonts(fonts =>
17+
{
18+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
19+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
20+
});
21+
22+
#if DEBUG
23+
builder.Logging.AddDebug();
24+
#endif
25+
26+
return builder.Build();
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)