Ejemplo n.º 1
0
        void SendMessageCommand_CanExecuteChanged(object sender, EventArgs e)
        {
            var sendMessageButton = ApplicationBar.Buttons[0] as IApplicationBarMenuItem;

            if (sendMessageButton != null && SendMessageCommand != null)
            {
                sendMessageButton.IsEnabled = SendMessageCommand.CanExecute(null);
            }
        }
Ejemplo n.º 2
0
 private void PreviewKeyDown(KeyEventArgs e)
 {
     if (e.Key == Key.Enter &&
         SendMessageCommand.CanExecute(null))
     {
         SendMessageCommand.Execute(null);
         LocalChatState = ChatStateEvent.Paused;
     }
     else if (e.Key == Key.Delete || e.Key == Key.Back)
     {
         LocalChatState = ChatStateEvent.Deleting;
     }
     else
     {
         LocalChatState = ChatStateEvent.Composing;
     }
 }