iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
In your example about MVVM you have some code in the Codebehind file, to create an in stance of the ViewModelBase ... Is it possible to create the instance of the ViewModelBase only via XMAL?
Thx for help
Hello Klaus,
It is impossible to create an instance of the ViewModelBase only via XAML, because based on MVVM (Model-View-ViewModel) pattern definition, we have to separate Model, View, and ViewModel.
The View responsible to displaying and collecting data form end users. It is not responsible for retreiving data and business rules(validating data).The ViewModel responsible to aggregating and storing data which will be bound to a View.In brief, on MVVM pattern, the View doesn't have to worry about retreiving data and know where data comes from.
Hope this helps.Riendy
Regards,Riendy
I'm apologize if my post did not answer your question.
Let me clarify my answer, to create an instance of the ViewModel, we have to input user interaction logic using ViewModel layer (i.e. CustomersViewModel.cs) and then we instantiate the ViewModel in the XAML, not in code behind.
i.e.
<Intersoft:UXPage.Resources> <ViewModels:CustomersViewModel x:Key="CustomersViewModel"/> ... </Intersoft:UXPage.Resources><Grid x:Name="LayoutRoot" DataContext="{StaticResource CustomersViewModel}"></Grid>
Could you please let me know which particular code of MVVM sample(to create an instance of the ViewModelBase) that you found in code behind?
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname