Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
246 changes: 245 additions & 1 deletion MAUI/Toolbar/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -1124,4 +1124,248 @@ public partial class MainPage : ContentPage

{% endtabs %}

![divider-line-customization](images/divider-customization.png)
![divider-line-customization](images/divider-customization.png)

## Corner Radius Customization

The toolbar control supports customizing its corners using the [CornerRadius]() property, allowing rounded or sharp edges to match your design preferences.

The following code sample demonstrates how to set the corner radius of the toolbar.

{% tabs %}

{% highlight xaml %}

<Grid>
<toolbar:SfToolbar x:Name="Toolbar"
HeightRequest="56"
WidthRequest="330"
CornerRadius="30">
<toolbar:SfToolbar.Items>
<toolbar:SfToolbarItem Name="Bold"
Text="Bold"
TextPosition="Right"
ToolTipText="Bold"
Size="90,40">
<toolbar:SfToolbarItem.Icon>
<FontImageSource Glyph="&#xE770;"
FontFamily="MauiMaterialAssets"/>
</toolbar:SfToolbarItem.Icon>
</toolbar:SfToolbarItem>
<toolbar:SfToolbarItem Name="Underline"
Text="Underline"
TextPosition="Right"
ToolTipText="Underline"
Size="90,40">
<toolbar:SfToolbarItem.Icon>
<FontImageSource Glyph="&#xE762;"
FontFamily="MauiMaterialAssets"/>
</toolbar:SfToolbarItem.Icon>
</toolbar:SfToolbarItem>
<toolbar:SfToolbarItem Name="Italic"
Text="Italic"
TextPosition="Right"
ToolTipText="Italic"
Size="90,40">
<toolbar:SfToolbarItem.Icon>
<FontImageSource Glyph="&#xE771;"
FontFamily="MauiMaterialAssets"/>
</toolbar:SfToolbarItem.Icon>
</toolbar:SfToolbarItem>
</toolbar:SfToolbar.Items>
</toolbar:SfToolbar>
</Grid>

{% endhighlight %}

{% highlight c# %}

public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
var grid = new Grid();

var toolbar = new SfToolbar
{
HeightRequest = 56,
WidthRequest = 330,
CornerRadius = 30
};

toolbar.Items = new ObservableCollection<BaseToolbarItem>
{
new SfToolbarItem
{
Name = "Bold",
Text = "Bold",
TextPosition = ToolbarItemTextPosition.Right,
ToolTipText = "Bold",
Size = new Size(90, 40),
Icon = new FontImageSource
{
Glyph = "\uE770",
FontFamily = "MauiMaterialAssets"
}
},
new SfToolbarItem
{
Name = "Underline",
Text = "Underline",
TextPosition = ToolbarItemTextPosition.Right,
ToolTipText = "Underline",
Size = new Size(90, 40),
Icon = new FontImageSource
{
Glyph = "\uE762",
FontFamily = "MauiMaterialAssets"
}
},
new SfToolbarItem
{
Name = "Italic",
Text = "Italic",
TextPosition = ToolbarItemTextPosition.Right,
ToolTipText = "Italic",
Size = new Size(90, 40),
Icon = new FontImageSource
{
Glyph = "\uE771",
FontFamily = "MauiMaterialAssets"
}
}
};

grid.Children.Add(toolbar);
Content = grid;
}
}

{% endhighlight %}

{% endtabs %}

![corner-radius](images/corner-radius.png)

## Selection Corner Radius Customization

The toolbar control supports customizing corners of the selection using the [SelectionCornerRadius]() property, allowing the corners of the selected item to be rounded or sharp based on your preference.

The following code sample demonstrates how to set the selection corner radius for toolbar items.

{% tabs %}

{% highlight xaml %}

<Grid>
<toolbar:SfToolbar x:Name="Toolbar"
HeightRequest="56"
WidthRequest="330"
SelectionCornerRadius="20">
<toolbar:SfToolbar.Items>
<toolbar:SfToolbarItem Name="Bold"
Text="Bold"
TextPosition="Right"
ToolTipText="Bold"
Size="90,40">
<toolbar:SfToolbarItem.Icon>
<FontImageSource Glyph="&#xE770;"
FontFamily="MauiMaterialAssets"/>
</toolbar:SfToolbarItem.Icon>
</toolbar:SfToolbarItem>
<toolbar:SfToolbarItem Name="Underline"
Text="Underline"
TextPosition="Right"
ToolTipText="Underline"
Size="90,40">
<toolbar:SfToolbarItem.Icon>
<FontImageSource Glyph="&#xE762;"
FontFamily="MauiMaterialAssets"/>
</toolbar:SfToolbarItem.Icon>
</toolbar:SfToolbarItem>
<toolbar:SfToolbarItem Name="Italic"
Text="Italic"
TextPosition="Right"
ToolTipText="Italic"
Size="90,40">
<toolbar:SfToolbarItem.Icon>
<FontImageSource Glyph="&#xE771;"
FontFamily="MauiMaterialAssets"/>
</toolbar:SfToolbarItem.Icon>
</toolbar:SfToolbarItem>
</toolbar:SfToolbar.Items>
</toolbar:SfToolbar>
</Grid>

{% endhighlight %}

{% highlight c# %}

public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
var grid = new Grid();

var toolbar = new SfToolbar
{
HeightRequest = 56,
WidthRequest = 330,
SelectionCornerRadius = 20
};

toolbar.Items = new ObservableCollection<BaseToolbarItem>
{
new SfToolbarItem
{
Name = "Bold",
Text = "Bold",
TextPosition = ToolbarItemTextPosition.Right,
ToolTipText = "Bold",
Size = new Size(90, 40),
Icon = new FontImageSource
{
Glyph = "\uE770",
FontFamily = "MauiMaterialAssets"
}
},
new SfToolbarItem
{
Name = "Underline",
Text = "Underline",
TextPosition = ToolbarItemTextPosition.Right,
ToolTipText = "Underline",
Size = new Size(90, 40),
Icon = new FontImageSource
{
Glyph = "\uE762",
FontFamily = "MauiMaterialAssets"
}
},
new SfToolbarItem
{
Name = "Italic",
Text = "Italic",
TextPosition = ToolbarItemTextPosition.Right,
ToolTipText = "Italic",
Size = new Size(90, 40),
Icon = new FontImageSource
{
Glyph = "\uE771",
FontFamily = "MauiMaterialAssets"
}
}
};

grid.Children.Add(toolbar);
Content = grid;
}
}

{% endhighlight %}

{% endtabs %}

![selection-corner-radius](images/selection-corner-radius.png)
Binary file added MAUI/Toolbar/images/corner-radius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added MAUI/Toolbar/images/selection-corner-radius.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions MAUI/Toolbar/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ control: Toolbar (SfToolbar)
documentation: ug
---

# Enable the Tooltip
# Enable Tooltip for Toolbar items

The tooltip is enabled in the view when the [TooltipText](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Toolbar.SfToolbarItem.html#Syncfusion_Maui_Toolbar_SfToolbarItem_ToolTipText) or [Text](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Toolbar.SfToolbarItem.html#Syncfusion_Maui_Toolbar_SfToolbarItem_Text) property is set for the ToolbarItems. By default, the tooltip is supported only in the default view.
The tooltip is enabled in the view when the [TooltipText](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Toolbar.SfToolbarItem.html#Syncfusion_Maui_Toolbar_SfToolbarItem_ToolTipText) or [Text](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Toolbar.SfToolbarItem.html#Syncfusion_Maui_Toolbar_SfToolbarItem_Text) property is set for the ToolbarItems.

## Tooltip Text

Expand Down