RisingSunStudios
Topic Author
Posts: 6
Joined: 12 Apr 2020, 09:56

Help getting started with Blend

12 Jan 2022, 21:27

Hi,

I tried out NoesisGUI few years back and want to pick it up again. However I'm unable to get the blend Xaml to compile - specifically the <i:EventTrigger elements.

I started off with errors about missing Interactivity dll's, so added some nuget packages for those. I'm still getting errors "specified value cannot be assigned to the collection. The following type was expected: "TriggerBase".

The code in question is taken from the Menu3D sample.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions"
                    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
                    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
                    >
    <Style x:Key="SettingContentStyle" TargetType="{x:Type HeaderedContentControl}">
    ...
        <Setter Property="noesis:StyleInteraction.Triggers">
            <Setter.Value>
                <noesis:StyleTriggerCollection>
                    <i:EventTrigger EventName="MouseEnter">
                        <noesis:SetFocusAction TargetObject="{Binding Content, RelativeSource={RelativeSource AncestorType={x:Type HeaderedContentControl}}}"/>
                    </i:EventTrigger>
                </noesis:StyleTriggerCollection>
            </Setter.Value>
        </Setter>
    </Style>
Spent few hours on this already with no luck, so can anyone help give me some instruction?

What version of VS Blend should I be using? (I'm using VS2017)
What version of .NET should the project be targetting? It defaulted to 4.8.
What extra Nuget packages do I need to include in the project created from the "Open Blend Project" from Unity? I added NoesisGUIExtensions and https://www.nuget.org/packages/Expressi ... WPF/1.0.1

Is there anything else I need to do? I have even tried registering the System.windows.Interactivity.dll with gacutil but still same error.
Thanks,
 
RisingSunStudios
Topic Author
Posts: 6
Joined: 12 Apr 2020, 09:56

Re: Help getting started with Blend

13 Jan 2022, 10:31

I think I may have found the solution to my issue. It looks like I was refering to an out-dated sample of Menu3D. I found this commit https://github.com/Noesis/Tutorials/com ... e7d929da95 that I should be using instead.

My bad!
 
User avatar
sfernandez
Site Admin
Posts: 3033
Joined: 22 Dec 2011, 19:20

Re: Help getting started with Blend

14 Jan 2022, 10:50

Hello, sorry for the late answer and your initial struggle, we've updated all the Unity samples in our GitHub to address these problems.

They were occurring because we changed our Noesis.GUI.Extension nuget in a recent version to use the official Microsoft.Xaml.Behaviors.Wpf package, which changed the namespaces where all the interactivity classes were defined.

So the changes we had to make to the samples were to replace the occurrences of:
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
to
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
And also replace the uses of the prefixes i: and ei: to the corresponding b:
What version of VS Blend should I be using? (I'm using VS2017)
What version of .NET should the project be targetting? It defaulted to 4.8.
What extra Nuget packages do I need to include in the project created from the "Open Blend Project" from Unity?
The project created from that menu entry includes our Noesis.GUI.Extensions nuget and you shouldn't need anything else (taking into account my previous comment about the interactivity namespaces). And it works in Blend 2017 and later versions. If you find any other trouble with it please let us know.

Who is online

Users browsing this forum: Google [Bot] and 11 guests