mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-07 07:56:07 +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,30 @@
|
||||
---
|
||||
title: "How to: Clear Bindings"
|
||||
ms.date: "03/30/2017"
|
||||
dev_langs:
|
||||
- "csharp"
|
||||
- "vb"
|
||||
helpviewer_keywords:
|
||||
- "bindings [WPF], clearing"
|
||||
- "clearing bindings [WPF]"
|
||||
- "data binding [WPF], clearing bindings"
|
||||
ms.assetid: 73962a93-32a9-4bcd-9240-bcfbb239093a
|
||||
---
|
||||
# How to: Clear Bindings
|
||||
This example shows how to clear bindings from an object.
|
||||
|
||||
## Example
|
||||
To clear a binding from an individual property on an object, call <xref:System.Windows.Data.BindingOperations.ClearBinding%2A> as shown in the following example. The following example removes the binding from the <xref:System.Windows.Controls.TextBlock.TextProperty> of *mytext*, a <xref:System.Windows.Controls.TextBlock> object.
|
||||
|
||||
[!code-csharp[CodeOnlyBinding#ClearBinding](~/samples/snippets/csharp/VS_Snippets_Wpf/CodeOnlyBinding/CSharp/binding.cs#clearbinding)]
|
||||
[!code-vb[CodeOnlyBinding#ClearBinding](~/samples/snippets/visualbasic/VS_Snippets_Wpf/CodeOnlyBinding/VisualBasic/App.vb#clearbinding)]
|
||||
|
||||
Clearing the binding removes the binding so that the value of the dependency property is changed to whatever it would have been without the binding. This value could be a default value, an inherited value, or a value from a data template binding.
|
||||
|
||||
To clear bindings from all possible properties on an object, use <xref:System.Windows.Data.BindingOperations.ClearAllBindings%2A>.
|
||||
|
||||
## See also
|
||||
|
||||
- <xref:System.Windows.Data.BindingOperations>
|
||||
- [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