MultiBinding with custom converter
Hello, I always get an error on startup if I use my own converters:
But it works fine at runtime.
This xaml has an error:
But this does not have an error:
How can I fix this errors?
Code: Select all
MultiBinding converter failed to convert source values
This xaml has an error:
Code: Select all
<UserControl.Resources>
<ResourceDictionary>
<converters:MultiplyConverter x:Key="multiplyConverter" />
</ResourceDictionary>
</UserControl.Resources>
<StackPanel>
<Rectangle
x:Name="Rectangle2"
Width="100"
Height="100"
Fill="#FF991919" />
<Rectangle
x:Name="Rectangle3"
Width="2"
Height="100"
Fill="#FF991919" />
<TextBlock Width="100" Height="20">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource multiplyConverter}">
<Binding ElementName="Rectangle2" Path="Width" />
<Binding ElementName="Rectangle3" Path="Width" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
Code: Select all
<StackPanel>
<Rectangle
x:Name="Rectangle2"
Width="100"
Height="100"
Fill="#FF991919" />
<Rectangle
x:Name="Rectangle3"
Width="2"
Height="100"
Fill="#FF991919" />
<TextBlock Width="100" Height="20">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} x {1}">
<Binding ElementName="Rectangle2" Path="Width" />
<Binding ElementName="Rectangle3" Path="Width" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
-
-
sfernandez
Site Admin
- Posts: 2910
- Joined:
Re: MultiBinding with custom converter
Do you have any other error/exception message related to the conversion?
That message should appear if your converter code produced an exception or if the returned type is not compatible with the expected target type.
That message should appear if your converter code produced an exception or if the returned type is not compatible with the expected target type.
Re: MultiBinding with custom converter
No, I only have these errors that appear on play and stop Play Mode.
And the converter starts working only after errors. I put Debug.Log on the first line of the Convert method.
And the converter starts working only after errors. I put Debug.Log on the first line of the Convert method.
-
-
sfernandez
Site Admin
- Posts: 2910
- Joined:
Re: MultiBinding with custom converter
Could you please attach the Visual Studio debugger to your Unity project and place a breakpoint in Extend.cs at MultiConverterConvert() function where the exceptions are catched: https://github.com/Noesis/Managed/blob/ ... d.cs#L2497
Let me know if it reaches that breakpoint.
Let me know if it reaches that breakpoint.
Re: MultiBinding with custom converter
I didn't reach the breakpoint at this line.
I stoped UnityLog and I have this stack trace if it helps you:
I stoped UnityLog and I have this stack trace if it helps you:
Code: Select all
at NoesisUnity.UnityLog (System.Int32 level, System.String message) [0x000cc] in D:\repos\gitlab\redesign\Library\PackageCache\com.noesis.noesisgui@36e5d70d8b\Runtime\NoesisUnity.cs:357
at Noesis.NoesisGUI_PINVOKE.BaseComponent_Release (System.IntPtr jarg1) [0x00000] in <b004b4282955404e8782c65a225b7356>:0
at Noesis.BaseComponent.Release (System.IntPtr cPtr) [0x00001] in D:\repos\gitlab\redesign\Library\PackageCache\com.noesis.noesisgui@36e5d70d8b\Runtime\API\Proxies\BaseComponent.cs:62
at Noesis.Extend.ReleasePending () [0x00023] in D:\repos\gitlab\redesign\Library\PackageCache\com.noesis.noesisgui@36e5d70d8b\Runtime\API\Core\Extend.cs:5473
at Noesis.Extend.Shutdown () [0x0013c] in D:\repos\gitlab\redesign\Library\PackageCache\com.noesis.noesisgui@36e5d70d8b\Runtime\API\Core\Extend.cs:91
at Noesis.Extend.OnDomainUnload (System.Object sender, System.EventArgs e) [0x00001] in D:\repos\gitlab\redesign\Library\PackageCache\com.noesis.noesisgui@36e5d70d8b\Runtime\API\Core\Extend.cs:36
at System.AppDomain.DoDomainUnload () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
-
-
sfernandez
Site Admin
- Posts: 2910
- Joined:
Re: MultiBinding with custom converter
That log helped, thanks, I was able to reproduce the problem.
I created ticket #2347 in our bugtracker and will fix it for the next release.
I created ticket #2347 in our bugtracker and will fix it for the next release.
Re: MultiBinding with custom converter
Thanks a lot, we look forward to the fix
Re: MultiBinding with custom converter
In Noesis 3.2.2 this error still exists :(
-
-
sfernandez
Site Admin
- Posts: 2910
- Joined:
Re: MultiBinding with custom converter
Are you getting the same error message "MultiBinding converter failed to convert source values" when entering play mode?
Is the callstack of the log the same as the one attached above? If not, could you please open a ticket in our bugtracker and provide that information.
Thanks.
Is the callstack of the log the same as the one attached above? If not, could you please open a ticket in our bugtracker and provide that information.
Thanks.
Re: MultiBinding with custom converter
Yes.Are you getting the same error message "MultiBinding converter failed to convert source values" when entering play mode?
Is the callstack of the log the same as the one attached above?
Code: Select all
[NOESIS/E] 'UILayoutMaskToVisibilityConverter' MultiBinding converter failed to convert source values
UnityEngine.Debug:LogError (object,UnityEngine.Object)
NoesisUnity:UnityLog (int,string) (at ./Library/PackageCache/com.noesis.noesisgui@4e761addad/Runtime/NoesisUnity.cs:363)
Noesis.BaseComponent:Release (intptr) (at ./Library/PackageCache/com.noesis.noesisgui@4e761addad/Runtime/API/Proxies/BaseComponent.cs:62)
Noesis.Extend:ReleasePending () (at ./Library/PackageCache/com.noesis.noesisgui@4e761addad/Runtime/API/Core/Extend.cs:6110)
Noesis.Extend:Shutdown () (at ./Library/PackageCache/com.noesis.noesisgui@4e761addad/Runtime/API/Core/Extend.cs:83)
Noesis.Extend:OnDomainUnload (object,System.EventArgs) (at ./Library/PackageCache/com.noesis.noesisgui@4e761addad/Runtime/API/Core/Extend.cs:36)
System.AppDomain:DoDomainUnload ()
Who is online
Users browsing this forum: Ahrefs [Bot] and 0 guests