Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binding to Converter
Message
De
27/06/2013 16:35:52
 
 
À
26/06/2013 07:31:43
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 4.0
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01577175
Message ID:
01577344
Vues:
46
Just bumping this in case everybody missed it. It's still not completely solved. :(

>Update
>
>I solved this. I had not completed the ConvertBack of the converter. When I added that code in and rebuilt the solution it all worked as desired EXCEPT that the designer gives me "An Unhandled Exception has occurred". This is the detail of the error:
>
>System.Reflection.TargetInvocationException
>Exception has been thrown by the target of an invocation.
> at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
> at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
> at System.Delegate.DynamicInvokeImpl(Object[] args)
> 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)
>
>
>System.NullReferenceException
>Object reference not set to an instance of an object.
> at OakLeaf.MM.Main.mmAppBase.get_DatabaseMgr()
> at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject(String databaseKey, Boolean localDataAccessObject)
> at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject(String databaseKey)
> at OakLeaf.MM.Main.Business.mmBusinessObject.GetDataAccessObject()
> at OakLeaf.MM.Main.Business.mmBusinessObject.CreateParameter(String name, Object value)
> at SamaanSystems.IBC.Business.Receipt.GetReceiptByInvoicePK(Guid invoicePK) in D:\Development\VS2010\IBC\IBC Business Objects\Receipt\Receipt.Partial.cs:line 39
> at SamaanSystems.IBC.WPF.Inv_PkToReceiptNumberConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture) in D:\Development\VS2010\IBC\IBC WPF\Converters\Inv_PkToReceiptNumberConverter.cs:line 21
> at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
> at System.Windows.Data.BindingExpression.Activate(Object item)
> at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
> at System.Windows.Data.BindingExpression.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 MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
> at System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
> at System.Windows.ContextLayoutManager.UpdateLayout()
> at System.Windows.UIElement.UpdateLayout()
> at System.Windows.Interop.HwndSource.SetLayoutSize()
> at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
> at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
> at MS.Internal.DeferredHwndSource.ProcessQueue(Object sender, EventArgs e)
>
>Anyone have a clue what this is trying to tell me?
>
>end of update
>
>Hi,
>
>I am trying to bind a textbox to a converter. This is to display the receipt number that the currently displayed invoice is on. So I set my XAML up like this:
>
>
><Window.Resources>
>        <local:Inv_PkToReceiptNumberConverter x:Key="Inv_PkToReceiptNumberConverter"/>
></Window.Resources>
>
><TextBox Text="{Binding inv_pk, Converter={StaticResource Inv_PkToReceiptNumberConverter}, Mode=Default}" />
>
>But this gives me an error:
>
>"Object reference not set to an instance of an object"
>
>How do I get this to work?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform