Search code examples
silverlightsilverlight-4.0telerikwcf-ria-services

Separating codebehind and controls


I'm using silverlight 4 and telerik rad controls. What is the best way to seperate the logic for the controls into another c# assembly? E.g. all the code where I say radCtrl.ItemSource = ""; etc, I want in another assembly.


Solution

  • If I get you right, you don't want to set the ItemsSource and stuff like that in code behind. Have a look at the MVVM Pattern (http://jesseliberty.com/2010/05/08/mvvm-its-not-kool-aid-3/). This is a really cool approach to seperate you View from your "data". If you want it in own assemblys, you create a View assembly and a ViewModel assembly. To display the data you use bindings.

    BR,

    TJ