Tom, thanks for your reply. Your suggestions make a lot of sense and have, I feel, pointed me in the right direction. Although I think I'm messing up on step 6! This is what I've done so far:
TJoe wrote:
1. Create a separate class (e.g. ScaleFactor) with a single property (e.g. Value) 2. Implement INotifyPropertyChanged in the ScaleFactor class and fire it when the Value changes.
public class VisualScale : INotifyPropertyChanged
{
private double scale = 1.0;
public double ScalingFactor
{
get { return scale; }
set { scale = value; NotifyPropertyChanged("Scale changed"); }
}
#region INotifyPropertyChanged Members
private void NotifyPropertyChanged(String info)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
public event PropertyChangedEventHandler PropertyChanged;
#endregion
}
TJoe wrote:
3. Create an IMultiValueConverter that takes two values: 1st will be the "value" from your underlying data (you don't have to use a TypeConverter, but you probably can), 2nd will be the scale factor. The IMultiValueConverter will then multiply the two values and return that.
public class WidthScaler : IMultiValueConverter
{
#region IMultiValueConverter Members
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if ( targetType != typeof(double) )
{
throw new NotSupportedException("Target type of WidthScaler must be double");
}
if ( values.Length != 2 ||
&nb