Note that there are some explanatory texts on larger screens.

plurals
  1. POBinding TextBlock text in a new Window?
    primarykey
    data
    text
    <p>I've created a warning window to verify delete actions by the user, using Window.ShowDialog and setting the DialogResult. Everything works fine, except that the warning text doesn't appear in the <code>TextBlock</code> and I don't know why. Here's my <code>Window</code>:</p> <pre><code>&lt;Window x:Class="RoVCo.Windows.VerifyWindow" .... WindowStyle="None" Padding="10" ResizeMode="NoResize"&gt; &lt;StackPanel&gt; &lt;TextBlock Height="Auto" Text="{Binding TBText, Mode=OneWay}" Foreground="Yellow" TextWrapping="Wrap" /&gt; &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,0,0"&gt; &lt;Button Content="Cancel" Margin="10,0" Width="50" Click="CancelVerify" /&gt; &lt;Button Content="OK" Width="50" Click="ConfirmVerify" /&gt; &lt;/StackPanel&gt; &lt;/StackPanel&gt; &lt;/Window&gt; </code></pre> <p>And the class:</p> <pre><code>public partial class VerifyWindow : Window { public VerifyWindow(string content) { InitializeComponent(); _text = content; } private string _text = ""; public string TBText { get { return _text; } } private void CancelVerify(object sender, RoutedEventArgs e) { this.DialogResult = false; this.Close(); } private void ConfirmVerify(object sender, RoutedEventArgs e) { this.DialogResult = true; this.Close(); } } </code></pre> <p>And I call it like such:</p> <pre><code>var window = new RoVCo.Windows.VerifyWindow("Removing this skill will erase all DP spent on it from all levels. Continue?"); if (window.ShowDialog() == false) return; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload