У меня есть поведение
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));
}
Это может быть связано с TextBlock.
<TextBox>
<i:interaction.Behaviors>
<ee:MyBehavior Some="{Binding Name}" SomeOther="{Binding OtherName}"/>
</i:interaction.Behaviors>
</TextBox>
Когда изменяется SomeProperty, необходимо выполнить действие, которое зависит от SomeOtherProperty
private static void OnTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
DoSomeThingWithSomeOtherProperty(SomeOtherProperty );
}
Проблема в том, что SomeOtherProperty
равно нулю при изменении SomeProperty
.Порядок привязки для SomeOtherProperty - после SomeProperty.
Как мне решить эту проблему?