ClearValue is a method in the System.Windows.DependencyProperty structure which is used in WPF applications to clear a dependency property value from a dependency object. When ClearValue is called, it removes any local value that may exist and sets the property to its default value, which is usually null.
Here is an example of ClearValue being used in C# code to reset the TextBlock's Text property to its default value:
// Get the TextBlock object TextBlock myTextBlock = (TextBlock)FindName("myTextBlock");
// Clear the Text property value myTextBlock.ClearValue(TextBlock.TextProperty);
This will reset the Text property value of the myTextBlock object to null.
ClearValue method is part of the WindowsBase.dll library included in the .NET framework.
C# (CSharp) this.ClearValue - 28 examples found. These are the top rated real world C# (CSharp) examples of this.ClearValue extracted from open source projects. You can rate examples to help us improve the quality of examples.