'NotEqual' is not a valid value for property NoesisApp.DataTrigger.Comparison.
Hi. I am trying to change the visibility property of a view according to events.
I have this code in the xaml file. I use the Menu3D sample as a guide.
Why this error appears and how I can solve it?
I have this code in the xaml file. I use the Menu3D sample as a guide.
Code: Select all
<i: Interaction.Triggers>
<ei: DataTrigger Binding = "{Binding State}" Comparison = "NotEqual" Value = "{x: Local Static: State.MainMenu}">
<ei: ChangePropertyAction PropertyName = "Visibility" Value = "Hidden" />
</ ei: DataTrigger>
<ei: DataTrigger Binding = "{Binding State}" Comparison = "Equal" Value = "{x: Local Static: State.MainMenu}">
<ei: ChangePropertyAction PropertyName = "Visibility" Value = "Visible" />
</ ei: DataTrigger>
</i:Interaction.Triggers>
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: 'NotEqual' is not a valid value for property NoesisApp.DataTrigger.Comparison.
I assume you are including Interactivity source code in your game/app, or linking against NoesisApp.lib. And registering all the components from that package: viewtopic.php?f=3&t=1893#p10663 or viewtopic.php?f=3&t=1893&start=10#p10664
Anyway, I see you are setting Value property with "{x:Local Static:State.MainMenu}", that is not correct, it should be:
The markup extension is x:Static, then you specify the static type member with Local:State.MainMenu. "Local" prefix is replaced during xaml parse with the specified namespace to resolve the type name, in this case will be "YourNamespace.State". If that type is an enum, then "MainMenu" will be one of the values of the enum.
Anyway, I see you are setting Value property with "{x:Local Static:State.MainMenu}", that is not correct, it should be:
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Local="clr-namespace:YourNamespace">
<i: Interaction.Triggers>
<ei:DataTrigger Binding="{Binding State}" Comparison="NotEqual" Value="{x:Static Local:State.MainMenu}">
<ei:ChangePropertyAction PropertyName="Visibility" Value="Hidden" />
</ei:DataTrigger>
<ei:DataTrigger Binding="{Binding State}" Comparison="Equal" Value="{x:Static Local:State.MainMenu}">
<ei:ChangePropertyAction PropertyName="Visibility" Value="Visible" />
</ei:DataTrigger>
</i:Interaction.Triggers>
</Grid>Re: 'NotEqual' is not a valid value for property NoesisApp.DataTrigger.Comparison.
Thanks for the help. the error was I did not add this component
Code: Select all
Noesis::RegisterComponent<Noesis::EnumConverter<NoesisApp::ComparisonConditionType>>();Re: 'NotEqual' is not a valid value for property NoesisApp.DataTrigger.Comparison.
Great! Marking this as solved.
Who is online
Users browsing this forum: DuckDuckGo [Bot], Google [Bot] and 3 guests