Introduction
I have had many cases when I have worked with third party controls from companies such as Infragistics and Telerik, and have wanted to create some functionality, and have not known enough about the objects I am using to be able to do it. These objects can be extremely complex, which actually can be very good since there is a lot of data that can be tapped to accomplish some special functionality. This also makes them difficult to understand, and there is little on the internet about them. Since these controls are not visible in the normal debugger, I have bound a value to a simple IValueConverter
and inserted a breakpoint in the converter so that I could investigate the data that I am bound to. This has allowed to then refine the binding, and create the functionality I need. I have also used this converter when I did not understand why the binding was not working correctly.
The Code
#region using statements
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;
#endregion
public sealed class TestConverter : MarkupExtension, IValueConverter
{
public TestConverter() { }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return value;
}
public override object ProvideValue(IServiceProvider serviceProvider) { return this; }
}
History
- 11/21/2015 Initial version