Created
November 12, 2012 17:08
-
-
Save Vaccano/4060569 to your computer and use it in GitHub Desktop.
DebugBindings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DebugConverter : IValueConverter | |
{ | |
public static DebugConverter Instance = new DebugConverter(); | |
private DebugConverter() {} | |
#region IValueConverter Members | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
Debugger.Break(); | |
return value; //Binding.DoNothing; | |
} | |
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
Debugger.Break(); | |
return value; //Binding.DoNothing; | |
} | |
#endregion | |
} | |
public class DebugExtension : MarkupExtension | |
{ | |
public override object ProvideValue(IServiceProvider serviceProvider) | |
{ | |
return DebugConverter.Instance; | |
} | |
} | |
//use it like this: | |
//Property="{Binding Value, Converter={namespace:DebugExtension}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment