Hi all
i am creating WPF app which is based on MVVM model.
in my app i am using two different classes which have inherited by same parent class as bellow:
Public class CARVM : Viewmodel
{
//some properties
//Some methods
}
and
Public class BikeVM : Viewmodel
{
//some properties
//Some methods
}
and now i am assigning class CARVM as a datacontext of my XAML file.
Further process is as below :
1.calling one method of BikeVM from code behind(XAML.cs).
2.In method(BikeVM method) i am assigning a value to parent's class property(i.e Viewmodel's Property)
3. now i am binding this property to control in XAML class as below:
while debugging i am getting the new value of properety but in xaml it is not going to bind.
please help me out.
Thanks in advance.

Vishnujeet KumarRank #1,019 · 1.9K reputationPosted Jan 23, 2013, 5:18 AM EST
Sumit KumawatRank #4,008 · 372 reputationPosted Jan 23, 2013, 7:12 AM EST
Thanks for your reply.but my req. is diffrent.
i this demo code u added one model class. suppose that class is also is also inherited by Base view. and in SayHello() method i want to assign the value to model's class property.
thanx
Sumit KumawatRank #4,008 · 372 reputationPosted Jan 23, 2013, 7:09 PM EST
i am uploading your given demo code with some modification.
the changes are as below :-
1.Model.cs is also inherited by BaseView.cs
2.I wrote one property in BaseView.cs
3.Model class has now contains SayHello() method instead of ViewModel class which we were using before.
4.MainWindow.xaml.cs method will call the SayHello() method.
5. In SayHello() method i am assigning the value to the BaseView.cs Class property which is binded to TextBlock.
Please take a look and let me know why the updated value is not going to bind with the TextBlock control.
Thanks in advance.
Vishnujeet KumarRank #1,019 · 1.9K reputationPosted Jan 24, 2013, 4:56 AM EST