The ViewModel

For simplicity of this sample application, we created a Folder called Patients inside Views

clip_image001

 

And put all the View Models class inside there

clip_image002

Let's take a quick look at one of those ViewModels.

The ViewModel for Patients

clip_image003

We use a class for the Async Load of the data that takes 3 parameters

1. The Ria Services Domain Context to be used to load the data

2. The Query where we tell what Patiends to load..  This is critical, this is why we don't include the related tables on the ria services class, instead we tell ria to go look for specific data without having to load ALL DATA and make all that data to travel on the web.

3. The results of the operation.. Did it succeed getting the data of  did it failed

 

 

clip_image004

The collection of Patients to which we will be binding the XAML view

The Current Patient, to which we will be also binding our xaml

 

 

Model and Business Logic

clip_image005

Here are partial classes for each entity on the Server

clip_image006

Calculated Fields

clip_image007

Vertical Formulas

 

Data binding XAML

clip_image008

clip_image009

 

 

Commands

clip_image010

clip_image011

clip_image012

clip_image013

clip_image014

 

 

The Tooltip bound to the RowLoded event

clip_image015

clip_image016

 

 

Lazy Loading

Imagine there are 500 Patients and each patient has 3 consultations, then every time you load the consultations collection (or customers in your case) data all of it will be loaded, a a lot of data will be travelingyou’re your SQL server to the hosting where your Silverlight app resides,

Unless you tell to the Ria services Domain Context to go get ONLY the consultations for the Current (in screen) patient.

That is what we do here

clip_image017

 

 

clip_image018

 

Current Collection

The selected one on the screen

clip_image019

clip_image020

 

 

Busy Indicator

 

clip_image022

clip_image023

Add New Command

clip_image025

 

 

 

Delete Current Entity

clip_image026

 

 

Print

clip_image026

 

 

Selection Changed Command, MVVM


clip_image028

 

clip_image029

 

 

ComboBoxes Data

clip_image030

XAML

clip_image031

On the ViewModel

clip_image032

clip_image033

Needs to be a friendly field , something the end user will recognize from the Table,

If some Combobox do not display data is because you have to choose a value

Last edited Jul 10, 2011 at 4:26 PM by BusinessApp, version 3

Comments

Ilofo Jun 5, 2015 at 9:03 AM 
Hello,

I try to install the medLinkv2, but nothing compile. So, what version of telerik to use?? And how to install this?
Thank