Skip to content
Open
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
8 changes: 4 additions & 4 deletions wpf/Button/Events.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
layout: post
title: Events in WPF Button | Syncfusion®
description: Events in ButtonAdv provide notifications for user interactions, command execution, and button state changes.
description: Events in WPF Button provide notifications for user interactions, command execution, and WPF Button state changes.
platform: wpf
control: ButtonAdv
documentation: ug
---

# Events in WPF Button (ButtonAdv)

The ButtonAdv comprises of the pre-defined events that are illustrated below.
The [WPF Button](https://www.syncfusion.com/wpf-controls/button) control includes the predefined events described below. The WPF Button is implemented through the [ButtonAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html) class.

## Click

The events occurs when the button control is clicked and any action can be handled in the respective event handler.
The `Click` event occurs when the WPF Button control is clicked. You can handle any action in the respective event handler.

{% tabs %}
{% highlight xaml %}
Expand All @@ -36,7 +36,7 @@ private void button_Click(object sender, RoutedEventArgs e)

## Checked

The event occurs when the button control is utilized as toggle button, that is, when [IsCheckable](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IsCheckable) property value is set to **true**. Any action can be handled in the respective event handler.
The `Checked` event occurs when the WPF Button control is used as a ToggleButton, that is, when the [IsCheckable](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IsCheckable) property is set to **true**. You can handle any action in the respective event handler.

{% tabs %}
{% highlight xaml %}
Expand Down
46 changes: 23 additions & 23 deletions wpf/Button/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ documentation: ug

# Getting Started with WPF Button (ButtonAdv)

This section provides an overview of how to work with [WPF Button](https://www.syncfusion.com/wpf-controls/button) control. It describes the control structure, the control initialization and the image setting to the control.
This section provides an overview of how to work with the [WPF Button](https://www.syncfusion.com/wpf-controls/button) control. It describes the control structure, initialization, and image settings. The WPF Button is implemented through the [ButtonAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html) class.

## Control structure

![Getting Started](Getting-Started_images/Getting-Started_img1.png)

## Assembly deployment

Refer [ButtonAdv](https://help.syncfusion.com/wpf/control-dependencies#buttonadv) control dependencies section to get the list of assemblies or [NuGet package](https://help.syncfusion.com/wpf/installation/install-nuget-packages) needs to be added as reference to use the ButtonAdv control in any application.
Refer to the [WPF Button](https://help.syncfusion.com/wpf/control-dependencies#buttonadv) control dependencies section for the list of assemblies or the [NuGet package](https://help.syncfusion.com/wpf/installation/install-nuget-packages) that needs to be added as a reference to use the ButtonAdv control in an application.

## Creating simple application with Button
## Creating simple application with WPF Button

In this walk through, will create WPF application that contains Button control. By the following ways, one can add the controls:
In this walkthrough, you will create a WPF application that contains the WPF Button control. You can add the control in the following ways:

1. [Adding control via designer](#adding-control-via-designer)

Expand All @@ -31,7 +31,7 @@ In this walk through, will create WPF application that contains Button control.

### Adding control via designer

WPF Button control can be added to the application by dragging **ButtonAdv** from toolbox and dropping it in designer view. After dropping the control in designer view, the assembly **Syncfusion.Shared.WPF** gets added into the project automatically. The following code snippets will also be added into the XAML.
You can add the WPF Button control to the application by dragging **ButtonAdv** from the toolbox and dropping it in the designer view. After you drop the control in the designer view, the **Syncfusion.Shared.WPF** assembly is added to the project automatically. The following code snippets are also added to the XAML.

{% tabs %}
{% highlight xaml %}
Expand All @@ -47,9 +47,9 @@ N> **syncfusion** in XAML is an auto generated namespace.

### Adding control manually in XAML

In order to add the control manually in XAML, follow the below steps.
To add the control manually in XAML, follow these steps.

1. Add the below required assembly reference to the project.
1. Add the following required assembly reference to the project.

* Syncfusion.Shared.WPF

Expand Down Expand Up @@ -80,9 +80,9 @@ In order to add the control manually in XAML, follow the below steps.

### Adding control manually in C#

In order to the add control manually in C#, do the below steps.
To add the control manually in C#, follow these steps.

1. Add the below required assembly reference to the project.
1. Add the following required assembly reference to the project.

* Syncfusion.Shared.WPF

Expand Down Expand Up @@ -133,7 +133,7 @@ using Syncfusion.Windows.Tools.Controls;

## Setting label

The label on the button is a text that explains its action to the end-user. Apply the text by using the [Label](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_Label) property.
The label on the WPF Button is text that explains its action to the end user. Set the text by using the [Label](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_Label) property.

{% tabs %}
{% highlight xaml %}
Expand All @@ -155,7 +155,7 @@ button.SmallIcon = new BitmapImage(new Uri("image/usersmall.png" , UriKind.Relat

## Setting size mode

Size mode is used to render button control in different pre-defined sizes based on application demand. Apply the size mode by setting the [SizeMode](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_SizeMode) property.
Size mode renders the WPF Button control in different predefined sizes based on application requirements. Set the size mode by using the [SizeMode](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_SizeMode) property.

The **SizeMode** is an enumeration which contains the following values:

Expand Down Expand Up @@ -187,7 +187,7 @@ button.SmallIcon = new BitmapImage(new Uri("image/usersmall.png", UriKind.Relati

### Normal mode

In a normal size button, a small image with the text on the side will be displayed.
In a normal-size WPF Button, a small image is displayed beside the text.

{% tabs %}
{% highlight xaml %}
Expand All @@ -209,7 +209,7 @@ button.SmallIcon = new BitmapImage(new Uri("image/usersmall.png", UriKind.Relati

### Large mode

In a large size button, a large image along with the text at the bottom will be displayed.
In a large-size WPF Button, a large image is displayed above the text.

{% tabs %}
{% highlight xaml %}
Expand All @@ -231,7 +231,7 @@ button.LargeIcon = new BitmapImage(new Uri("image/userlarge.png", UriKind.Relati

## Setting icon template

The [IconTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IconTemplate) property provides support for setting up any type of image such as path data, font icons, etc. to the ButtonAdv. The icon will automatically resize the template content according to its size provided in the data template.
The [IconTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IconTemplate) property supports image content such as path data and font icons in the ButtonAdv control. The icon automatically resizes the template content according to the size provided in the data template.

{% tabs %}

Expand Down Expand Up @@ -299,7 +299,7 @@ The [IconTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.C

## Setting icon template selector

The [IconTemplateSelector](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IconTemplateSelector) property that allows you to specify a different data template based on the value given in the data templates.
The [IconTemplateSelector](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IconTemplateSelector) property allows you to specify a different data template based on the value given in the data templates.

{% tabs %}

Expand Down Expand Up @@ -412,12 +412,12 @@ The [IconTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.C

## Setting image

The image option helps to provide pictorial representation of the button. Image can be added either using the [SmallIcon](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_SmallIcon) property or [LargeIcon](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_LargeIcon) property.
The image option provides a pictorial representation of the WPF Button. You can add an image by using either the [SmallIcon](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_SmallIcon) property or the [LargeIcon](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_LargeIcon) property.

**SmallIcon** — This property will be used to set the image when size mode is **Normal** or **Small**.
**LargeIcon** — This property will be used to set the image when size mode is **Large**.

The **SmallIcon** property can be set as follows:
You can set the **SmallIcon** property as follows:

{% tabs %}
{% highlight xaml %}
Expand Down Expand Up @@ -456,7 +456,7 @@ button.SmallIcon = new BitmapImage(new Uri("image/syncfusion.png", UriKind.Relat

![Normal-Image](Getting-Started_images/Getting-Started_img7.png)

The **LargeIcon** property can be set as follows:
You can set the **LargeIcon** property as follows:

{% tabs %}
{% highlight xaml %}
Expand Down Expand Up @@ -522,7 +522,7 @@ N> View [sample](https://github.com/SyncfusionExamples/wpf-button-examples/blob/

## Setting corner radius

The `CornerRadius` property allows users to easily customize the appearance of buttons to have rounded corners. The default value of corner radius is 3.
The `CornerRadius` property allows users to customize the appearance of buttons with rounded corners. The default value of the `CornerRadius` property is `3`.

{% tabs %}

Expand All @@ -545,11 +545,11 @@ button.SmallIcon = new BitmapImage(new Uri("image/syncfusion.png", UriKind.Relat

{% endtabs %}

![Corner Radius in ButtonAdv](Getting-Started_images/Getting-Started_CornerRadius.png)
![Corner Radius in WPF Button](Getting-Started_images/Getting-Started_CornerRadius.png)

## IsDefault mode

The [IsDefault](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IsDefault) property indicates whether the ButtonAdv is a Default button and is used to activate the ButtonAdv by pressing using Enter key. When setting the IsDefault property to true, the user can invoke the button by pressing the `Enter` key.
The [IsDefault](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IsDefault) property indicates whether the WPF Button is a default button that can be activated by pressing the Enter key. When you set the `IsDefault` property to `true`, the user can invoke the Button by pressing the `Enter` key.

{% tabs %}

Expand All @@ -563,7 +563,7 @@ The [IsDefault](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Cont

## IsCancel mode

The [IsCancel](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IsCancel) property indicates whether the ButtonAdv is a Cancel button and is used to activate the button by using Escape key. When setting the IsCancel property to true, the user can invoke the button by pressing the `Escape` key.
The [IsCancel](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IsCancel) property indicates whether the WPF Button is a cancel button that can be activated by pressing the Escape key. When you set the `IsCancel` property to `true`, the user can invoke the Button by pressing the `Escape` key.

{% tabs %}

Expand All @@ -577,7 +577,7 @@ The [IsCancel](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Contr

## Theme

WPF Button supports various built-in themes. Refer to the below links to apply themes for the Button,
The WPF Button supports various built-in themes. Refer to the following links to apply themes to the Button:

* [Apply theme using SfSkinManager](https://help.syncfusion.com/wpf/themes/skin-manager)

Expand Down
10 changes: 5 additions & 5 deletions wpf/Button/MVVM.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
layout: post
title: MVVM in WPF Button | Syncfusion®
description: MVVM support in Button (ButtonAdv) enables seamless integration with commands, bindings, and view models.
description: MVVM support in WPF Button (ButtonAdv) enables seamless integration with commands, bindings, and view models.
platform: wpf
control: ButtonAdv
documentation: ug
---

# MVVM in WPF Button (ButtonAdv)

The command and command parameter properties allow to execute any action on clicking the button control.
The [WPF Button](https://www.syncfusion.com/wpf-controls/button) control supports command and command parameter properties that allow you to execute an action when it is clicked. The WPF Button is implemented through the [ButtonAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html) class.

* **Command** - The [Command](https://learn.microsoft.com/en-us/dotnet/api/system.windows.input.icommandsource.command?view=netframework-4.8) property accept all commands derived from interface [ICommand](https://learn.microsoft.com/en-us/dotnet/api/system.windows.input.icommand?view=netframework-4.8).
* **CommandParameter** - The [CommandParameter](https://learn.microsoft.com/en-us/dotnet/api/system.windows.input.icommandsource.commandparameter?view=netframework-4.8) property allows the user to provide additional data required in the command handler in-order to perform any operation.
* **Command** - The [Command](https://learn.microsoft.com/en-us/dotnet/api/system.windows.input.icommandsource.command?view=netframework-4.8) property accepts all commands derived from the [ICommand](https://learn.microsoft.com/en-us/dotnet/api/system.windows.input.icommand?view=netframework-4.8) interface.
* **CommandParameter** - The [CommandParameter](https://learn.microsoft.com/en-us/dotnet/api/system.windows.input.icommandsource.commandparameter?view=netframework-4.8) property allows the user to provide additional data required by the command handler to perform an operation.

{% tabs %}
{% highlight xaml %}
Expand Down Expand Up @@ -168,4 +168,4 @@ public class ButtonViewModel : NotificationObject
{% endhighlight %}
{% endtabs %}

N> View [sample](https://github.com/SyncfusionExamples/wpf-button-examples/blob/master/Samples/MVVM) in GitHub. This sample showcases how to bind commands to the `ButtonAdv` control.
N> View [sample](https://github.com/SyncfusionExamples/wpf-button-examples/blob/master/Samples/MVVM) in GitHub. This sample showcases how to bind commands to the WPF Button control.
8 changes: 4 additions & 4 deletions wpf/Button/Multiline-Text-Support.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
layout: post
title: Multiline Text Support in WPF Button | Syncfusion®
description: Multiline text support in Button (ButtonAdv) enables displaying button content across multiple lines.
description: Multiline text support in WPF Button (ButtonAdv) enables displaying Button content across multiple lines.
platform: wpf
control: ButtonAdv
documentation: ug
---

# Multiline Text in WPF Button (ButtonAdv)

Multiline support is used to render text content of the Button control in multiple lines for precise view. One can apply the multiline text by using the [IsMultiLine](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IsMultiLine) property.
The [WPF Button](https://www.syncfusion.com/wpf-controls/button) control supports rendering text across multiple lines. The WPF Button is implemented through the [ButtonAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html) class. You can enable multiline text by using the [IsMultiLine](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html#Syncfusion_Windows_Tools_Controls_ButtonAdv_IsMultiLine) property.

N> This property is only applicable for large size mode button.
N> This property is applicable only when the WPF Button is in large size mode.

{% tabs %}
{% highlight XAML %}
Expand All @@ -30,4 +30,4 @@ button.Label = "Sign in with your Syncfusion Account";
{% endhighlight %}
{% endtabs %}

![WPF ButtonAdv MultiLine](Multi-Line-Support_images/Multi-Line-Support_img1.png)
![WPF Button MultiLine](Multi-Line-Support_images/Multi-Line-Support_img1.png)
10 changes: 5 additions & 5 deletions wpf/Button/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ documentation: ug

# About Syncfusion® WPF Button (ButtonAdv) Control

The Button (or ButtonAdv) is a basic button control with image options and multi-line support which is used to design complex forms and applications. The control is shipped with a commanding support that provides compatibility in MVVM design pattern by attaching commands to the control, which will get executed when it gets clicked.
The [WPF Button](https://www.syncfusion.com/wpf-controls/button) control (or ButtonAdv) is a basic button control with image options and multiline support for designing complex forms and applications. The control provides command support for the MVVM design pattern by allowing commands to be attached to the control and executed when it is clicked. The WPF Button is implemented through the [ButtonAdv](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ButtonAdv.html) class.

## Key features

* **Size Mode** - Predefined sizes, such as small, normal and large, can be set to the button.
* **Size Mode** - Predefined sizes, such as small, normal, and large, can be set for the WPF Button.

* **Image** - Provides options for loading image in button.
* **Image** - Provides options for loading an image in the WPF Button.

* **Command Binding** - Provides support to execute any action on clicking the instance.

* **Multiline** - Provides support for displaying multiple lines of text in large button.
* **Multiline** - Provides support for displaying multiple lines of text in a large WPF Button.

* **Checkable** - Provides support for clicking the button that looks like the toggle button.
* **Checkable** - Provides support for using the WPF Button as a ToggleButton.

* **Localization** - Provides support to customize the text in the user interface based on the local culture.

Expand Down
Loading