I have a view model that inherits from a baseclass that has a property called IsReadOnly. In this view model i have a property called Customer and i'm binding the properties of the customer object to controls on my view.
However i also want to be able to bind the IsReadOnly to each control on my view also.
<TextBox x:Name="FirstNameTextBox" Grid.Column="1" Margin="2,2,0,2" Grid.Row="2" TextWrapping="Wrap" HorizontalAlignment="Left" Width="200"
Text="{Binding FirstName, Mode=TwoWay}" IsReadOnly="{Binding MyViewModel.IsReadOnly}"/>
How can i go about using both these properties? here is my structure
public class MyViewModelBase { public bool IsReadonly { get;set;} }
public class MyViewModel { public Customer Customer { get; set; } }
public class Customer { public string FamilyName { get; set; } }
Cheers for any help