diff --git a/MAUI/ImageEditor/liquid-glass-effect.md b/MAUI/ImageEditor/liquid-glass-effect.md index 83c4eda53..701e3158c 100644 --- a/MAUI/ImageEditor/liquid-glass-effect.md +++ b/MAUI/ImageEditor/liquid-glass-effect.md @@ -32,58 +32,90 @@ To achieve a glass like background in the Image Editor and its Toolbar control, The following code snippet demonstrates how to apply the Liquid Glass Effect to the [SfImageEditor](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.ImageEditor.SfImageEditor.html) control: {% tabs %} -{% highlight xaml tabtitle="MainPage.xaml" hl_lines="14 16 20" %} - - - - - - - - - +{% highlight xaml tabtitle="MainPage.xaml" hl_lines="14 15 17 20 22 26" %} + + + + + + + + + + + + + + + + + + {% endhighlight %} -{% highlight c# tabtitle="MainPage.xaml.cs" hl_lines="21 22 23 24 25 30" %} +{% highlight c# tabtitle="MainPage.xaml.cs" hl_lines="26 27 28 29 30 34 37 43 44" %} using Syncfusion.Maui.Core; using Syncfusion.Maui.ImageEditor; -var grid = new Grid +var gradientBrush = new LinearGradientBrush { - BackgroundColor = Colors.Transparent + StartPoint = new Point(0, 0), + EndPoint = new Point(0, 1), + GradientStops = + { + new GradientStop { Color = Color.FromArgb("#0F4C75"), Offset = 0.0 }, + new GradientStop { Color = Color.FromArgb("#3282B8"), Offset = 0.5 }, + new GradientStop { Color = Color.FromArgb("#1B262C"), Offset = 1.0 } + } +}; + +// Main grid with background +var mainGrid = new Grid +{ + Background = gradientBrush }; -var glassView = new SfGlassEffectView +// Inner grid +var innerGrid = new Grid(); + +// Glass effect view +var glassEffectView = new SfGlassEffectView { - CornerRadius = 20, - EffectType = LiquidGlassEffectType.Regular + EffectType = LiquidGlassEffectType.Regular, + CornerRadius = 20 }; var imageEditor = new SfImageEditor { Background = Colors.Transparent, - EnableLiquidGlassEffect = true, SelectionStroke = Color.FromArgb("#AE97FF"), - Source = ImageSource.FromFile("editorimage.png"), - EnableLiquidGlassEffect = true, - ToolbarSettings = new ImageEditorToolbarSettings - { - Background = Colors.Transparent, - Stroke = Colors.Transparent - } + Source = "dotnet_bot.png", + EnableLiquidGlassEffect = true +}; + +// Toolbar settings +imageEditor.ToolbarSettings = new ImageEditorToolbarSettings +{ + Background = Colors.Transparent, + Stroke = Colors.Transparent }; -glassView.Content = this.imageEditor; -grid.Children.Add(glassView); -this.Content = grid; +glassEffectView.Content = imageEditor; +innerGrid.Children.Add(glassEffectView); +mainGrid.Children.Add(innerGrid); +this.Content = mainGrid; {% endhighlight %} {% endtabs %} diff --git a/MAUI/Kanban-Board/liquid-glass-effect.md b/MAUI/Kanban-Board/liquid-glass-effect.md index 3c4a74f51..d0dac692c 100644 --- a/MAUI/Kanban-Board/liquid-glass-effect.md +++ b/MAUI/Kanban-Board/liquid-glass-effect.md @@ -32,66 +32,99 @@ To achieve a glass like background in the Kanban control, set its `Background` p The following code snippet demonstrates how to apply the Liquid Glass Effect to the [Kanban](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Kanban.SfKanban.html) control: {% tabs %} -{% highlight xaml tabtitle="MainPage.xaml" hl_lines="8" %} - - - - - - - - - - - - - - - +{% highlight xaml tabtitle="MainPage.xaml" hl_lines="14 15 17 20 35" %} + + + + + + + + + + + + + + + + + + + + + + + + {% endhighlight %} -{% highlight c# tabtitle="MainPage.xaml.cs" hl_lines="8 22 23 24 25 26" %} +{% highlight c# tabtitle="MainPage.xaml.cs" hl_lines="26 27 28 29 30 35 37" %} using Syncfusion.Maui.Kanban; using Syncfusion.Maui.Core; -var kanban = new SfKanban +var gradientBrush = new LinearGradientBrush { - Background = Colors.Transparent, - AutoGenerateColumns = false, - EnableLiquidGlassEffect = true, - BindingContext = new KanbanViewModel() + StartPoint = new Point(0, 0), + EndPoint = new Point(0, 1), + GradientStops = + { + new GradientStop { Color = Color.FromArgb("#0F4C75"), Offset = 0.0 }, + new GradientStop { Color = Color.FromArgb("#3282B8"), Offset = 0.5 }, + new GradientStop { Color = Color.FromArgb("#1B262C"), Offset = 1.0 } + } +}; + +// Main grid with background +var mainGrid = new Grid +{ + Background = gradientBrush }; -kanban.Columns.Add(new KanbanColumn { Title = "To Do", Categories = new List { "Open" } }); -kanban.Columns.Add(new KanbanColumn { Title = "In Progress", Categories = new List { "In Progress" } }); -kanban.Columns.Add(new KanbanColumn { Title = "Code Review", Categories = new List { "Code Review" } }); -kanban.Columns.Add(new KanbanColumn { Title = "Done", Categories = new List { "Done" } }); +// Inner grid +var innerGrid = new Grid(); -var grid = new Grid +// Glass effect view +var glassEffectView = new SfGlassEffectView { - BackgroundColor = Colors.Transparent + EffectType = LiquidGlassEffectType.Clear, + CornerRadius = 7 }; -var glassView = new SfGlassEffectView +// Kanban control +var kanban = new SfKanban { - CornerRadius = 7, - EffectType = LiquidGlassEffectType.Clear + Background = Colors.Transparent, + AutoGenerateColumns = false, + EnableLiquidGlassEffect = true, + BindingContext = new KanbanViewModel() }; -glassView.Content = this.kanban; -grid.Children.Add(glassView); -this.Content = grid; +// Define columns +kanban.Columns.Add(new KanbanColumn { Title = "To Do", Categories = { "Open" } }); +kanban.Columns.Add(new KanbanColumn { Title = "In Progress", Categories = { "In Progress" } }); +kanban.Columns.Add(new KanbanColumn { Title = "Code Review", Categories = { "Code Review" } }); +kanban.Columns.Add(new KanbanColumn { Title = "Done", Categories = { "Done" } }); + +glassEffectView.Content = kanban; +innerGrid.Children.Add(glassEffectView); +mainGrid.Children.Add(innerGrid); +this.Content = mainGrid; {% endhighlight %} {% highlight C# tabtitle="KanbanViewModel.cs" %}