- MattNiznak
- Posts: 8
- Joined:
Trouble with implementing behaviors
Code: Select all
[NOESIS/E] DragTest.xaml(14): Unknown type 'NoesisApp.Interaction'.
<ContentControl>
<i:Interaction.Behaviors>
<local:DropItemBehavior/>
</i:Interaction.Behaviors>
<Grid Height="320" HorizontalAlignment="Center" Margin="129,12" Width="245" VerticalAlignment="Center">
<Rectangle Stroke="Black" AllowDrop="True" Fill="Black" />
<TextBlock Text="Black" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White"/>
</Grid>
</ContentControl>
Code: Select all
NsRegisterComponent<Test::DropItemBehavior>();
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Trouble with implementing behaviors
Hi, interactivity classe are part of NoesisApp.dll, so if you don't link against that library you need to copy interactivity code files to your application and register the components in the factory before you can use them from xaml. I explained this in the following post: viewtopic.php?f=3&t=1893#p10663
Re: Trouble with implementing behaviors
We recommend just including all the needed NoesisApp files from a single cpp file and then registering them. You can use NoesisApp::Launcher::RegisterAppComponents() for that or just make your own version.
This thread may be useful: viewtopic.php?f=3&t=1636
This thread may be useful: viewtopic.php?f=3&t=1636
- MattNiznak
- Posts: 8
- Joined:
Re: Trouble with implementing behaviors
Thanks for that. I still have issues with adding the files, themselves. I get a ton of inconsistent dll linkage errors. Does this mean I need to remove the 'NS_APP_INTERACTIVITY_API' tag from the classes?
- MattNiznak
- Posts: 8
- Joined:
Re: Trouble with implementing behaviors
Nevermind. I figured out that adding to Interactivityapi.h fixes the dll linkage problem.
Code: Select all
#define NS_APP_INTERACTIVITY_PRIVATE
Re: Trouble with implementing behaviors
Yes, sorry about that. We did minor changes in 3.0 to have this more clear:
So, in 3.0 just include all the needed files from a single .cpp and define NS_APP_INTERACTIVITY_API to empty.
Code: Select all
#ifndef __APP_INTERACTIVITYAPI_H__
#define __APP_INTERACTIVITYAPI_H__
#include <NsCore/CompilerSettings.h>
#ifndef NS_APP_INTERACTIVITY_API
#define NS_APP_INTERACTIVITY_API NS_DLL_IMPORT
#endif
#endif
Who is online
Users browsing this forum: Bing [Bot] and 7 guests