C++ ViewModel Clarification
Hey ya'll,
First of all, my first impressions are super positive; this tool looks great, and I'm really keen to get into it! Also the samples are slick - the Engineering sample is perfect for parts of my current project.
I just wanted to clarify the intended/future workflow for C++-based stacks with Noesis + Studio. Obviously there's no SDK access in this release, and I totally get that as it's in Alpha. For now, I presume we should just mock up the ViewModels we have using the in-app UI-driven control and/or hand-editing XML files? And in future, will those XML files be generated via the API somehow? Just wondering how far to go with hand-mocking everything right now if that approach will be superseded in the near future.
Congrats on the release!
First of all, my first impressions are super positive; this tool looks great, and I'm really keen to get into it! Also the samples are slick - the Engineering sample is perfect for parts of my current project.
I just wanted to clarify the intended/future workflow for C++-based stacks with Noesis + Studio. Obviously there's no SDK access in this release, and I totally get that as it's in Alpha. For now, I presume we should just mock up the ViewModels we have using the in-app UI-driven control and/or hand-editing XML files? And in future, will those XML files be generated via the API somehow? Just wondering how far to go with hand-mocking everything right now if that approach will be superseded in the near future.
Congrats on the release!
Re: C++ ViewModel Clarification
Thank you for the kind words!
We have two different workflows in mind for Design-Time ViewModels in Studio:
1. Programmer-Created ViewModel: In this workflow, the programmer creates a C++ ViewModel, which is then exposed via reflection to Studio for use at design time. The main disadvantages of this approach are that it requires extending Noesis Studio (it won’t work with the vanilla version or the current alpha), and designers must wait for programmers to create the ViewModel, leading to inefficiencies in the workflow. This workflow will be supported and we don't plan to deprecate it.
2. Designer-Created ViewModel: In the second workflow, designers create the design-time ViewModels. When these ViewModels are needed at runtime, they are recreated in C++. This recreation can be done manually or by using a script that parses the XML stored in the .noesis folder and generates native code. We could also expose an extensible API to invoke the conversion of the ViewModel using a contextual menu in Studio, and why not, provide defaults converters for C++ and C# at least.
We have two different workflows in mind for Design-Time ViewModels in Studio:
1. Programmer-Created ViewModel: In this workflow, the programmer creates a C++ ViewModel, which is then exposed via reflection to Studio for use at design time. The main disadvantages of this approach are that it requires extending Noesis Studio (it won’t work with the vanilla version or the current alpha), and designers must wait for programmers to create the ViewModel, leading to inefficiencies in the workflow. This workflow will be supported and we don't plan to deprecate it.
2. Designer-Created ViewModel: In the second workflow, designers create the design-time ViewModels. When these ViewModels are needed at runtime, they are recreated in C++. This recreation can be done manually or by using a script that parses the XML stored in the .noesis folder and generates native code. We could also expose an extensible API to invoke the conversion of the ViewModel using a contextual menu in Studio, and why not, provide defaults converters for C++ and C# at least.
-
- a.lashkevich
- Posts: 21
- Joined:
Re: C++ ViewModel Clarification
Hi jsantos,
Could you please clarify a bit about the second workflow? Do you have a view model converter from XAML to C++, or is your team only planning to implement it? Could you share any details or timelines regarding when it might be available for use?
Thanks
Could you please clarify a bit about the second workflow? Do you have a view model converter from XAML to C++, or is your team only planning to implement it? Could you share any details or timelines regarding when it might be available for use?
Thanks
Re: C++ ViewModel Clarification
Created view models are available in .noesis/data/structures. You can easily parse each file and convert them to C++:
We are still determining how to expose a callback in Studio to invoke custom scripts for this process. However, this is currently a low-priority task.
Code: Select all
<Class Name="ProjectInfo">
<Property Name="Name" Type="String" StringMinWordCount="0" StringMaxWordCount="10"/>
<Property Name="Path" Type="String" StringMinWordCount="0" StringMaxWordCount="10"/>
<Property Name="IsNew" Type="Boolean"/>
</Class>
-
- a.lashkevich
- Posts: 21
- Joined:
Re: C++ ViewModel Clarification
thanks for anwer, sorry, I'm new in xaml, could you please describe how to convert xaml view models to C++ ? I didn't find example in samples folder
Re: C++ ViewModel Clarification
For the ViewModel mentioned above, you can generate the following code:
You can find more information about C++ reflection in the Reflection section of the C++ Architecture Guide.
The Data Binding sample included in the SDK is also a great resource for learning about binding view models.
Code: Select all
class ProjectInfo: public BaseComponent
{
public:
String _name;
String _path;
bool _isNew;
private:
NS_IMPLEMENT_INLINE_REFLECTION(ProjectInfo, BaseComponent)
{
NsProp("Name", &ProjectInfo::_name);
NsProp("Path", &ProjectInfo::_path);
NsProp("IsNew", &ProjectInfo::_isNew);
}
};
The Data Binding sample included in the SDK is also a great resource for learning about binding view models.
Who is online
Users browsing this forum: No registered users and 1 guest