WPF and theMVVM pattern

WPF and theMVVM pattern

Old forum URL: forums.lhotka.net/forums/t/10659.aspx


cconte posted on Thursday, September 01, 2011

Hi folks,

Software: CSLA 4.1 – VS2010

After I have read the CSLA Expert C# 2008 Business Objects, watched CSLA 4 MVVM Video Series and practiced some CSLA with WinForm, I ‘m testing myself to create a small WPF demo in order to understand the basics (MVVM pattern) before starting the serious project.

I have chosen to develop in WPF, because the future application will need to interact with a client-side peripheral and you use a client-side database.

Here my issue: I have tried to design a small demo by inspiration of the the SLDemo but without success so far. I have spent almost 2 day to found out what I’m doing wrong. Its looks like that the XAML form is not bind with the ViewModel. So, I have got no presentation data and the triggerActions dont call any methods (Save, Cancel).

I’m wondering is someone could have a look at the code attached below to teach me what I’m missing, or send me a small app sample (WPF/MVVP) to learn how to make it right.

[View:http://forums.lhotka.net/cfs-file.ashx/__key/CommunityServer.Components.UserFiles/00.00.01.26.90/WpfDemo.zip]

Thanks a lot in advance for your help,

Best regards,

Cedric

emathias replied on Tuesday, September 06, 2011

Cedric,

Take a closer look at the way Rocky sets the DataContext in the SIDemo project.  I think that will get you on your way.  Sorry about the brevity but I'm at work.

Ed

 

 

csmith1 replied on Tuesday, September 06, 2011

I looked at your project. I think you should look at few of the CSLA samples out there.

It looks like you are missing some key components MVVM. I think that CSLA MVVMexperiment sample maybe helpful to you.

Also the projecttracker is a very good sample.

Good Luck

 

 

 

csmith1 replied on Wednesday, September 07, 2011

I can't over emphasize how much a code generator will help you. I use CodeSmith. 

cconte replied on Monday, September 12, 2011

Thanks for your answers. Actually, the big problem was from my poor understanding of xaml binding.

Best regards,

Cédric

Copyright (c) Marimer LLC