I have a view model that inherits from a base class that has the IsReadOnly property. In this view model, I have a Customer property and I bind the properties of the client object to the controls in my view.
However, I also want to be able to bind IsReadOnly to every control in my view.
<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 use both of these properties? here is my structure
public class MyViewModelBase {public bool IsReadonly {get; set;}}
public class MyViewModel {public client-client {get; set; }}
public class Customer {public string FamilyName {get; set; }}
Cheers for any help
source
share