I\'m working on some application and I have one problem. I have two windows (Bookings - parent and Guests - child). In the parent window, I have one combo box with list of guest
OK, I added this lines in my "GuestsViewModel.cs":
private BookingsViewModel _BookingsViewModel;
public BookingsViewModel BookViewModel // Property
{
get
{
return _BookingsViewModel;
}
set
{
_BookingsViewModel = value;
OnPropertyChanged("BookViewModel");
}
}
public GuestsViewModel(BookingsViewModel bvm) // Constructor with one parameter
{
BookViewModel = bvm;
}
public ICommand _btnAddGuest;
public ICommand btnAddGuest
{
get
{
if (_btnAddGuest == null)
{
_btnAddGuest = new DelegateCommand(delegate()
{
try
{
Service1Client wcf = new Service1Client();
wcf.AddGuest(Guest);
BookingsViewModel.OnPropertyChanged("Guests"); // You said to add this
wcf.Close();
}
catch
{
Trace.WriteLine("working...", "MyApp");
}
});
}
return _btnAddGuest;
}
}
Did you mean something like this above? This don't work... I suppose I should add one more thing? Sorry, maybe this questions are stupid but I don't have idea how to solve this problem...
Regards, Vladimir