Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to set initial focus to a textbox with gotfocus method in mvvm arch with xaml c# wpf 4.5

$
0
0

Hi,

I have create a page/window with many images and a few textbox's and buttons. When the app starts up and the page loads, I want to set the initial focus to the first textbox(the default focus is on images as they are the first loading elements) and change the focus to next elements.

I see wpf 4.5 only supports gotfocus() and lostfocus() events to set them but with an MVVM arch --> I do not want to have any code-behind till its absolutely necessary and also I  do not want to set the focus in the OnLoaded(). Any suggestions on how to do it?

Thanks in advance!


Viewing all articles
Browse latest Browse all 18858

Trending Articles



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