mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-07 23:43:19 +02:00
Initial WPF content migrated (#17)
* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: "How to: Bind to an Enumeration"
|
||||
ms.date: "03/30/2017"
|
||||
helpviewer_keywords:
|
||||
- "binding data [WPF], enumeration"
|
||||
- "data binding [WPF], enumeration"
|
||||
- "enumeration [WPF]"
|
||||
ms.assetid: b9091eba-1119-424e-868b-d1a4168b3732
|
||||
---
|
||||
# How to: Bind to an Enumeration
|
||||
This example shows how to bind to an enumeration by binding to the enumeration's GetValues method.
|
||||
|
||||
## Example
|
||||
In the following example, the <xref:System.Windows.Controls.ListBox> displays the list of <xref:System.Windows.HorizontalAlignment> enumeration values through data binding. The <xref:System.Windows.Controls.ListBox> and the <xref:System.Windows.Controls.Button> are bound such that you can change the <xref:System.Windows.FrameworkElement.HorizontalAlignment%2A> property value of the <xref:System.Windows.Controls.Button> by selecting a value in the <xref:System.Windows.Controls.ListBox>.
|
||||
|
||||
[!code-xaml[BindToEnum#BindToEnum](~/samples/snippets/csharp/VS_Snippets_Wpf/BindToEnum/CS/Window1.xaml#bindtoenum)]
|
||||
|
||||
## See also
|
||||
|
||||
- [Bind to a Method](how-to-bind-to-a-method.md)
|
||||
- [Data Binding Overview](/dotnet/desktop-wpf/data/data-binding-overview)
|
||||
- [How-to Topics](data-binding-how-to-topics.md)
|
||||
Reference in New Issue
Block a user