I am trying to check out the AutoSalesDashboard.
First problem was that it wouldn't compile - looks like it was expecting a different build version of the Infragistics DLL in the project than was delivered with the ZIP. I removed all references and added back from my installed version and compile and run works OK now.
However, when I try to open DashboardView.xaml in VS designer it throws an exception :
System.InvalidCastExceptionUnable to cast object of type 'System.Windows.Data.Binding' to type 'System.IConvertible'.at System.Convert.ToDouble(Object value) at AutoSalesDashboard.Converters.ValueToStringFormatConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture) in C:\Users\brian.AVC\Downloads\NetAdvantage_Silverlight_Showcase_AutoSalesDashboard_Source\AutoSalesDashboard\Converters\ValueToStringFormatConverter.cs:line 46
Is it normal for this to be thrown at design time?
Any way to view the XAML in the designer?
Hello,
I am just checking if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thank you for your post. I have been looking into the error that you have described and it seems that the reason for it is that the System.Convert.ToDouble is used with the value parameter in the Convert method of the ValueToStringFormatConverter class. It seems that the binding is triggered when the design is used and the cast error is appearing. You can change the convert method of the ValueToStringFormatConverter class as follows in order to avoid the designer issue:
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value != null && value is double) { double v = (double)value; if (v != 0 && v / 1000 > 1) { return "#,##0, K"; } } return ""; }
Also I can suggest using Microsoft Expression Blend when you wish to see the change the application’s appearance, design time, since the Expression Blend is a designer oriented IDE. Using Expression Blend Preview for Silverlight 5, the DashboardView of AutoSalesDashboard sample application is displaying without any errors to appear.
Please let me know if you need any further assistance on the matter.