Skip to content

Commit 2c75f82

Browse files
Added Sample file
1 parent 90696c8 commit 2c75f82

38 files changed

+1114
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.10.34916.146
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SearchIconInAutocomplete", "SearchIconInAutocomplete\SearchIconInAutocomplete.csproj", "{B06A0A99-ADA6-4E85-B459-33EA92B94D0A}"
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+
{B06A0A99-ADA6-4E85-B459-33EA92B94D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{B06A0A99-ADA6-4E85-B459-33EA92B94D0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{B06A0A99-ADA6-4E85-B459-33EA92B94D0A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
17+
{B06A0A99-ADA6-4E85-B459-33EA92B94D0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{B06A0A99-ADA6-4E85-B459-33EA92B94D0A}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{B06A0A99-ADA6-4E85-B459-33EA92B94D0A}.Release|Any CPU.Deploy.0 = Release|Any CPU
20+
EndGlobalSection
21+
GlobalSection(SolutionProperties) = preSolution
22+
HideSolutionNode = FALSE
23+
EndGlobalSection
24+
GlobalSection(ExtensibilityGlobals) = postSolution
25+
SolutionGuid = {62BF0541-D264-4FEF-8AFA-30D2B9B302A2}
26+
EndGlobalSection
27+
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:SearchIconInAutocomplete"
5+
x:Class="SearchIconInAutocomplete.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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace SearchIconInAutocomplete
2+
{
3+
public partial class App : Application
4+
{
5+
public App()
6+
{
7+
InitializeComponent();
8+
9+
MainPage = new AppShell();
10+
}
11+
}
12+
}
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="SearchIconInAutocomplete.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:SearchIconInAutocomplete"
7+
Shell.FlyoutBehavior="Disabled"
8+
Title="SearchIconInAutocomplete">
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 SearchIconInAutocomplete
2+
{
3+
public partial class AppShell : Shell
4+
{
5+
public AppShell()
6+
{
7+
InitializeComponent();
8+
}
9+
}
10+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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="SearchIconInAutocomplete.MainPage"
5+
xmlns:local="clr-namespace:SearchIconInAutocomplete"
6+
xmlns:editors="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs">
7+
8+
<ContentPage.BindingContext>
9+
<local:SocialMediaViewModel />
10+
</ContentPage.BindingContext>
11+
12+
13+
<VerticalStackLayout Spacing="10" Padding="20">
14+
<!-- Title Label -->
15+
<Label Text="AutoComplete With Search Icon"
16+
HorizontalOptions="Center"
17+
FontSize="14"
18+
FontAttributes="Bold"/>
19+
20+
<!-- AutoComplete with Search Icon -->
21+
<Border
22+
WidthRequest="270"
23+
StrokeShape="RoundRectangle 6"
24+
StrokeThickness="1"
25+
Stroke="LightGray"
26+
BackgroundColor="White"
27+
HorizontalOptions="Center">
28+
29+
<Grid ColumnDefinitions="*,40">
30+
<!-- SfAutocomplete -->
31+
<editors:SfAutocomplete ShowBorder="False"
32+
IsClearButtonVisible="False"
33+
x:Name="autocomplete"
34+
BackgroundColor="Transparent"
35+
DisplayMemberPath="Name"
36+
DropdownWidth="270"
37+
ItemsSource="{Binding SocialMedias}"
38+
VerticalOptions="Center"/>
39+
40+
<!-- Search Icon -->
41+
<Label Text="&#xF349;"
42+
Grid.Column="1"
43+
FontSize="20"
44+
VerticalTextAlignment="Center"
45+
HorizontalTextAlignment="Center"
46+
FontFamily="MaterialDesignIcons"
47+
TextColor="Gray"
48+
BackgroundColor="Transparent">
49+
<Label.GestureRecognizers>
50+
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
51+
</Label.GestureRecognizers>
52+
</Label>
53+
</Grid>
54+
</Border>
55+
</VerticalStackLayout>
56+
57+
58+
59+
60+
</ContentPage>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace SearchIconInAutocomplete
2+
{
3+
public partial class MainPage : ContentPage
4+
{
5+
public MainPage()
6+
{
7+
InitializeComponent();
8+
}
9+
10+
private void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
11+
{
12+
DisplayAlert("Search Text", $"You searched for: {autocomplete.Text}", "OK");
13+
}
14+
}
15+
16+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Microsoft.Extensions.Logging;
2+
using Syncfusion.Maui.Core.Hosting;
3+
4+
5+
namespace SearchIconInAutocomplete
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+
.ConfigureFonts(fonts =>
16+
{
17+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
18+
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
19+
fonts.AddFont("materialdesignicons-webfont.ttf", "MaterialDesignIcons");
20+
21+
});
22+
23+
#if DEBUG
24+
builder.Logging.AddDebug();
25+
#endif
26+
27+
return builder.Build();
28+
}
29+
}
30+
}
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 SearchIconInAutocomplete
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+
}

0 commit comments

Comments
 (0)