There's several ways of achieving this, depending on where you want the logic to kick in.
If Prop2 on your model can never be set without Prop1 being set then the setter for Prop2 should toss an exception preventing this.
Then, in order for the UI to realize this the ViewModel should expose a property indicating this.
Psuedo-code example:
<xaml>
<TextBox Content="{Binding Path=Prop1}"/>
<TextBox Content="{Binding Path=Prop2}" IsEnabled="{Binding Path=Prop2Enabled, Mode=OneWay}"/>
</xaml>
class ViewModel
{
private Model model;
public string Prop1
{
get { return model.Prop1; }
set { model.Prop1 = value;
}
public string Prop2
{
get { return model.Prop2; }
set { model.Prop2 = value; }
}
public bool Prop2Enabled
{
get { return model.Prop1 != null; }
}
}
class Model
{
private string prop2;
public string Prop1 { get; set;}
public string Prop2
{
get { return prop2; }
set
{
if (Prop1 == null)
throw new InvalidOperationException("Cannot set Prop2 while Prop1 is unset");
prop2 = value;
}
}
}
Hope this helps,
Fredrik