I have a behavior
public class MyBehaviour : Behavior<FrameworkElement>
{
public static readonly DependencyProperty SomeProperty =
DependencyProperty.Register("Some", typeof(string), typeof(MyBehaviour), new UIPropertyMetadata(string.Empty, OnSomeChanged));
public static readonly DependencyProperty SomeOtherProperty =
DependencyProperty.Register("SomeOther", typeof(string), typeof(MyBehaviour), new UIPropertyMetadata(string.Empty));
}
This can be bound to a TextBlock.
<TextBox>
<i:interaction.Behaviors>
<ee:MyBehavior Some="{Binding Name}" SomeOther="{Binding OtherName}"/>
</i:interaction.Behaviors>
</TextBox>
When SomeProperty changes there is an action need to be done which depends on SomeOtherProperty
private static void OnTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DoSomeThingWithSomeOtherProperty(SomeOtherProperty );
}
The problem is SomeOtherProperty
is null when SomeProperty
is changed. The binding order for SomeOtherProperty is after SomeProperty.
How can I resolve this?