I need to closing charmBar programmatically, how can I do it?
Asked
Active
Viewed 171 times
1 Answers
0
Try focusing on another control. For example, call
this.Focus();

keyboardP
- 68,824
- 13
- 156
- 205
-
Thank you @keyboardP But I am not in *.xaml.cs :( – Tugrul Emre Atalay Jul 04 '13 at 16:50
-
Are you using MVVM? (Or another language?) – keyboardP Jul 04 '13 at 16:51
-
Yes, I am using it and sorry for late answer. – Tugrul Emre Atalay Jul 04 '13 at 17:13
-
@TuğrulEmreAtalay - No problem, this might help. It'll manage focus via the Visual State http://csharperimage.jeremylikness.com/2011/10/using-visual-states-to-set-focus-on.html – keyboardP Jul 04 '13 at 17:55
-
@TuğrulEmreAtalay - Just to add, you might want to try `this.Focus` in the code behind to see if it actually works and then use the attached property in the link to conform to the MVVM guidelines. – keyboardP Jul 04 '13 at 18:05