private void GameOver() { MessageTextBlock.SetValue(Grid.RowProperty, 2); MessageTextBlock.SetValue(Grid.ColumnProperty, 3); MessageTextBlock.FontSize = 45; MessageTextBlock.Text = "Game Over! You lost"; }
void InsertInMessageTextBlock(string text) { Loc.Editor.ShowSmileyUI = false; MessageTextBlock.SelectedText = text; MessageTextBlock.SelectionLength = 0; MessageTextBlock.SelectionStart += text.Length; MessageTextBlock.Focus(FocusState.Keyboard); }
private void Editor_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == nameof(Loc.Editor.IsEditorEnabled)) { if (Loc.Editor.IsEditorEnabled) { MessageTextBlock.IsEnabled = true; MessageTextBlock.Focus(Windows.UI.Xaml.FocusState.Keyboard); } else { MessageTextBlock.IsEnabled = false; } } }
public KinectSensorChooser() { InitializeComponent(); this.Loaded += this.KinectSensorChooserLoaded; this.IsRequired = true; // Setup bindings via code Binding binding = new Binding("Mensaje") { Source = this }; MessageTextBlock.SetBinding(TextBlock.TextProperty, binding); Binding binding2 = new Binding("Mas informacion") { Source = this }; TellMeMoreLink.SetBinding(TextBlock.ToolTipProperty, binding2); Binding binding3 = new Binding("Mas informacion") { Source = this, Converter = new NullToVisibilityConverter() }; TellMeMore.SetBinding(TextBlock.VisibilityProperty, binding3); Binding binding4 = new Binding("ShowRetry") { Source = this, Converter = new BoolToVisibilityConverter() }; RetryButton.SetBinding(Button.VisibilityProperty, binding4); Binding binding5 = new Binding("MoreInfoUri") { Source = this }; TellMeMoreLink.SetBinding(Hyperlink.NavigateUriProperty, binding5); this.UpdateMessage( KinectStatus.Undefined, "Required", "This application needs a Kinect for Windows sensor in order to function. Please plug one into the PC.", new Uri("http://go.microsoft.com/fwlink/?LinkID=239815"), false); }
private void SendMessage() { if (writer != null) { if (MessageTextBlock.Text != "") { Request request = new Request(username, "@gongoserver", MessageTextBlock.Text, null, "@all", Library.Action.SendMessage); JavaScriptSerializer serializer = new JavaScriptSerializer(); string serialized = serializer.Serialize(request); SendMessageToServer(serialized); MessageTextBlock.Clear(); } } else { Notify("Não foi possível enviar a sua mensagem '" + MessageTextBlock.Text + "'"); Disconnect(); } }
private void Editor_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == nameof(Loc.Editor.IsEditorEnabled)) { if (Loc.Editor.IsEditorEnabled) { MessageTextBlock.IsEnabled = true; MessageTextBlock.Focus(FocusState.Keyboard); if (!string.IsNullOrEmpty(MessageTextBlock.Text) && MessageTextBlock.Text.Length > 0) { MessageTextBlock.SelectionStart = MessageTextBlock.Text.Length - 1; } else { MessageTextBlock.SelectionStart = 0; } } else { MessageTextBlock.IsEnabled = false; } } }
private void ButtonBase_OnClick(object sender, RoutedEventArgs e) { MessageTextBlock.SwitchVisibility(); }