Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all articles
Browse latest Browse all 1760

New Post: Handling Focus?

$
0
0
hi

Sorry to bump this old post, but I found this answer which solved my problem... but I don't understand one thing :
<TextBox x:Name="UserName" Style="{StaticResource LoginTextBox}">
  <i:Interaction.Behaviors>
    <localBehaviors:FocusBehavior HasInitialFocus="True" IsFocused="{Binding UserNameIsFocused, Mode=TwoWay}"/>
  </i:Interaction.Behaviors>
</TextBox>
Why the following syntax is working :
IsFocused="{Binding UserNameIsFocused, Mode=TwoWay}"

???

I've tried the following, which is a little more understandable and still work :
IsFocused="{Binding UserName.IsFocused, Mode=TwoWay}"

But the following throw an exception, telling me that IsFocused is a ReadOnly property :
IsFocused="{Binding IsFocused, ElementName=UserName, Mode=TwoWay}"

Thanks to the one who can explain this :)

Viewing all articles
Browse latest Browse all 1760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>