Page 1 of 1
Unknown property type 'b:Interaction'
Posted: 05 Jul 2024, 11:11
by epfor
hi,
i try to run noesis user control via sdl.
when i try to use <b:Interaction.Triggers> i got error:
Unknown property type 'b:Interaction' (NoesisApp.Interaction) in ../../../../NoesisSDK/Native/Src/Packages/Gui/Core/Src/XamlContext.cpp at line 185
i saw an answer in 2020 that Interactivity classes are an extension that is not part of NoesisGUI is it still relevant?
if so what i need to do to use them?
thanks
Re: Unknown property type 'b:Interaction'
Posted: 05 Jul 2024, 12:09
by sfernandez
Hello,
Interactivity classes are not included in the core library (Noesis.dll), they are part of the public application framework included in the SDK (the source code is available in Src/Packages/App/Interactivity). You have to include the sources in your application and compile them. And when application starts you have to call NsRegisterReflectionAppInteractivity() along with the rest of components you register.
extern "C" void NsRegisterReflectionAppInteractivity();
Please let me know if you find any trouble with it.
Re: Unknown property type 'b:Interaction'
Posted: 08 Jul 2024, 08:53
by epfor
hi,
is there some example which i can look at?
thanks
Re: Unknown property type 'b:Interaction'
Posted: 08 Jul 2024, 13:37
by sfernandez
Have you included (copied) in your project the .h and .cpp files available in our Native SDK at Src/Packages/App/Interactivity?
Do you have any trouble compiling them?
Once those compile fine, you should be able to just include the following in your application startup code where the rest of custom components (controls, converters, etc.) are registered:
extern "C" void NsRegisterReflectionAppInteractivity();
void RegisterComponents()
{
//RegisterComponent<MyUserControl>();
//and all your custom controls
//...
NsRegisterReflectionAppInteractivity();
}
Re: Unknown property type 'b:Interaction'
Posted: 08 Jul 2024, 16:22
by osama
I am trying to do the same thing and having issues compiling the code on Ubuntu 22.04.
To my CMake file I added:
set(NOESIS_PACKAGE_INTERACTION_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/NoesisGUI/Packages/App/Interactivity)
file(GLOB NOESIS_PACKAGE_INTERACTION_SOURCES
${NOESIS_PACKAGE_INTERACTION_DIR}/Src/*.cpp
${NOESIS_PACKAGE_INTERACTION_DIR}/Src/*.h
${NOESIS_PACKAGE_INTERACTION_DIR}/Include/*.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/NoesisGUI/Packages/App/Interactivity/Include
${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/NoesisGUI/Packages/App/MediaElement/Include
)
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES} ${NOESIS_PACKAGE_INTERACTION_SOURCES})
Without adding anything to the code everything compiles just fine. When adding the following I get a linker error.
#include <NsCore/RegisterComponent.h>
extern "C" void NsRegisterReflectionAppInteractivity();
namespace NoesisExample {
cExampleScreen::cExampleScreen(...) {
NsRegisterReflectionAppInteractivity();
}
}
/usr/bin/ld: CMakeFiles/ExampleScreen.dir/cExampleScreen.cpp.o: in function `NoesisExample::cExampleScreen::cExampleScreen(eScreenId, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/tmp/VC_UI_Screens/ExampleScreen/cExampleScreen.cpp:19: undefined reference to `NsRegisterReflectionAppInteractivity'
collect2: error: ld returned 1 exit status
Re: Unknown property type 'b:Interaction'
Posted: 08 Jul 2024, 18:17
by sfernandez
Are you compiling the interactivity classes in a different library where the register method is called? If that is the case you might need to expose a method in that library to register the components.
You can see an example on how we do it in the SDK in the Integration sample:
https://github.com/Noesis/Tutorials/blo ... n.cpp#L225
Re: Unknown property type 'b:Interaction'
Posted: 08 Jul 2024, 19:30
by osama
Are you compiling the interactivity classes in a different library where the register method is called? If that is the case you might need to expose a method in that library to register the components.
You can see an example on how we do it in the SDK in the Integration sample:
https://github.com/Noesis/Tutorials/blo ... n.cpp#L225
I tried compiling it both in another library and inside the same executable, neither method worked.
Re: Unknown property type 'b:Interaction'
Posted: 08 Jul 2024, 20:15
by jsantos
does the integration sample mentioned above compile for you? (it is included in the sdk)
That’s a minimal sample where the app framework (including interactivity) is initialized.