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
Has been working as a C# developer on contract for the last several years, including 3 years at Microsoft. Previously worked with Visual Basic and Microsoft Access VBA, and have developed code for Word, Excel and Outlook. Started working with WPF in 2007 when part of the Microsoft WPF team. For the last eight years has been working primarily as a senior WPF/C# and Silverlight/C# developer. Currently working as WPF developer with BioNano Genomics in San Diego, CA redesigning their UI for their camera system. he can be reached at qck1@hotmail.com.