<Border x:Name="
<Border.
<Binding
<Binding.
<Conve
Binding.
Binding>
Border.
…
Border>
namespace CheviotConsulting.Common.Silverlight.Converters
{
using System.Windows;
using System.Windows.Data;
///
/// Exposes aCornerRad ius instance configuredfor a ValuationProgressButton
///
public class DynamicCornerRadiusConverter : IValueConverter
{
///
/// Gets or sets thetop left.
///
///The top left.
public double TopLeft{ get; set; }
///
/// Gets or sets thetop right.
///
///The top right.
public doubleTopRight { get; set; }
///
/// Gets or sets thebottom left.
///
///The bottom left.
public doubleBottomLeft { get; set; }
///
/// Gets or sets thebottom right.
///
///The bottom right.
public doubleBottomRight { get; set; }
///
/// Gets the cornerradius.
///
/// The resourcesource.
///the corner radius
private CornerRadiusGetCornerRadius( FrameworkElement resourceSource)
{
var result = new CornerRadius (this.TopLeft, this.TopRight, this.BottomRight, this .BottomLeft);
return result;
}
///
/// Modifies thesource data before passing it to the target for display in the UI.
///
/// The source data beingpassed to the target.
/// Theof data expected by the target dependency property.
/// An optionalparameter to be used in the converter logic.
/// The culture of theconversion.
///
/// The value to bepassed to the target dependency property.
///
public object Convert(object value, System.TypetargetType, object parameter,System.Globalization. CultureInfo culture)
{
return this.GetCornerRadius(value as FrameworkElement );
}
///
/// Modifies thetarget data before passing it to the source object. This method is called only in cref="F:System.Windows.Data. BindingMode.TwoWay"/> bindings.
///
/// The target data beingpassed to the source.
/// Theof data expected by the source object.
/// An optionalparameter to be used in the converter logic.
/// The culture of theconversion.
///
/// The value to bepassed to the source object.
///
public objectConvertBack( object value,System. Type targetType, objectparameter, System. CultureInfoGlobalization. culture)
{
throw new System.NotImplementedException ();
}
}
}
No comments:
Post a Comment