Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to cast object of type 'MS.Internal.NamedObject' to
Message
From
08/03/2013 15:55:54
 
 
To
All
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
Unable to cast object of type 'MS.Internal.NamedObject' to
Miscellaneous
Thread ID:
01567887
Message ID:
01567887
Views:
85
In Visual Studio 2010, I have a XAML screen with a textbox defined like this:
                        < TextBox  Name="txtBalanceOutstanding"
                                  Grid.Row="9" Grid.Column="1" Grid.ColumnSpan="1" Height="23" 
                                  HorizontalAlignment="Stretch" Margin="0,0,100,0" 
                                  IsReadOnly="True" FontWeight="Bold" Focusable="False" VerticalContentAlignment="Center" >

                        < /TextBox >
When I change it to this (adding in the MultiBinding):
                        <TextBox  Name="txtBalanceOutstanding"
                                  Grid.Row="9" Grid.Column="1" Grid.ColumnSpan="1" Height="23" 
                                  HorizontalAlignment="Stretch" Margin="0,0,100,0" 
                                  IsReadOnly="True" FontWeight="Bold" Focusable="False" VerticalContentAlignment="Center">
                            <MultiBinding Converter="{StaticResource OutstandingBalanceConverter}">
                                <Binding ElementName="txtDepositTotal" Path="Text"></Binding>
                                <Binding ElementName="txtDep_Amount" Path="Text"></Binding>
                            </MultiBinding>
                        </TextBox>
The screen designer shows an unhandled exception error has occurred:

Unable to cast object of type 'MS.Internal.NamedObject' to type 'System.String'.
at System.Linq.Enumerable.< CastIterator >d__b1`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at SamaanSystems.IBC.WPF.OutstandingBalanceConverter.Convert(Object[] values, Type targetType, Object parameter, CultureInfo culture) in D:\Development\VS2010\IBC\IBC WPF\Converters\OutstandingBalanceConverter.cs:line 13
at System.Windows.Data.MultiBindingExpression.TransferValue()
at System.Windows.Data.MultiBindingExpression.Transfer()
at System.Windows.Data.MultiBindingExpression.UpdateTarget(Boolean includeInnerBindings)
at System.Windows.Data.MultiBindingExpression.AttachToContext(Boolean lastChance)
at System.Windows.Data.MultiBindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
at MS.Internal.Data.DataBindEngine.Run(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

Any idea what I'm doing wrong?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Next
Reply
Map
View

Click here to load this message in the networking platform