Posts

Showing posts with the label Binding

Binding Only Part Of The Margin Property Of WPF Control

Answer : Have you tried using a converter like this? in VB.Net Public Class MarginConverter Implements IValueConverter Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.Convert Return New Thickness(0, CDbl(value), 0, 0) End Function Public Function ConvertBack(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements System.Windows.Data.IValueConverter.ConvertBack Return Nothing End Function End Class Or in C# public class MarginConverter : IValueConverter { public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture) { return new Thickness(0, System.Convert.ToDouble(value), 0, 0); } public object ConvertBack(o...