SimpleButton.PressedIconColor Property
Gets or sets the icon color for the button in a pressed state. This is a bindable property.
Namespace: DevExpress.Maui.Controls
Assembly: DevExpress.Maui.Controls.dll
NuGet Package: DevExpress.Maui.Controls
Declaration
public Color PressedIconColor { get; set; }
Property Value
Type | Description |
---|---|
Color | The icon color. |
Remarks
The button gets a color for its icon from the applied theme. Use the PressedIconColor property to apply a custom color to the icon of the button in a pressed state. If you need the pressed button to display the icon in its original color, set the PressedIconColor property to {x:Static dxci:DXColor.Default}
:
<ContentPage ...
xmlns:dxci="clr-namespace:DevExpress.Utils;assembly=DevExpress.Maui.Core">
<dxco:SimpleButton ...
PressedIconColor="{x:Static dxci:DXColor.Default}"/>
</ContentPage>
To specify the icon color for the button in an unpressed state, use the IconColor property.
Example
This example shows how to customize button appearance and handle the button click event.
Button State | Default Appearance | Custom Appearance |
---|---|---|
Default | ||
Pressed | ||
Disabled |
Add the delete.png icon file to the Resources/Images folder.
Use the following properties to adjust the button’s appearance and handle the Clicked event to clear label1 on button tap:
<dxco:SimpleButton Text = "Clear" Icon = "delete" BorderThickness="2" BorderColor="Black" PressedBorderColor="DarkOrange" DisabledBorderColor="DarkGray" TextColor="Black" PressedTextColor="White" DisabledTextColor="DarkGray" IconColor="Black" PressedIconColor="White" DisabledIconColor="DarkGray" BackgroundColor="Beige" DisabledBackgroundColor="Brown" PressedBackgroundColor="Gray" CornerMode = "Round" CornerRadius="10" Clicked = "SimpleButton_Clicked"/>
private void SimpleButton_Clicked(object sender, EventArgs e) { label1.Text = ""; }