 <p>There are events like GotFocus and LostFocus for controls.</p> <p>If you subscribe to these events they automatically get called when your input receives or looses focus</p> <p>you can use those events for your purpose.</p> <p>XAML Declaration</p> <pre><code>&lt;TextBox Name="myTextbox" GotFocus="myTextbox_GotFocus" /&gt; </code></pre> <p>and inside the cs</p> <pre><code> private void myTextbox_GotFocus(object sender, RoutedEventArgs e) { } private void ContentPanel_LostFocus(object sender, RoutedEventArgs e) { } </code></pre>