Beispiel #1
0
        public NewThreadPage()
        {
            InitializeComponent();
            InitializeApplicationBar();

            _viewModel = new NewThreadPageViewModel();
            DataContext = _viewModel;

            _viewModel.ElementFocused += ElementFocused;
        }
Beispiel #2
0
 private void ElementFocused(object sender, NewThreadPageViewModel.NewThreadFocusResult e)
 {
     switch (e)
     {
         case NewThreadPageViewModel.NewThreadFocusResult.Captcha:
             Focus();
             Deployment.Current.Dispatcher.BeginInvoke(() =>
             {
                 CaptchaTextBox.Focus();
             });
             break;
         case NewThreadPageViewModel.NewThreadFocusResult.Comment:
             CommentBox.Focus();
             break;
         case NewThreadPageViewModel.NewThreadFocusResult.Page:
             Focus();
             break;
         default:
             break;
     }
 }