Skip to content

Commit 0e748fe

Browse files
Update LiquidGlassSupport.md
1 parent 9174f00 commit 0e748fe

File tree

1 file changed

+49
-57
lines changed

1 file changed

+49
-57
lines changed
Lines changed: 49 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,81 @@
11
---
22
layout: post
3-
title: Liquid Glass Support for .NET MAUI Autocomplete entry | Syncfusion®
4-
description: Learn here about providing liquid glass support for Syncfusion® .NET MAUI Autocomplete (SfAutocomplete) control and more.
3+
title: Liquid Glass Effect for .NET MAUI Autocomplete | Syncfusion®
4+
description: Learn how to enable and customize the Liquid Glass Effect in the Syncfusion® .NET MAUI Autocomplete (SfAutocomplete) control.
55
platform: MAUI
66
control: SfAutocomplete
77
documentation: ug
88
---
99

10-
# Liquid Glass Support for .NET MAUI Autocomplete
10+
# Liquid Glass Effect in .NET MAUI Autocomplete (SfAutocomplete)
1111

12-
The [SfAutocomplete](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Inputs.SfAutocomplete.html) supports a `liquid glass` appearance by hosting the control inside the Syncfusion [SfGlassEffectView](). You can customize the effect using properties such as [EffectType](), [EnableShadowEffect](), and round the corners using [CornerRadius](). This approach improves visual depth and readability when SfAutocomplete is placed over images or colorful layouts. Additionally, the dropdown portion of SfAutocomplete applies the glass effect only when the [EnableLiquidGlassEffect]() property is set to true.
12+
The Liquid Glass Effect introduces a modern, translucent design with adaptive color tinting and light refraction, creating a sleek, glass like user experience that remains clear and accessible. This section explains how to enable and customize the effect in the Syncfusion® .NET MAUI Autocomplete (SfAutocomplete) control.
1313

14-
## Availability
14+
## Apply liquid glass effect
1515

16-
1. This feature is supported on .NET 10 or greater.
17-
2. This feature is supported on mac or iOS 26 or greater.
18-
3. On platforms or versions below these requirements, the control renders without the acrylic blur effect and falls back to a standard background.
16+
Follow these steps to enable and configure the Liquid Glass Effect in the Autocomplete control:
1917

20-
## Prerequisites
18+
### Step 1: Wrap the control inside glass effect view
2119

22-
- Add the Syncfusion.Maui.Core package (for SfGlassEffectView) and Syncfusion.Maui.Inputs (for SfAutocomplete).
20+
To apply the Liquid Glass Effect to Syncfusion® .NET MAUI `Autocomplete` control, wrap the control inside the `SfGlassEffectView` class.
2321

24-
XAML example Wrap the SfAutocomplete in an SfGlassEffectView, then enable the dropdown’s glass effect with `EnableLiquidGlassEffect`.
22+
For more details, refer to the `Liquid Glass Getting Started documentation`.
23+
24+
### Step 2: Enable the liquid glass effect on Autocomplete
25+
26+
Set the `EnableLiquidGlassEffect` property to `true` in the `SfAutocomplete` control to apply the Liquid Glass Effect. When enabled, the effect is also applied to its dependent controls and provides responsive interaction for a smooth and engaging user experience.
27+
28+
### Step 3: Customize the background
29+
30+
To achieve a glass like background in the Autocomplete, set the `Background` and `DropDownBackground` property to `Transparent`. The background will then be treated as a tinted color, ensuring a consistent glass effect across the controls.
31+
32+
The following code snippet demonstrates how to apply the Liquid Glass Effect to the `SfAutocomplete` control:
2533

2634
{% tabs %}
27-
{% highlight xaml hl_lines="19 22" %}
28-
29-
<?xml version="1.0" encoding="utf-8" ?>
30-
<ContentPage
31-
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
32-
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
33-
xmlns:inputs="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs"
34-
xmlns:core="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
35-
x:Class="AcrylicAutocompleteBoxPage">
36-
37-
<Grid>
38-
<!-- Background to make acrylic blur visible -->
39-
<Image Source="wallpaper.jpg" Aspect="AspectFill" />
40-
<core:SfGlassEffectView
41-
CornerRadius="20"
42-
HeightRequest="40"
43-
EffectType="Regular"
44-
EnableShadowEffect="True">
45-
46-
<inputs:SfAutocomplete
47-
EnableLiquidGlassEffect="True"
48-
Background="Transparent"
49-
ItemsSource="{Binding Employees}"
50-
DisplayMemberPath="Name"
51-
DropDownBackground="Transparent"
52-
Placeholder="Select employee"/>
53-
</core:SfGlassEffectView>
54-
</Grid>
55-
</ContentPage>
35+
{% highlight xaml tabtitle="MainPage.xaml" hl_lines="14 16 20" %}
36+
37+
<Grid BackgroundColor="Transparent">
38+
<core:SfGlassEffectView EffectType="Regular"
39+
CornerRadius="20">
40+
<Autocomplete:SfAutocomplete x:Name="Autocomplete"
41+
Background="Transparent"
42+
DropDownBackground="Transparent"
43+
EnableLiquidGlassEffect="True">
44+
</Autocomplete:SfAutocomplete>
45+
</core:SfGlassEffectView>
46+
</Grid>
5647

5748
{% endhighlight %}
58-
{% highlight c# hl_lines="14 17" %}
49+
{% highlight c# tabtitle="MainPage.xaml.cs" hl_lines="21 22 23 24 25 30" %}
5950

6051
using Syncfusion.Maui.Core;
6152
using Syncfusion.Maui.Inputs;
6253

63-
var glassEffects = new SfGlassEffectView
54+
var grid = new Grid
6455
{
65-
CornerRadius=20,
66-
HeightRequest=40,
67-
EffectType=LiquidGlassEffectType.Regular,
68-
EnableShadowEffect=True
56+
BackgroundColor = Colors.Transparent
57+
};
58+
59+
var glassView = new SfGlassEffectView
60+
{
61+
CornerRadius = 20,
62+
EffectType = LiquidGlassEffectType.Regular
6963
};
7064

7165
var Autocomplete = new SfAutocomplete
7266
{
73-
EnableLiquidGlassEffect = true, // Dropdown glass effect
74-
ItemsSource = viewModel.Employees,
75-
DisplayMemberPath = "Name",
76-
Background=Colors.Transparent,
77-
DropDownBackground= Colors.Transparent,
78-
Placeholder = "Select employee",
67+
Background = Colors.Transparent,
68+
EnableLiquidGlassEffect = true,
69+
DropDownBackground = Colors.Transparent
7970
};
8071

81-
glassEffects.Content = Autocomplete;
72+
glassView.Content = this.Autocomplete;
73+
grid.Children.Add(glassView);
74+
this.Content = grid;
8275

8376
{% endhighlight %}
8477
{% endtabs %}
8578

86-
87-
The following screenshot illustrates SfAutocomplete within an acrylic container, with the dropdown using the glass effect.
88-
89-
![Autocomplete editor with liquid glass support](Images/UICustomization/Autocomplete_liquidglass.png)
79+
N>
80+
* Supported on `macOS 26 or higher` and `iOS 26 or higher`.
81+
* This feature is available only in `.NET 10.`

0 commit comments

Comments
 (0)