I wanted to avoid calling control.Focus() in the Window derived class’s constructor and wanted to see how it’s done via XAML. I couldn’t get it working after 5-10 minutes of trying out various stuff, but someone helped me out in the MSDN forums. Here’s how it’s done – in the following code snippet, I am setting initial focus to a ListBox control named listBox1.
<Grid FocusManager.FocusedElement="{Binding ElementName=listBox1}">
Thanks man very helpful
“Setting default focus to a particular control via XAML | void Nish(char* szBlog);”
was a remarkable posting, cannot wait to read through far more of
ur postings. Time to spend numerous time online hehe.
Thanks -Amanda