From 2137fb7370f96ae16cc8d766aec35af4bf080032 Mon Sep 17 00:00:00 2001 From: harinath-2699 Date: Thu, 13 Aug 2026 17:19:53 +0530 Subject: [PATCH 1/9] UG doc changes for WPF CheckListBox, CurrencyTextBox and Tabbed-MDI-Form --- wpf/CheckedListBox/Appearance.md | 31 +-- wpf/CheckedListBox/Check-items.md | 29 +-- .../Check-or-Uncheck-all-item.md | 2 +- wpf/CheckedListBox/Data-Binding.md | 7 +- wpf/CheckedListBox/Getting-Started.md | 15 +- wpf/CheckedListBox/Grouping.md | 13 +- ...he-item-in-checklistbox-when-initiating.md | 5 +- wpf/CheckedListBox/Item-Selection.md | 6 +- wpf/CheckedListBox/Layout-Related-Features.md | 18 +- wpf/CheckedListBox/Sorting.md | 5 +- wpf/CheckedListBox/Virtualization.md | 4 +- wpf/Currency-TextBox/Appearance.md | 20 +- .../Changing-Currency-Value.md | 28 ++- .../Culture-and-Number-Formats.md | 57 +++-- wpf/Currency-TextBox/Getting-Started.md | 32 ++- wpf/Currency-TextBox/Overview.md | 26 ++- wpf/Currency-TextBox/Range-Adorner.md | 16 +- .../Restriction-or-Validation.md | 35 +-- wpf/Currency-TextBox/Step-Interval.md | 24 ++- ...ems-from-the-Document-Container-Control.md | 43 ++-- wpf/Tabbed-MDI-Form/Creating-Tab-Groups.md | 42 ++-- ...in-DockingManager-and-DocumentContainer.md | 23 +- .../Full-Screen-in-DocumentContainer.md | 158 ++++++++------ wpf/Tabbed-MDI-Form/Getting-Started.md | 73 ++++--- .../Layout-Related-Features.md | 18 +- wpf/Tabbed-MDI-Form/Localization.md | 134 +++++------- wpf/Tabbed-MDI-Form/MDI-Resize.md | 40 ++-- wpf/Tabbed-MDI-Form/Maximizing-MDI-window.md | 33 ++- wpf/Tabbed-MDI-Form/Minimizing-MDI-window.md | 33 ++- wpf/Tabbed-MDI-Form/Overview.md | 32 ++- wpf/Tabbed-MDI-Form/Pin-Unpin-tabs.md | 70 ++++-- ...etting-Header-of-the-Document-container.md | 52 +++-- wpf/Tabbed-MDI-Form/Setting-MDIBounds.md | 61 +++--- .../Setting-Mode-for-Document-Container.md | 84 ++++---- wpf/Tabbed-MDI-Form/Setting-Window-State.md | 102 +++++---- .../Setting-Window-Switchers.md | 62 +++--- wpf/Tabbed-MDI-Form/State-Persistence.md | 202 +++++++----------- 37 files changed, 945 insertions(+), 690 deletions(-) diff --git a/wpf/CheckedListBox/Appearance.md b/wpf/CheckedListBox/Appearance.md index bd5af24b6d..63a7223000 100644 --- a/wpf/CheckedListBox/Appearance.md +++ b/wpf/CheckedListBox/Appearance.md @@ -13,7 +13,7 @@ This section explains different UI customization, styling, theming options avail ## Setting the Foreground -We can change the foreground color of `CheckListBox` items by setting the `Foreground` property. The default color value of `Foreground` property is `Black`. +You can change the foreground color of `CheckListBox` items by setting the `Foreground` property. The default value of the `Foreground` property is `Black`. {% tabs %} {% highlight xaml %} @@ -47,7 +47,7 @@ checkListBox.Foreground=Brushes.Red; ### Setting the Background - We can change the background color of `CheckListBox` items by setting the `Background` property. If we want to differentiate mouse hovered item or currently selected item with other items, we can do this by using [MouseOverBackground](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_MouseOverBackground) and [SelectedItemBackground](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_SelectedItemBackground) properties. + You can change the background color of `CheckListBox` items by setting the `Background` property. To distinguish a hovered item or a currently selected item from other items, you can use the [MouseOverBackground](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_MouseOverBackground) and [SelectedItemBackground](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_SelectedItemBackground) properties. {% tabs %} {% highlight xaml %} @@ -85,7 +85,7 @@ checkListBox.SelectedItemBackground = Brushes.Yellow; ## Change flow direction -We can change the flow direction of the `CheckListBox` layout from right to left by setting the `FlowDirection` property value as `RightToLeft`. The Default value of `FlowDirection` property is `LeftToRight`. +You can change the flow direction of the `CheckListBox` layout from right to left by setting the `FlowDirection` property to `RightToLeft`. The default value of the `FlowDirection` property is `LeftToRight`. {% tabs %} {% highlight xaml %} @@ -121,7 +121,7 @@ N> [View Sample in GitHub](https://github.com/SyncfusionExamples/wpf-checked-lis ## Item Template -We change the `DataTemplate` of the each `CheckListBox` items by using the `ItemTemplate` property. +You can change the `DataTemplate` of each `CheckListBox` item by using the `ItemTemplate` property. {% tabs %} {% highlight C# %} @@ -183,20 +183,20 @@ class ViewModel { ## Group Template -We change the `DataTemplate` of the group header items by using the `GroupTemplate` property. +You can change the `DataTemplate` of the group header items by using the `GroupTemplate` property. {% tabs %} {% highlight C# %} //Model.cs -class Vegetable { +public class Vegetable { public string Category { get; set; } public int Price { get; set; } public string Name { get; set; } } //ViewModel.cs -class ViewModel { +public class ViewModel { public ObservableCollection Vegetables { get; set; } public ICommand LoadedCommand { get; set; } public void OnLoaded(object param) { @@ -224,6 +224,13 @@ class ViewModel { } } +// Required usings: +// using System.Collections.ObjectModel; +// using System.ComponentModel; +// using System.Windows.Data; +// using System.Windows.Input; +// using Syncfusion.Windows.Shared; (for DelegateCommand) + {% endhighlight %} {% endtabs %} @@ -260,7 +267,7 @@ class ViewModel { ## SelectAll Template -We change the `DataTemplate` of the `SelectAll` item by using the `SelectAllTemplate` property. +You can change the `DataTemplate` of the `SelectAll` item by using the `SelectAllTemplate` property. {% tabs %} {% highlight C# %} @@ -324,7 +331,7 @@ N> [View Sample in GitHub](https://github.com/SyncfusionExamples/wpf-checked-lis ## ItemContainerStyle -We can change the item container style of `CheckListBox` by using the `ItemContainerStyle` which is applied to the container element that generated for each item. The default value of `ItemContainerStyle` is null. +You can change the item container style of `CheckListBox` by using the `ItemContainerStyle`, which is applied to the container element that is generated for each item. The default value of `ItemContainerStyle` is `null`. {% tabs %} {% highlight C# %} @@ -376,13 +383,13 @@ class ViewModel { ![CheckListBox with ItemContainerStyle](Appearance_images/ItemContainerStyle.png) -Here, the Checked items are contains a bold font. +Here, the checked items are styled with a bold font. N> [View Sample in GitHub](https://github.com/SyncfusionExamples/wpf-checked-listbox-examples/tree/master/Samples/ItemContainerStyle) ## ItemTemplateSelector -We can change the various `DataTemplate` for the `CheckListBox` items based on the provided logic by using the `ItemTemplateSelector`. +You can change the `DataTemplate` for `CheckListBox` items based on the provided logic by using the `ItemTemplateSelector`. {% tabs %} {% highlight C# %} @@ -481,7 +488,7 @@ N> [View Sample in GitHub](https://github.com/SyncfusionExamples/wpf-checked-lis ## ItemContainerStyleSelection -We can choose the style for the `CheckListBox` items based on the provided logic by using the `ItemContainerStyleSelector`. +You can choose the style for `CheckListBox` items based on the provided logic by using the `ItemContainerStyleSelector`. {% tabs %} {% highlight C# %} diff --git a/wpf/CheckedListBox/Check-items.md b/wpf/CheckedListBox/Check-items.md index 2c268e9b87..5d148aec6c 100644 --- a/wpf/CheckedListBox/Check-items.md +++ b/wpf/CheckedListBox/Check-items.md @@ -9,20 +9,20 @@ documentation: ug # Check Items in WPF CheckedListBox (CheckListBox) -In [CheckListBox](https://www.syncfusion.com/wpf-controls/checkedlistbox), items present in the control can be checked or unchecked either by using any one of the following ways: +In [CheckListBox](https://www.syncfusion.com/wpf-controls/checkedlistbox), items present in the control can be checked or unchecked in any of the following ways: -1. Using Collection -2. Using Property -3. Using Mouse -4. Using Keyboard +1. Programmatically, using the `SelectedItems` collection +2. Programmatically, by binding the `IsChecked` property +3. Using the mouse +4. Using the keyboard ## Check items programmatically -You can check or uncheck the items by using collection or property. +You can check or uncheck the items by using either a collection or a property. ### Check items using Collection -We can check or uncheck the particular item by add or remove that items into the [SelectedItems](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_SelectedItems) collection. +You can check or uncheck a particular item by adding or removing that item from the [SelectedItems](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_SelectedItems) collection. {% tabs %} {% highlight C#%} @@ -111,7 +111,7 @@ Click [here](https://github.com/SyncfusionExamples/wpf-checked-listbox-examples/ ### Check items using Property -We can change the item’s checked state by using the [CheckListBoxItem.IsChecked](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBoxItem.html#Syncfusion_Windows_Tools_Controls_CheckListBoxItem_IsChecked) property bounded with any boolean property. There is limitation when using this approach. During virtualization, views will not be loaded, so it does not know the bounded value of `CheckListBoxItem.IsChecked` property. Hence, `SelectedItems` will not be in synchronized. However we can turnoff virtualization if you want both selected items to be in sync with bounded boolean property. +We can change the item’s checked state by using the [CheckListBoxItem.IsChecked](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBoxItem.html#Syncfusion_Windows_Tools_Controls_CheckListBoxItem_IsChecked) property bound to any boolean property. There is a limitation when using this approach. During virtualization, views are not loaded, so the bound value of the `CheckListBoxItem.IsChecked` property is not known. Hence, `SelectedItems` will not be synchronized. However, we can turn off virtualization if you want both the selected items and the bound boolean property to be in sync. {% tabs %} {% highlight C#%} @@ -212,13 +212,18 @@ public class ViewModel : NotificationObject { {%endhighlight%} {% endtabs %} +N> The `i:` namespace refers to `http://schemas.microsoft.com/expression/2010/interactivity` and requires a reference to the `System.Windows.Interactivity` assembly. Add the following namespace declaration to the root element of your XAML: +`xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"` + +N> When binding `IsChecked` directly to a model property, virtualization must be disabled so that the bound value and `SelectedItems` stay synchronized. For details, see [Virtualization](Virtualization.md). + ![CheckListBox items checked using IsChecked property](item-Selection_images/CheckedItems_property.png) Click [here](https://github.com/SyncfusionExamples/wpf-checked-listbox-examples/tree/master/Samples/CheckItem-By-Property) to download the sample that showcases check the items by using the `IsChecked` property. ## Check items using Mouse -The `CheckListBox` items can be checked or unchecked in a single click either by clicking the `CheckBox` or clicking the content of the item. We can check or uncheck a `GroupHeader` or `SelectAll` item to check or uncheck a group of items or all items. By default, the items are checked or unchecked by the single mouse click. If we want to check or uncheck the items only on mouse double click use the [IsCheckOnFirstClick](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_IsCheckOnFirstClick) property as `false`. +The `CheckListBox` items can be checked or unchecked with a single click, either by clicking the `CheckBox` or by clicking the content of the item. You can check or uncheck a `GroupHeader` or `SelectAll` item to check or uncheck a group of items or all items. By default, the items are checked or unchecked with a single mouse click. If you want to check or uncheck the items only on a mouse double-click, set the [IsCheckOnFirstClick](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_IsCheckOnFirstClick) property to `false`. {% tabs %} {% highlight C#%} @@ -265,7 +270,7 @@ checkListBox.ItemsSource = (checkListBox.DataContext as ViewModel).DaysCollectio ## Check items using Keyboard -`Space bar` key allows the users to check or uncheck the selected item. By default, the selecteditem is checked or unchecked by the single `Space bar` key press. If we want to check or uncheck the items only on double `Space bar` key press use the `IsCheckOnFirstClick` property as `false`. We can check or uncheck a `GroupHeader` or `SelectAll` item to check or uncheck a group of items or all items +The `Space bar` key allows the user to check or uncheck the selected item. By default, the selected item is checked or unchecked with a single `Space bar` key press. If you want to check or uncheck the items only on a double `Space bar` key press, set the `IsCheckOnFirstClick` property to `false`. We can check or uncheck a `GroupHeader` or `SelectAll` item to check or uncheck a group of items or all items. {% tabs %} {% highlight C#%} @@ -314,7 +319,7 @@ Based on the checked state of a `GroupHeader` and `SelectAll` item, their corres ## Checked state changed notification -When the checked state of an item is changed, it will be notified by using the [ItemChecked](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html) event. You can get the details about the checked item in [ItemCheckedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ItemCheckedEventArgs.html). +When the checked state of an item is changed, the [ItemChecked](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html) event is raised. You can get the details about the checked item in [ItemCheckedEventArgs](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.ItemCheckedEventArgs.html). {% tabs %} {% highlight XAML %} @@ -348,7 +353,7 @@ private void CheckListBox_ItemChecked(object sender, ItemCheckedEventArgs e) ## Selection changed notification -When the selected item is changed, it will be notified by using the [SelectionChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html) event.The [SelectionChangedEventArgs](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.selectionchangedeventargs?redirectedfrom=MSDN&view=netframework-4.8) has the following members that provides information for the `SelectionChanged` event: +When the selected item is changed, the [SelectionChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html) event is raised. The [SelectionChangedEventArgs](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.selectionchangedeventargs?redirectedfrom=MSDN&view=netframework-4.8) has the following members that provide information for the `SelectionChanged` event: * **Added items** : Gets a collection of the underlying data objects in which the selection has to be processed. diff --git a/wpf/CheckedListBox/Check-or-Uncheck-all-item.md b/wpf/CheckedListBox/Check-or-Uncheck-all-item.md index 507642ca50..8cacb7d809 100644 --- a/wpf/CheckedListBox/Check-or-Uncheck-all-item.md +++ b/wpf/CheckedListBox/Check-or-Uncheck-all-item.md @@ -9,7 +9,7 @@ documentation: ug # Check or uncheck all items in WPF CheckedListBox (CheckListBox) -The [CheckListBox](https://www.syncfusion.com/wpf-ui-controls/CheckedListBox) allows the users to check or uncheck all the items by a single click on the `SelectAll` option. The `SelectAll` option can be enabled or disabled using the [IsSelectAllEnabled](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_IsSelectAllEnabled) property. Selection mode of the `SelectAll` item varies based on the checked state of the `CheckListBox` items. Initially, the `SelectAll` is unchecked because of no item is checked. It is checked only on when all items are checked, otherwise it is in intermediate state. +The [CheckListBox](https://www.syncfusion.com/wpf-ui-controls/CheckedListBox) allows users to check or uncheck all the items with a single click on the `SelectAll` option. The `SelectAll` option can be enabled or disabled using the [IsSelectAllEnabled](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_IsSelectAllEnabled) property. The selection state of the `SelectAll` item varies based on the checked state of the `CheckListBox` items. Initially, `SelectAll` is unchecked because no items are checked. It is checked only when all items are checked; otherwise, it is in an intermediate state. {% tabs %} {%highlight C#%} diff --git a/wpf/CheckedListBox/Data-Binding.md b/wpf/CheckedListBox/Data-Binding.md index d009c89a37..dd8172ae00 100644 --- a/wpf/CheckedListBox/Data-Binding.md +++ b/wpf/CheckedListBox/Data-Binding.md @@ -9,7 +9,7 @@ documentation: ug # Data Binding in WPF CheckListBox control -The control can be populated using [ItemsSource](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.itemscontrol.itemssource?view=netframework-4.7.2) property and [DisplayMemberPath](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.itemscontrol.displaymemberpath?view=netframework-4.7.2#System_Windows_Controls_ItemsControl_DisplayMemberPath) property used to display the items and IsSelected property used to handle the selection in the CheckListBox. The below code snippet will be used to bind the ItemsSource to the CheckListBox. +The control can be populated using the [ItemsSource](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.itemscontrol.itemssource?view=netframework-4.7.2) property, and the [DisplayMemberPath](https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.itemscontrol.displaymemberpath?view=netframework-4.7.2#System_Windows_Controls_ItemsControl_DisplayMemberPath) property is used to specify which property to display for each data item. The `IsSelected` property is used to handle the selection in the CheckListBox. The following code snippet demonstrates how to bind the `ItemsSource` to the CheckListBox. {% tabs %} {%highlight xaml%} @@ -17,7 +17,7 @@ The control can be populated using [ItemsSource](https://learn.microsoft.com/en- @@ -26,6 +26,9 @@ The control can be populated using [ItemsSource](https://learn.microsoft.com/en- {%highlight c#%} +using System.Collections.ObjectModel; +using System.ComponentModel; + public class ViewModel : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; diff --git a/wpf/CheckedListBox/Getting-Started.md b/wpf/CheckedListBox/Getting-Started.md index 70fef58097..0ddf6df1bf 100644 --- a/wpf/CheckedListBox/Getting-Started.md +++ b/wpf/CheckedListBox/Getting-Started.md @@ -20,15 +20,15 @@ Refer to the [control dependencies](https://help.syncfusion.com/wpf/control-depe Further information on installing the NuGet package can be found in the following link: [How to install nuget packages](https://help.syncfusion.com/wpf/visual-studio-integration/nuget-packages). -You can also use the [Syncfusion Reference Manager](https://help.syncfusion.com/wpf/visual-studio-integration/visual-studio-extensions/add-references) to refer the CheckListBox's dependent assemblies. +You can also use the [Syncfusion Reference Manager](https://help.syncfusion.com/wpf/visual-studio-integration/visual-studio-extensions/add-references) to refer to the CheckListBox's dependent assemblies. ## Creating simple application with CheckListBox control -In this walk through, the user will create a WPF application that contains the [CheckListBox](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html) control. +In this walkthrough, you will create a WPF application that contains the [CheckListBox](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html) control. ## Creating project -In Visual Studio, create a new WPF project to show the features of the [CheckListBox](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html) control and add the following namespace to the added assemblies. +In Visual Studio, create a new WPF project to show the features of the [CheckListBox](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html) control, and then add the following namespace to the referenced assemblies. ## Adding control via designer @@ -59,7 +59,7 @@ To add the WPF [CheckListBox](https://help.syncfusion.com/cr/wpf/Syncfusion.Wind xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:local="clr-namespace:GettingStartedComboBox" + xmlns:local="clr-namespace:GettingStarted" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="GettingStarted.MainWindow" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> @@ -95,7 +95,8 @@ To add the `CheckListBox` control manually in C#, follow these steps, using System.Windows; using Syncfusion.Windows.Tools.Controls; -namespace ComboBox + +namespace GettingStarted { /// /// Interaction logic for MainWindow.xaml @@ -248,7 +249,7 @@ checkListBox.DisplayMemberPath = "Name"; ## Check or Uncheck items -You can check or uncheck the items in the [CheckListBox](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html) by clicking on the CheckBox or the content of the item. You can use `Space` key to uncheck or check the previously selected item. +You can check or uncheck the items in the [CheckListBox](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html) by clicking on the CheckBox or the content of the item. You can use the `Space` key to uncheck or check the previously selected item. You can programmatically check the items in CheckListBox by adding the items in the [SelectedItems](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_SelectedItems) property. @@ -312,7 +313,7 @@ N> Refer [Localization of Syncfusion WPF Controls](https://help.syncfusion.com/w The following screenshot shows the localized `CheckListBox` control. -![WPF CheckListBox contain localized SelectAll item](Getting-Started_images/localized.png) +![WPF CheckListBox contains localized SelectAll item](Getting-Started_images/localized.png) [View Sample in GitHub](https://github.com/SyncfusionExamples/wpf-checked-listbox-examples/tree/master/Samples/Localization) diff --git a/wpf/CheckedListBox/Grouping.md b/wpf/CheckedListBox/Grouping.md index 6ebb9039a4..de6bfc1350 100644 --- a/wpf/CheckedListBox/Grouping.md +++ b/wpf/CheckedListBox/Grouping.md @@ -9,9 +9,9 @@ documentation: ug # Grouping Items in WPF CheckedListBox (CheckListBox) - By default, the [CheckListBox](https://www.syncfusion.com/wpf-ui-controls/CheckedListBox) items are in the listed view. We can group the `CheckListBox` items by adding the group description to the `CollectionView.GroupDescriptions` collection. + By default, the [CheckListBox](https://www.syncfusion.com/wpf-ui-controls/CheckedListBox) items are displayed in a listed view. You can group the `CheckListBox` items by adding a group description to the `CollectionView.GroupDescriptions` collection. - The selection state of group header varies based on the checked or unchecked state of the child items. Group can be expanded or collapsed and the child items present in the group can be checked or unchecked based on the user’s perspective. + The selection state of the group header varies based on the checked or unchecked state of the child items. Groups can be expanded or collapsed, and the child items in a group can be checked or unchecked based on the user's perspective. {% tabs %} {% highlight C# %} @@ -68,6 +68,9 @@ class ViewModel { {% endhighlight %} {% endtabs %} +N> The `i:` namespace refers to `http://schemas.microsoft.com/expression/2010/interactivity` and requires a reference to the `System.Windows.Interactivity` assembly. Add the following namespace declaration to the root element of your XAML: +`xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"` + Here, the `Vegetables` items are grouped based on their price. ![CheckListBox items grouped by the Price property](Grouping-Sorting_images/Grouping_image.png) @@ -76,7 +79,7 @@ Click [here](https://github.com/SyncfusionExamples/wpf-checked-listbox-examples/ ## Nested Grouping - We can create a multi-level nested groups for the `CheckListBox` items by adding the two or more group descriptions to the `CollectionView.GroupDescriptions` collection. Child level groups are created by order of group descriptions added to the collection. + We can create multi-level nested groups for the `CheckListBox` items by adding two or more group descriptions to the `CollectionView.GroupDescriptions` collection. Child level groups are created in the order of the group descriptions added to the collection. {% tabs %} {% highlight C# %} @@ -102,7 +105,7 @@ class ViewModel { public ViewModel() { Vegetables = new ObservableCollection(); Vegetables.Add(new Vegetable { Price=10, Name="Yarrow", Category="Leafy and Salad"}); - Vegetables.Add(new Vegetable { Price=20", Name="Pumpkins", Category="Leafy and Salad"}); + Vegetables.Add(new Vegetable { Price=20, Name="Pumpkins", Category="Leafy and Salad"}); Vegetables.Add(new Vegetable { Price=30, Name="Cabbage", Category="Leafy and Salad"}); Vegetables.Add(new Vegetable { Price=10, Name="Spinach", Category="Leafy and Salad"}); Vegetables.Add(new Vegetable { Price=20, Name="Wheat Grass", Category="Leafy and Salad"}); @@ -147,7 +150,7 @@ Click [here](https://github.com/SyncfusionExamples/wpf-checked-listbox-examples/ ## Custom grouping -`CheckListBox` allows you to group the items based on custom logic when the common grouping functionality doesn’t meet your requirement. We can achieve this by using the `IValueConverter`. +`CheckListBox` allows you to group the items based on custom logic when the common grouping functionality does not meet your requirement. This can be achieved by using the `IValueConverter`. {% tabs %} {% highlight C# %} diff --git a/wpf/CheckedListBox/How-to/check-the-item-in-checklistbox-when-initiating.md b/wpf/CheckedListBox/How-to/check-the-item-in-checklistbox-when-initiating.md index ab6fa25526..afe8dcfab6 100644 --- a/wpf/CheckedListBox/How-to/check-the-item-in-checklistbox-when-initiating.md +++ b/wpf/CheckedListBox/How-to/check-the-item-in-checklistbox-when-initiating.md @@ -9,12 +9,13 @@ documentation: ug # Check the Item in CheckListBox when Initiating -To check the items when initiating the CheckListBox control, items need to be added in the SelectedItems collection._ The following code illustrates this: +To check the items when initiating the CheckListBox control, items need to be added to the `SelectedItems` collection. The following code illustrates this: {% tabs %} {% highlight c#%} -this.ListBox.SelectedItems.Add(this.ListBox.Items[4]); +// Assuming the CheckListBox is named 'checkListBox' and contains items +this.checkListBox.SelectedItems.Add(this.checkListBox.Items[4]); {%endhighlight%} {% endtabs %} diff --git a/wpf/CheckedListBox/Item-Selection.md b/wpf/CheckedListBox/Item-Selection.md index 10b33b071c..b42460b171 100644 --- a/wpf/CheckedListBox/Item-Selection.md +++ b/wpf/CheckedListBox/Item-Selection.md @@ -9,7 +9,7 @@ documentation: ug # Item Selection in WPF CheckListBox Control -In CheckListBox, selection of item can be done by single click using the property [IsCheckOnFirstClick](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_IsCheckOnFirstClick). If it is false, then the selection is done when double click is detected. By default, the value of this property is “True”. +In `CheckListBox`, checking of an item can be done with a single click using the [IsCheckOnFirstClick](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.CheckListBox.html#Syncfusion_Windows_Tools_Controls_CheckListBox_IsCheckOnFirstClick) property. If this property is set to `false`, the item is checked only when a double click is detected. By default, the value of this property is `True`. Here is the code for setting this property. @@ -24,14 +24,14 @@ Here is the code for setting this property. - + {%endhighlight%} {%highlight c#%} // Enable the IsCheckOnFirstClick property. -checkListBox.IsCheckOnFirstClick = true; +checkListBox.IsCheckOnFirstClick = true; {%endhighlight%} {% endtabs %} diff --git a/wpf/CheckedListBox/Layout-Related-Features.md b/wpf/CheckedListBox/Layout-Related-Features.md index b661563a9e..ae568cd04d 100644 --- a/wpf/CheckedListBox/Layout-Related-Features.md +++ b/wpf/CheckedListBox/Layout-Related-Features.md @@ -9,16 +9,16 @@ documentation: ug # Layout Related Features -This section illustrates the Layout-related features of CheckListBox control. The following features are discussed: +This section illustrates the layout-related features of the `CheckListBox` control. The following features are discussed: ## Alignment for CheckListBox -The check box in the CheckListBox Item can be aligned to the left or right side of the control using the CheckBoxAlignment property. This dependency property sets the alignment of the check box of the items. Following are the alignment options. +The check box in the `CheckListBox` item can be aligned to the left or right side of the control by using the `CheckBoxAlignment` property. This dependency property sets the alignment of the check box for the items. The following are the alignment options: -* Left: Check box in the CheckListBox Item is aligned to the left -* Right: Check box in the CheckListBox Item is aligned to the right +* `Left`: The check box in the `CheckListBox` item is aligned to the left. +* `Right`: The check box in the `CheckListBox` item is aligned to the right. -To set the CheckBoxAlignment to Right, use the following code. +The default value of `CheckBoxAlignment` is `Left`. To set the `CheckBoxAlignment` to `Right`, use the following code. {% tabs %} {%highlight xaml%} @@ -31,7 +31,7 @@ To set the CheckBoxAlignment to Right, use the following code. - + {%endhighlight%} @@ -84,7 +84,7 @@ FlowDirection = "RightToLeft" ## Set VisualStyle for CheckListBox -The appearance of the CheckListBox control is customized by applying a suitable style using the VisualStyle property. +The appearance of the `CheckListBox` control is customized by applying a suitable style using the `VisualStyle` property. Property table @@ -98,7 +98,7 @@ Description VisualStyle Sets the visual style for the CheckListBox control. The options provided are as follows.
    -
  • BlendOffice2003
  • +
  • Blend
  • Office2007Blue
  • Office2007Black
  • Office2007Silver
  • @@ -109,6 +109,8 @@ Sets the visual style for the CheckListBox control. The options provided are as
  • Metro
  • Transparent
+ +N> The legacy `BlendOffice2003` style has been deprecated. Use `Blend` instead. diff --git a/wpf/CheckedListBox/Sorting.md b/wpf/CheckedListBox/Sorting.md index ef020fef9b..a3dfc22866 100644 --- a/wpf/CheckedListBox/Sorting.md +++ b/wpf/CheckedListBox/Sorting.md @@ -9,7 +9,7 @@ documentation: ug # Sorting Items in WPF CheckedListBox (CheckListBox) - By default, the [CheckListBox](https://www.syncfusion.com/wpf-controls/checkedlistbox) are arranged based on the order they added in to the `Items` collection. We can sort the `CheckListBox` items by adding the sorting direction to the `CollectionView.SortDescriptions` collection. The `CheckListBox` items can be sorted either in ascending or descending order based on the user’s perspective. + By default, the [CheckListBox](https://www.syncfusion.com/wpf-controls/checkedlistbox) items are arranged based on the order in which they were added to the `Items` collection. You can sort the `CheckListBox` items by adding a `SortDescription` to the `CollectionView.SortDescriptions` collection. The `CheckListBox` items can be sorted in either ascending or descending order, based on the user's preference. {% tabs %} {% highlight C# %} @@ -69,7 +69,8 @@ class ViewModel { {% endhighlight %} {% endtabs %} - +N> The `i:` namespace refers to `http://schemas.microsoft.com/expression/2010/interactivity` and requires a reference to the `System.Windows.Interactivity` assembly. Add the following namespace declaration to the root element of your XAML: +`xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"` Here, the `Vegetables` items are sorted in ascending order based on their name. ![CheckListBox with default and ascending sorted order](Grouping-Sorting_images/Sorting_image.png) diff --git a/wpf/CheckedListBox/Virtualization.md b/wpf/CheckedListBox/Virtualization.md index 8bbab1c653..e3632d4b7f 100644 --- a/wpf/CheckedListBox/Virtualization.md +++ b/wpf/CheckedListBox/Virtualization.md @@ -92,7 +92,7 @@ Click [here](https://github.com/SyncfusionExamples/wpf-checked-listbox-examples/ ## Disable the Virtualization -We can only load the particular items to visible at a time. If we want to make some items as checked that are not in view, then we need to disable the virtualization, otherwise the items will not be checked until they are in view. We can disable the virtualization by using the `ItemsPanel` template. +By default, only the items that are currently visible are loaded. If you want to mark items as checked that are not currently in view, you need to disable the virtualization; otherwise, the items will not be checked until they are brought into view. You can disable virtualization by using the `ItemsPanel` template. {% tabs %} {% highlight XAML %} @@ -111,6 +111,8 @@ We can only load the particular items to visible at a time. If we want to make s CheckListBox checkListBox = new CheckListBox(); checkListBox.ItemsPanel = new ItemsPanelTemplate(new FrameworkElementFactory(typeof(StackPanel))); +N> `FrameworkElementFactory` is marked as obsolete in newer versions of WPF. For modern codebases, prefer defining the `ItemsPanelTemplate` in XAML or in a resource. + {% endhighlight %} {% endtabs %} diff --git a/wpf/Currency-TextBox/Appearance.md b/wpf/Currency-TextBox/Appearance.md index c8a0f44c48..20202e7726 100644 --- a/wpf/Currency-TextBox/Appearance.md +++ b/wpf/Currency-TextBox/Appearance.md @@ -11,9 +11,13 @@ documentation: ug This section deals with the appearance of `CurrencyTextBox` control and contains the following topics. +## Assembly Deployment + +Refer to the [control dependencies](https://help.syncfusion.com/wpf/control-dependencies#currencytextbox) section to get the list of assemblies or NuGet package that needs to be added as a reference to use the control in any application. + ## Setting the Foreground -The [CurrencyTextBox](https://www.syncfusion.com/wpf-ui-controls/currency-textbox) control [Foreground](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.control.foreground?view=netframework-4.8) can be modified based on the value of the control. The following are the foreground for `CurrencyTextBox` control. +The [CurrencyTextBox](https://www.syncfusion.com/wpf-controls/currency-textbox) control [Foreground](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.control.foreground?view=netframework-4.8) can be modified based on the value of the control. The following are the foreground for `CurrencyTextBox` control. ### Foreground for Positive Value @@ -110,11 +114,11 @@ currencyTextBox.Background = Brushes.Cyan; {% endhighlight %} {% endtabs %} -![WPF CurrencyTextBox with Cyan Bbackground](Appearance_images/wpf-currency-textbox-background.png) +![WPF CurrencyTextBox with Cyan Background](Appearance_images/wpf-currency-textbox-background.png) ## Setting the Corner Radius -Corner Radius indicates the degree to which the corners of the border can be rounded. To create curved borders for the `CurrencyTextBox`, use [CornerRadius](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_CornerRadius) property. The default value of `CornerRadius` property is 1. +Corner Radius indicates the degree to which the corners of the border can be rounded. To create curved borders for the `CurrencyTextBox`, use [CornerRadius](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_CornerRadius) property. The default value of `CornerRadius` property is 1. In XAML, a single value applies the same radius to all four corners; in C#, use the `System.Windows.CornerRadius` struct (which can be initialized with one, two, or four values). {% tabs %} @@ -143,7 +147,7 @@ currencyTextBox.CornerRadius = new CornerRadius(5); {% tabs %} {% highlight XAML %} - + {% endhighlight %} {% highlight C# %} @@ -159,7 +163,7 @@ currencyTextBox.SelectionOpacity = 0.3; ![WPF CurrencyTextBox with Red Selection Background](Appearance_images/wpf-currency-textbox-selection.png) -## Align Value +## Aligning the Value `CurrencyTextBox` allows to display the value from right or center or left side by setting the [TextAlignment](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.textblock.textalignment?view=netframework-4.8) property to `Right` or `Left` or `Center`. The Default value of `TextAlignment` is `Left`. @@ -212,3 +216,9 @@ CurrencyTextBox supports various built-in themes. Refer to the below links to ap * [Create a custom theme using ThemeStudio](https://help.syncfusion.com/wpf/themes/theme-studio#creating-custom-theme) ![Applying Theme to WPF CurrencyTextBox](Getting-Started_images/wpf-currency-textbox-theme.png) + +## See Also + +* [Getting Started](Getting-Started.md) +* [Culture and Number Formats](Culture-and-Number-Formats.md) +* [Restriction or Validation](Restriction-or-Validation.md) diff --git a/wpf/Currency-TextBox/Changing-Currency-Value.md b/wpf/Currency-TextBox/Changing-Currency-Value.md index 82cf449648..a381a6bff4 100644 --- a/wpf/Currency-TextBox/Changing-Currency-Value.md +++ b/wpf/Currency-TextBox/Changing-Currency-Value.md @@ -8,8 +8,10 @@ documentation: ug --- # Changing Currency Value in WPF Currency TextBox +## Assembly Deployment -The [CurrencyTextBox](https://www.syncfusion.com/wpf-ui-controls/currency-textbox) allows the user to change the value using the [Value](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_Value) property. +Refer to the [control dependencies](https://help.syncfusion.com/wpf/control-dependencies#currencytextbox) section to get the list of assemblies or NuGet package that needs to be added as a reference to use the control in any application. +The [CurrencyTextBox](https://www.syncfusion.com/wpf-controls/currency-textbox) allows the user to change the value using the [Value](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_Value) property. {%tabs%} {% highlight xaml %} @@ -32,13 +34,15 @@ currencyTextBox.Value = 10; Data binding is the process of establishing a connection between the application UI and business logic. Data binding can be unidirectional (source -> target or target <- source) or bidirectional (source <-> target). By assigning a value to the `Value` property by binding, you can change the `CurrencyTextBox` value. -The following code snippets illustrate the value binding from one `CurrencyTextBox` to another. +The following code snippets illustrate the value binding from one `CurrencyTextBox` to another. Set the `DataContext` of the parent container to a `ViewModel` instance so the `{Binding MyValue}` expression resolves. {%tabs%} {% highlight xaml %} + + {% endhighlight %} {%endtabs%} @@ -48,7 +52,9 @@ ViewModel.cs {% tabs %} {% highlight C# %} -class ViewModel : NotificationObject +using Syncfusion.Windows.Shared; + +public class ViewModel : NotificationObject { private double myValue; public double MyValue @@ -70,9 +76,9 @@ class ViewModel : NotificationObject ![WPF CurrencyTextBox displays Binding Value](Changing-Currency-Value_images/wpf-currency-textbox-binding-value.png) -## Change currency value by pasting the clipboard's text +## Change Currency Value by Pasting the Clipboard's Text -By default, `CurrencyTextBox` simply replaces the whole value by copied value with the current number format. If you want to replace or insert the copied value on specific place, use the [PasteMode](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_PasteMode) property value as `Advanced`. The default value of `PasteMode` property is `Default`. +By default, `CurrencyTextBox` simply replaces the whole value with the copied value using the current number format. If you want to replace or insert the copied value at a specific position, set the [PasteMode](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_PasteMode) property to `Advanced`. The default value of `PasteMode` is `Default` (always replace the entire value, regardless of the cursor position or selection). The following table explains the pasting behaviour in `Advanced` paste mode, @@ -152,7 +158,7 @@ currencyTextBox.ShowSpinButton = true; ## Value Changed Event -The `CurrencyTextBox` control can notify changes in value through the [ValueChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html) event. In `ValueChanged` event, you can get old value and new value from the `OldValue` and `NewValue` properties. +The `CurrencyTextBox` control can notify changes in value through the [ValueChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html) event. In the `ValueChanged` event, you can get the old and new value from the `OldValue` and `NewValue` properties. {%tabs%} {% highlight xaml %} @@ -163,7 +169,7 @@ The `CurrencyTextBox` control can notify changes in value through the [ValueChan {% highlight C# %} CurrencyTextBox currencyTextBox = new CurrencyTextBox(); -currencyTextBox.ValueChanged += new PropertyChangedCallback(CurrencyTextBox_ValueChanged); +currencyTextBox.ValueChanged += CurrencyTextBox_ValueChanged; {% endhighlight %} {%endtabs%} @@ -235,7 +241,7 @@ currencyTextBox.UseNullOption = true; ## Setting Watermark Text -We can display certain information within the control by using the [WaterMarkText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_WatermarkText) property. `WaterMarkText` is shown when the [WatermarkTextIsVisible](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_WatermarkTextIsVisible) property is `true` and the value is `null` or empty, the control is not in focus and the `UseNullOption` property is `true`. +You can display placeholder text within the control by setting the [WatermarkText](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_WatermarkText) property. The `WatermarkText` is shown only when the [WatermarkTextIsVisible](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_WatermarkTextIsVisible) property is `true`, the `Value` is `null` or empty (which requires the `UseNullOption` property to be `true` because `Value` is non-nullable by default), the control is not in focus, and the `UseNullOption` property is `true`. ### Setting the WatermarkText Foreground @@ -290,3 +296,9 @@ You can customize the Visual appearance of the `WatermarkText` by using the [Wat N> The `UseNullOption` property must be enabled if you want to see `NullValue` or `WaterMarkText` in `CurrencyTextBox` control. N> If both `NullValue` and `WaterMarkText` are specified, you will only see `NullValue` but not `WaterMarkText`. + +## See Also + +* [Getting Started](Getting-Started.md) +* [Appearance](Appearance.md) +* [Culture and Number Formats](Culture-and-Number-Formats.md) diff --git a/wpf/Currency-TextBox/Culture-and-Number-Formats.md b/wpf/Currency-TextBox/Culture-and-Number-Formats.md index d30d1b84b2..2297266e3c 100644 --- a/wpf/Currency-TextBox/Culture-and-Number-Formats.md +++ b/wpf/Currency-TextBox/Culture-and-Number-Formats.md @@ -9,7 +9,11 @@ documentation: ug # Culture and Formatting in WPF Currency TextBox -Value of `CurrencyTextBox` can be formatted in following ways: +## Assembly Deployment + +Refer to the [control dependencies](https://help.syncfusion.com/wpf/control-dependencies#currencytextbox) section to get the list of assemblies or NuGet package that needs to be added as a reference to use the control in any application. + +Value of `CurrencyTextBox` can be formatted in the following ways: * Culture * NumberFormatInfo @@ -47,21 +51,30 @@ By default the US culture uses “,” as the `CurrencyGroupSeparator` "$" as `C ![WPF CurrencyTextBox with France Culture](Culture-and-Number-Formats_images/wpf-currency-textbox-france-culture.png) -## NumberFormatInfo based formatting +## NumberFormatInfo-Based Formatting -The number formatting of `CurrencyTextBox` can be customized by setting [NumberFormat](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_NumberFormat) property. +The number formatting of `CurrencyTextBox` can be customized by setting the [NumberFormat](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_NumberFormat) property. {% tabs %} {% highlight xaml %} - - - - - + + + + + + + + + {% endhighlight %} @@ -84,11 +97,13 @@ currencyTextBox.NumberFormat = new NumberFormatInfo() ![WPF CurrencyTextBox with Formatting](Culture-and-Number-Formats_images/wpf-currency-textbox-formatting.png) -The following code illustrate how to set currency group size by using the `NumberFormat` property. +The following code illustrates how to set the currency group size by using the `NumberFormat` property. {% tabs %} {% highlight C# %} +using System.Globalization; + CurrencyTextBox currencyTextBox = new CurrencyTextBox(); currencyTextBox.Width = 150; currencyTextBox.Height = 25; @@ -111,9 +126,9 @@ currencyTextBox.NumberFormat = new NumberFormatInfo() ## Formatting with dedicated properties -The number formatting of `CurrencyTextBox` can also be customized by setting the [CurrencyGroupSeparator](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyGroupSeparator), [CurrencyGroupSizes](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyGroupSizes), [CurrencyDecimalDigits](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyDecimalDigits) and [CurrencyDecimalSeparator](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyDecimalSeparator), [CurrencySymbol](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencySymbol), [CurrencyNegativePattern](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyNegativePattern), and [CurrencyPositivePattern](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyPositivePattern) properties of CurrencyTextBox. You can show the group separator by enable the [GroupSeperatorEnabled](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_GroupSeperatorEnabled) property to `true`. +The number formatting of `CurrencyTextBox` can also be customized by setting the [CurrencyGroupSeparator](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyGroupSeparator), [CurrencyGroupSizes](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyGroupSizes), [CurrencyDecimalDigits](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyDecimalDigits) and [CurrencyDecimalSeparator](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyDecimalSeparator), [CurrencySymbol](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencySymbol), [CurrencyNegativePattern](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyNegativePattern), and [CurrencyPositivePattern](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyPositivePattern) properties of CurrencyTextBox. You can show the group separator by enabling the [GroupSeparatorEnabled](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_GroupSeparatorEnabled) property (`true`). -The following code illustrate how to format using the `CurrencyDecimalSeparator`, `CurrencyDecimalDigits`, `CurrencyGroupSeparator`, `CurrencyGroupSizes` property of the `CurrencyTextBox`. +The following code illustrates how to format using the `CurrencyDecimalSeparator`, `CurrencyDecimalDigits`, `CurrencyGroupSeparator`, and `CurrencyGroupSizes` properties of the `CurrencyTextBox`. {% tabs %} {% highlight C# %} @@ -124,19 +139,19 @@ currencyTextBox.Height = 25; currencyTextBox.Value = 123456789; currencyTextBox.CurrencySymbol = "#"; currencyTextBox.CurrencyDecimalDigits = 4; -currencyTextBox.GroupSeperatorEnabled = true; +currencyTextBox.GroupSeparatorEnabled = true; currencyTextBox.CurrencyGroupSeparator = "/"; currencyTextBox.CurrencyDecimalSeparator = "*"; // Adding the currency group size via CurrencyGroupSizes property. -currencyTextBox.CurrencyGroupSizes = new Int32Collection() { 4, 3, 2 }; +currencyTextBox.CurrencyGroupSizes = new int[] { 4, 3, 2 }; {% endhighlight %} {% endtabs %} ![WPF CurrencyTextBox with Formatting](Culture-and-Number-Formats_images/wpf-currency-textbox-number-format.png) -N> When you use both the `NumberFormat` and the dedicated properties (`CurrencyGroupSeparator`, `CurrencySymbol`, `CurrencyDecimalDigits`, `CurrencyDecimalSeparator` and `CurrencyGroupSizes`) to format the value of `CurrencyTextBox`, the `CurrencyGroupSeparator`and `CurrencyGroupSizes` properties have higher priority. +N> When you use both the `NumberFormat` and the dedicated properties (`CurrencyGroupSeparator`, `CurrencySymbol`, `CurrencyDecimalDigits`, `CurrencyDecimalSeparator` and `CurrencyGroupSizes`) to format the value of `CurrencyTextBox`, the `CurrencyGroupSeparator` and `CurrencyGroupSizes` properties have higher priority. N> When you use both `NumberFormat` and `Culture`, the `NumberFormat` will have a higher priority. @@ -188,7 +203,7 @@ currencyTextBox.CurrencyPositivePattern = 3; {% endhighlight %} {% endtabs %} -![WPF CurrencyTextBox displays Postive Value Pattern](Culture-and-Number-Formats_images/wpf-currency-textbox-positive-value.png) +![WPF CurrencyTextBox displays Positive Value Pattern](Culture-and-Number-Formats_images/wpf-currency-textbox-positive-value.png) ### Negative Value Pattern @@ -287,3 +302,9 @@ currencyTextBox.CurrencyNegativePattern = 0; {% endtabs %} ![WPF CurrencyTextBox displays Negative Value Pattern](Culture-and-Number-Formats_images/wpf-currency-textbox-negative-value.png) + +## See Also + +* [Getting Started](Getting-Started.md) +* [Appearance](Appearance.md) +* [Restriction or Validation](Restriction-or-Validation.md) diff --git a/wpf/Currency-TextBox/Getting-Started.md b/wpf/Currency-TextBox/Getting-Started.md index c80a37a7b6..7a99b91ee5 100644 --- a/wpf/Currency-TextBox/Getting-Started.md +++ b/wpf/Currency-TextBox/Getting-Started.md @@ -41,7 +41,8 @@ To add the CurrencyTextBox control manually in XAML, follow these steps: {% highlight XAML %} @@ -94,6 +95,9 @@ currencyTextBox.Width = 100; this.Content = currencyTextBox; +// Show the window (typical WPF startup) +this.Show(); + {% endhighlight %} {% endtabs %} {% endcapture %} @@ -121,7 +125,7 @@ currencyTextBox.Value = 100; {% endhighlight %} {% endtabs %} -![WPF Currency TextBox diplays Value](getting-started_images/wpf-currency-textbox-value.png) +![WPF Currency TextBox displays Value](getting-started_images/wpf-currency-textbox-value.png) N> Do not use the [Text](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.textbox.text?redirectedfrom=MSDN&view=netframework-4.7.2#System_Windows_Controls_TextBox_Text) property to set the value for the CurrencyTextBox. Use only the `Value` property. @@ -129,11 +133,11 @@ N> Do not use the [Text](https://docs.microsoft.com/en-us/dotnet/api/system.wind Data binding is the method of forming a connection between the application UI and business logic. Data binding can be unidirectional (source -> target or target <- source) or bidirectional (source <-> target). You can bind data to the `CurrencyTextBox` using the `Value` Property. -The following code snippets illustrate the value binding from one `CurrencyTextBox` to another. +The following code snippets illustrate the value binding from one `CurrencyTextBox` to another. Set the `DataContext` of the `StackPanel` (or window) to a `ViewModel` instance so the `{Binding MyValue}` expression resolves. {% tabs %} {% highlight XAML %} - + @@ -145,7 +149,9 @@ ViewModel.cs {% tabs %} {% highlight C# %} -class ViewModel : NotificationObject +using Syncfusion.Windows.Shared; + +public class ViewModel : NotificationObject { private double myValue; public double MyValue @@ -169,7 +175,7 @@ class ViewModel : NotificationObject ## Value Changed Notification -The `CurrencyTextBox` control can notifies the value changes through the [ValueChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html) event. You can get old value and new Value from `OldValue` and `NewValue` properties in `ValueChanged` event. +The `CurrencyTextBox` control can notify value changes through the [ValueChanged](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html) event. You can get the old and new value from the `OldValue` and `NewValue` properties in the `ValueChanged` event. {%tabs%} {% highlight xaml %} @@ -180,7 +186,7 @@ The `CurrencyTextBox` control can notifies the value changes through the [ValueC {% highlight C# %} CurrencyTextBox currencyTextBox = new CurrencyTextBox(); -currencyTextBox.ValueChanged += new PropertyChangedCallback(CurrencyTextBox_ValueChanged); +currencyTextBox.ValueChanged += CurrencyTextBox_ValueChanged; {% endhighlight %} {%endtabs%} @@ -318,4 +324,14 @@ CurrencyTextBox supports various built-in themes. Refer to the below links to ap * [Create a custom theme using ThemeStudio](https://help.syncfusion.com/wpf/themes/theme-studio#creating-custom-theme) - ![Applying Theme to WPF Currency TextBox](getting-started_images/wpf-currency-textbox-theme.png) \ No newline at end of file + ![Applying Theme to WPF Currency TextBox](getting-started_images/wpf-currency-textbox-theme.png) + +## See Also + +* [Overview](Overview.md) +* [Culture and Number Formats](Culture-and-Number-Formats.md) +* [Appearance](Appearance.md) +* [Step Interval](Step-Interval.md) +* [Range Adorner](Range-Adorner.md) +* [Restriction or Validation](Restriction-or-Validation.md) +* [Changing Currency Value](Changing-Currency-Value.md) \ No newline at end of file diff --git a/wpf/Currency-TextBox/Overview.md b/wpf/Currency-TextBox/Overview.md index 4d828d6fc4..b5fa12fa50 100644 --- a/wpf/Currency-TextBox/Overview.md +++ b/wpf/Currency-TextBox/Overview.md @@ -10,7 +10,7 @@ documentation: ug # WPF Currency TextBox Overview The `CurrencyTextBox` is a specialized input control designed to accept, format, and display numeric values as currency in WPF applications. It enforces numeric input, formats numbers according to currency conventions, and exposes a concise API for common scenarios such as data binding, range validation, culture-aware formatting, and UI-driven value adjustment. The control is intended for forms, financial entry screens, reporting dialogs, dashboards, and any UI that requires reliable currency input and presentation. -## Control structure +## Control Structure The `CurrencyTextBox` combines a text-editing area with a number-formatting layer and optional adorner for visual feedback. Typical visual elements include a watermark (placeholder text) when the control is empty, the formatted currency text, and an optional range adorner that can act like a progress indicator based on `MinValue`/`MaxValue`. @@ -18,14 +18,14 @@ The `CurrencyTextBox` combines a text-editing area with a number-formatting laye ![WPF Currency TextBox with Watermark Text](getting-started_images/wpf-currency-textbox-watermark.png) -## Typical usage scenarios +## Typical Usage Scenarios - Data-entry forms where users input monetary values (invoices, purchase orders, budgets). - Financial dashboards that present editable currency fields with immediate formatting. - Localized applications that must display currency values according to the user's culture and regional settings. - UI components that need numeric constraints, e.g., limits, step increments, or visual progress indication for values within a range. -## Key capabilities +## Key Capabilities - Value enforcement and parsing: accepts only decimal-compatible characters and exposes the current numeric value through the `Value` property. - Formatting and culture support: formats the displayed value as currency using either a `NumberFormatInfo` instance or the `Culture` property; supports dedicated formatting properties such as `CurrencySymbol`, `CurrencyDecimalDigits`, and `CurrencyGroupSeparator`. See details in [Culture and Formatting](Culture-and-Number-Formats.md). @@ -35,16 +35,30 @@ The `CurrencyTextBox` combines a text-editing area with a number-formatting laye - Data binding and notifications: supports two‑way binding on the `Value` property and exposes value-change notifications so view models can react immediately to user edits. - Accessibility and read-only mode: supports `IsReadOnly` and related caret behavior to present values without allowing edits while keeping selection and focusable behavior as needed. -## Integration and quick start +## Assembly Deployment + +Refer to the [control dependencies](https://help.syncfusion.com/wpf/control-dependencies#currencytextbox) section to get the list of assemblies or NuGet package that needs to be added as a reference to use the control in any application. + +## Integration and Quick Start To add a `CurrencyTextBox` to your view and get started quickly, see the step-by-step instructions in [Getting Started](Getting-Started.md). That page shows the required assembly reference, XAML and C# examples, and the preferred `Value`-based approach for setting and binding currency data. -## Behavior and developer notes +## Behavior and Developer Notes - Prefer the `Value` property rather than `Text` when reading or setting the control programmatically; `Value` always represents the parsed numeric value. - When both `NumberFormat` and `Culture` are specified, `NumberFormat` takes precedence for display formatting. - `CurrencyDecimalDigits`, `MinimumCurrencyDecimalDigits`, and `MaximumCurrencyDecimalDigits` control decimal precision and interact according to explicit precedence rules documented in the formatting guide. -## Theming, styling and extensibility +## Theming, Styling and Extensibility The `CurrencyTextBox` supports built-in visual themes and can be styled using standard WPF templates and brushes. Visual states for positive, negative and zero values can be customized to make value meaning immediately perceptible. For examples and theming notes see the related Getting Started and Culture/Formatting documentation. + +## See Also + +* [Getting Started](Getting-Started.md) +* [Appearance](Appearance.md) +* [Culture and Number Formats](Culture-and-Number-Formats.md) +* [Changing Currency Value](Changing-Currency-Value.md) +* [Step Interval](Step-Interval.md) +* [Range Adorner](Range-Adorner.md) +* [Restriction or Validation](Restriction-or-Validation.md) diff --git a/wpf/Currency-TextBox/Range-Adorner.md b/wpf/Currency-TextBox/Range-Adorner.md index dfc30f15c6..a85040423e 100644 --- a/wpf/Currency-TextBox/Range-Adorner.md +++ b/wpf/Currency-TextBox/Range-Adorner.md @@ -9,12 +9,16 @@ documentation: ug # Range Adorner in WPF Currency TextBox -[Value](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_Value) of [CurrencyTextBox](https://www.syncfusion.com/wpf-ui-controls/currency-textbox) can be visually indicated like a progress bar using range-adorner feature, this feature is disabled by default. You can show the adorner over `CurrencyTextBox` control by setting [EnableRangeAdorner](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_EnableRangeAdorner) property to `true`. Default value of `EnableRangeAdorner` is `false`. The adorner layer can be filled in the control area on the basis of the minimum and maximum values with considering the given value. Range Adorner is not displayed when a `MinValue` or `MaxValue` property is not set. +## Assembly Deployment + +Refer to the [control dependencies](https://help.syncfusion.com/wpf/control-dependencies#currencytextbox) section to get the list of assemblies or NuGet package that needs to be added as a reference to use the control in any application. + +[Value](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_Value) of [CurrencyTextBox](https://www.syncfusion.com/wpf-controls/currency-textbox) can be visually indicated like a progress bar using range-adorner feature, this feature is disabled by default. You can show the adorner over `CurrencyTextBox` control by setting [EnableRangeAdorner](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_EnableRangeAdorner) property to `true`. Default value of `EnableRangeAdorner` is `false`. The adorner layer can be filled in the control area on the basis of the minimum and maximum values with considering the given value. Range Adorner is not displayed when a `MinValue` or `MaxValue` property is not set. {% tabs %} {% highlight XAML %} - + {% endhighlight %} {% highlight C# %} @@ -30,7 +34,7 @@ currencyTextBox.EnableRangeAdorner =true; ![WPF CurrencyTextBox displays RangeAdorner](Range-Adorner_images/wpf-currency-textbox-range-adorner.png) -## Changing background of range-adorner +## Changing the Background of the Range Adorner You can change the background color of the range adorner using [RangeAdornerBackground](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_RangeAdornerBackground) property. @@ -53,3 +57,9 @@ currencyTextBox.RangeAdornerBackground = Brushes.LightGreen; {% endtabs %} ![Changing Background of RangeAdorner of WPF CurrencyTextBox](Range-Adorner_images/wpf-currency-textbox-range-adorner-background.png) + +## See Also + +* [Getting Started](Getting-Started.md) +* [Restriction or Validation](Restriction-or-Validation.md) +* [Step Interval](Step-Interval.md) diff --git a/wpf/Currency-TextBox/Restriction-or-Validation.md b/wpf/Currency-TextBox/Restriction-or-Validation.md index bba9de2575..1f8d8e658d 100644 --- a/wpf/Currency-TextBox/Restriction-or-Validation.md +++ b/wpf/Currency-TextBox/Restriction-or-Validation.md @@ -9,31 +9,35 @@ documentation: ug # Restriction or Validation in WPF Currency TextBox +## Assembly Deployment + +Refer to the [control dependencies](https://help.syncfusion.com/wpf/control-dependencies#currencytextbox) section to get the list of assemblies or NuGet package that needs to be added as a reference to use the control in any application. + This section explains how to validate or restrict the `CurrencyTextBox` control value. ## Restrict the value within minimum and maximum value -The [Value](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_Value) of the [CurrencyTextBox](https://www.syncfusion.com/wpf-ui-controls/currency-textbox) can be restricted within the maximum and minimum limits. Once the value has reached the maximum or minimum value , the value does not exceed the limit. We can change the maximum and minimum limits by using the [MinValue](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_MinValue) property and [MaxValue](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_MaxValue) property. +The [Value](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_Value) of the [CurrencyTextBox](https://www.syncfusion.com/wpf-controls/currency-textbox) can be restricted within the maximum and minimum limits. Once the value has reached the maximum or minimum value, the value does not exceed the limit. You can change the maximum and minimum limits by using the [MinValue](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_MinValue) and [MaxValue](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_MaxValue) properties. The default validation mode for `MinValidation` and `MaxValidation` is `OnLostFocus`. You can choose when to validate the maximum and minimum limits while changing the values by using the [MinValidation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_MinValidation) and [MaxValidation](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_MaxValidation) properties. -* `OnKeyPress` — When setting the `MaxValidation` or `MinValidation` to `OnKeyPress`, the value in the `CurrencyTextBox` will be validated shortly after pressing a key. So, it is not possible to provide any invalid input at all and the value does not exceed the maximum and minimum limits. +* `OnKeyPress` — When `MaxValidation` or `MinValidation` is set to `OnKeyPress`, the value in the `CurrencyTextBox` is validated shortly after each key press. As a result, it is not possible to enter any invalid input and the value will never exceed the configured maximum or minimum limits. -* `OnLostFocus` - When setting `MaxValidation` or `MinValidation` to `OnLostFocus`, the value in the `CurrencyTextBox` is validated, when the `CurrencyTextBox` loses the focus. That is, the `CurrencyTextBox` will accept any value, validation will only take place after the `CurrencyTextBox` has lost its keyboard focus. After validation, when the value of the `CurrencyTextBox` is greater than the `MaxValue` or less than the `MinValue`, the value will be automatically set to `MaxValue` or `MinValue`. +* `OnLostFocus` - When `MaxValidation` or `MinValidation` is set to `OnLostFocus`, the value in the `CurrencyTextBox` is validated when the control loses keyboard focus. The `CurrencyTextBox` will accept any value during editing; validation takes place only after focus is lost. If the value is then greater than `MaxValue` or less than `MinValue`, it is automatically reset to `MaxValue` or `MinValue`, respectively. * [MaxValueOnExceedMaxDigit](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_MaxValueOnExceedMaxDigit) - When you give input greater than specified maximum limit, `MaxValueOnExceedMaxDigit` property will decide either it should retain the old value or reset to maximum limit that is specified. For example, if `MaxValue` is set to 100 and you are trying to input 200. `Value` will changed to 100 when `MaxValueOnExceedMaxDigit` is `true`. When `MaxValueOnExceedMaxDigit` is `false`, 20 will be retained and last entered 0 will be ignored. - N> `MaxValueOnExceedMinDigit` property will be enabled only when the `MaxValidation` is set to `OnKeyPress`. + N> `MaxValueOnExceedMaxDigit` property takes effect only when the `MaxValidation` is set to `OnKeyPress`. * [MinValueOnExceedMinDigit](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_MinValueOnExceedMinDigit) - When you give input less than specified minimum limit, `MinValueOnExceedMinDigit` property will decide either it should retain the old value or reset to minimum limit that is specified. For example, if `MinValue` is set to 200 and the `Value` is 205 and you are trying change the value to 20. `Value` will changed to 200 when `MinValueOnExceedMinDigit` is `true`. When `MinValueOnExceedMinDigit` is `false`, Old value 205 will be retained. - N> `MinValueOnExceedMinDigit` will be enabled only when the `MinValidation` is set to `OnKeyPress`. + N> `MinValueOnExceedMinDigit` takes effect only when the `MinValidation` is set to `OnKeyPress`. {% tabs %} {% highlight XAML %} {% endhighlight %} @@ -47,22 +51,21 @@ currencyTextBox.MaxValue =100; currencyTextBox.MinValidation = MinValidation.OnKeyPress; currencyTextBox.MaxValidation = MaxValidation.OnLostFocus; currencyTextBox.MinValueOnExceedMinDigit = true; -currencyTextBox.MaxValueOnExceedMaxDigit = true; {% endhighlight %} {% endtabs %} `MinValidation` is set to OnKeyPress, it cannot let to enter a value less than the `MinValue`. If try to enter a value less than the `MinValue`, then the `MinValue` will set to the `Value` property because `MinValueOnExceedMinDigit` is set to `true`. -![Validate minimun value of CurrencyTextBox on pressing a key](Restriction-or-Validation_images/wpf-currency-textbox-min-value-validation.jpeg) +![Validate minimum value of CurrencyTextBox on pressing a key](Restriction-or-Validation_images/wpf-currency-textbox-min-value-validation.jpeg) `MaxValidation` is set to OnLostFocus, so the `MaxValidation` will be performed only in the lost focus. ![Validate maximum value of CurrencyTextBox when keyboard focus is lost](Restriction-or-Validation_images/wpf-currency-textbox-max-value-validation.jpeg) -## Restrict number of decimal digits +## Restrict Number of Decimal Digits -You can format the decimal digits in the [CurrencyTextBox](https://www.syncfusion.com/wpf-ui-controls/currency-textbox) control using [CurrencyDecimalDigits](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyDecimalDigits) property. You can also restrict the decimal digits of the text within minimum and maximum limit in `CurrencyTextBox` control using [MinimumCurrencyDecimalDigits](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_MinimumCurrencyDecimalDigits) and [MaximumCurrencyDecimalDigits](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_MaximumCurrencyDecimalDigits) properties. The default value of `MinimumCurrencyDecimalDigits`,`MaximumCurrencyDecimalDigits` and `CurrencyDecimalDigits` properties is **-1**. +You can format the decimal digits in the [CurrencyTextBox](https://www.syncfusion.com/wpf-controls/currency-textbox) control using [CurrencyDecimalDigits](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_CurrencyDecimalDigits) property. You can also restrict the decimal digits of the text within minimum and maximum limit in `CurrencyTextBox` control using [MinimumCurrencyDecimalDigits](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_MinimumCurrencyDecimalDigits) and [MaximumCurrencyDecimalDigits](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_MaximumCurrencyDecimalDigits) properties. The default value of `MinimumCurrencyDecimalDigits`,`MaximumCurrencyDecimalDigits` and `CurrencyDecimalDigits` properties is **-1**. N> If the value of `MinimumCurrencyDecimalDigits` property is greater than the value of `MaximumCurrencyDecimalDigits` property, the text of `CurrencyTextBox` will be updated based on value of `MinimumCurrencyDecimalDigits` property. @@ -111,9 +114,9 @@ currencyTextBox.CurrencyDecimalDigits = 3; ![CurrencyTextBox WPF change decimal digits](Restriction-or-Validation_images/currencytextbox-wpf-decimaldigits.png) -## Read only mode +## Read-Only Mode -The `CurrencyTextBox` cannot allow the user input, edits when [IsReadOnly](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.primitives.textboxbase.isreadonly?redirectedfrom=MSDN&view=netframework-4.7.2#System_Windows_Controls_Primitives_TextBoxBase_IsReadOnly) property is sets to `true`. The user can still select text and display the cursor on the `CurrencyTextBox` by setting the [IsReadOnlyCaretVisible](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.primitives.textboxbase.isreadonlycaretvisible?view=netframework-4.8) property to `true`. However, value can be changed programmatically in readonly mode. +The `CurrencyTextBox` does not allow the user to input or edit the value when the [IsReadOnly](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.primitives.textboxbase.isreadonly?view=netframework-4.8) property is set to `true`. The user can still select text and display the cursor on the `CurrencyTextBox` by setting the [IsReadOnlyCaretVisible](https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.primitives.textboxbase.isreadonlycaretvisible?view=netframework-4.8) property to `true`. However, the value can still be changed programmatically in read-only mode. {% tabs %} {% highlight XAML %} @@ -131,4 +134,10 @@ currencyTextBox.IsReadOnlyCaretVisible = true; {% endhighlight %} {% endtabs %} -![CurrencyTextBox in read-only mode](Restriction-or-Validation_images/wpf-currency-textbox-readonly.jpeg) \ No newline at end of file +![CurrencyTextBox in read-only mode](Restriction-or-Validation_images/wpf-currency-textbox-readonly.jpeg) + +## See Also + +* [Getting Started](Getting-Started.md) +* [Range Adorner](Range-Adorner.md) +* [Culture and Number Formats](Culture-and-Number-Formats.md) \ No newline at end of file diff --git a/wpf/Currency-TextBox/Step-Interval.md b/wpf/Currency-TextBox/Step-Interval.md index 9889717e1d..ad7ec24635 100644 --- a/wpf/Currency-TextBox/Step-Interval.md +++ b/wpf/Currency-TextBox/Step-Interval.md @@ -9,7 +9,11 @@ documentation: ug # Step Interval in WPF Currency TextBox -The [CurrencyTextBox](https://www.syncfusion.com/wpf-ui-controls/currency-textbox) control allows you to increase or decrease the value by pressing up-arrow and down-arrow keys in keyboard or mouse wheel over the control. The [ScrollInterval](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_ScrollInterval) property is used to specify the increment or decrement interval. The default value of `ScrollInterval` is 1. +## Assembly Deployment + +Refer to the [control dependencies](https://help.syncfusion.com/wpf/control-dependencies#currencytextbox) section to get the list of assemblies or NuGet package that needs to be added as a reference to use the control in any application. + +The [CurrencyTextBox](https://www.syncfusion.com/wpf-controls/currency-textbox) control allows you to increase or decrease the value by pressing up-arrow and down-arrow keys on the keyboard or by scrolling the mouse wheel over the control. The [ScrollInterval](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_ScrollInterval) property is used to specify the increment or decrement interval. The default value of `ScrollInterval` is 1. For example, the `ScrollInterval` value is set to 4. So, that the `CurrencyTextBox` control [Value](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.CurrencyTextBox.html#Syncfusion_Windows_Shared_CurrencyTextBox_Value) increases or decreases by 4 while pressing Up arrow or Down arrow keys and Mouse wheel scrolling up or down. @@ -39,7 +43,7 @@ currencyTextBox.ScrollInterval = 3; ## Change Value on Mouse Wheel -The `CurrencyTextBox` allows you to increase or decrease the `Value` based on the `ScrollInterval` by the Mouse scrolling over the control When the [IsScrollingOnCircle](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.Editorbase.html#Syncfusion_Windows_Shared_EditorBase_IsScrollingOnCircle) property is `true`. The default value of `IsScrollingOnCircle` property is `true`. +The `CurrencyTextBox` allows you to increase or decrease the `Value` based on the `ScrollInterval` by scrolling the mouse wheel over the control when the [IsScrollingOnCircle](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_IsScrollingOnCircle) property is `true`. The default value of `IsScrollingOnCircle` is `true`. {% tabs %} {% highlight XAML %} @@ -87,9 +91,9 @@ currencyTextBox.EnableExtendedScrolling = true; ![Changing Value by Clicking and Drag in WPF CurrencyTextBox](Step-Interval_images/wpf-currency-textbox-drag-and-drop.gif) -## Allow or restrict selection on focus +## Allow or Restrict Selection on Focus -`CurrencyTextBox` allows you to automatically select text by setting [TextSelectionOnFocus](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_TextSelectionOnFocus) property to `true` and when the control got focus. If you want to restrict the selection on when control got focus, use the `TextSelectionOnFocus` property value as `false`. The default value of the `TextSelectionOnFocus` property is `true`. +`CurrencyTextBox` allows you to automatically select its text when the control receives focus by setting the [TextSelectionOnFocus](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Shared.EditorBase.html#Syncfusion_Windows_Shared_EditorBase_TextSelectionOnFocus) property to `true`. If you want to restrict text selection on focus, set `TextSelectionOnFocus` to `false`. The default value of the `TextSelectionOnFocus` property is `true`. {% tabs %} {% highlight XAML %} @@ -100,7 +104,12 @@ currencyTextBox.EnableExtendedScrolling = true; {% highlight C# %} CurrencyTextBox currencyTextBox = new CurrencyTextBox(); -currencyTextBox.TextSelectionOnFocus = true; +currencyTextBox.Width = 150; +currencyTextBox.Height = 25; +currencyTextBox.TextSelectionOnFocus = false; + +// Add the CurrencyTextBox to an existing container, for example: +this.Content = currencyTextBox; {% endhighlight %} {% endtabs %} @@ -112,3 +121,8 @@ currencyTextBox.TextSelectionOnFocus = true; **TextSelectionOnFocus = "True"** ![WPF CurrencyTextBox displays Text Selection](Step-Interval_images/wpf-currency-textbox-text-selection.png) + +## See Also + +* [Getting Started](Getting-Started.md) +* [Changing Currency Value](Changing-Currency-Value.md) diff --git a/wpf/Tabbed-MDI-Form/Adding-and-Removing-Items-from-the-Document-Container-Control.md b/wpf/Tabbed-MDI-Form/Adding-and-Removing-Items-from-the-Document-Container-Control.md index 12d6ca4e2c..c8d017e9b1 100644 --- a/wpf/Tabbed-MDI-Form/Adding-and-Removing-Items-from-the-Document-Container-Control.md +++ b/wpf/Tabbed-MDI-Form/Adding-and-Removing-Items-from-the-Document-Container-Control.md @@ -1,46 +1,55 @@ --- layout: post title: Adding and Removing Items from the WPF Tabbed MDI Form | Syncfusion® -description: Learn here all about Adding and Removing Items from the Document Container Control support in Syncfusion® WPF Tabbed MDI Form control and more. +description: Learn here all about Adding and Removing Items from the Document Container Control support in Syncfusion® WPF Tabbed MDI Form (DocumentContainer) control and more. platform: WPF -control: Tabbed MDI Form +control: DocumentContainer documentation: ug --- # Adding and Removing Items from the WPF Tabbed MDI Form control -This topic illustrates how to add and remove items from Document Container control. +## Assembly Deployment -## Adding items +Refer to the [control dependencies](https://help.syncfusion.com/wpf/control-dependencies#documentcontainer) section to get the list of assemblies or NuGet package that needs to be added as a reference to use the control in any application. -Document Container allows the user to add new elements to its container(such as button, text block), using Items.Add method. Use the following code snippet, for calling this method. +This topic illustrates how to add and remove items from the DocumentContainer control. +## Adding Items +The DocumentContainer allows you to add new elements (such as a `Button` or `TextBlock`) to its container by using the `Items.Add` method. Use the following code snippet to add an item. {% tabs %} -{% highlight xaml %} - - +{% highlight XAML %} + + - - +