wpf - Using the binded object C#/XAML -


i'm new xaml, , maybe question little bit stupid, but, here problem.

i have listview, , have set itemsource observablelist inside modelview class

here's how code looks like:

public class listmodelview {     observablelist<myclass> _list = new observablelist<myclass>();     public observablelist<myclass> mylist { get{return _list;} set{}}      public listmodelview()     {         _list = methodthatreturnsalistfromawebservice;     } } 

every thing works fine. how modify (add, delete) elements mylist. work i've modified properties static, , work. wonder if right way it. thank you.

you can access giving view model in xaml, this:

<viewmodel:yourviewmodel x:name="viewmodelname"/> 

now you'll able access in code behind. further reading i'd recommend messenger mvvm light toolkit, can communicate between view models using class


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

android - Pass an Serializable object in AIDL -