Auto Resizing Problem

1 posts, 0 answers
  1. Marcin
    Marcin avatar
    165 posts
    Member since:
    Jan 2011

    Posted 11 Oct 2012 Link to this post

    I have following window:

    <telerik:RadWindow x:Class="IdealHost.FaceToFace.Controls.MessageBox" xmlns=""
                       xmlns:x="" xmlns:telerik="" MinHeight="140" MinWidth="300"
                       WindowStartupLocation="CenterOwner" ResizeMode="NoResize"  >
                <ColumnDefinition Width="80" />
                <ColumnDefinition Width="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Stretch" Grid.Row="0" Grid.Column="1" Margin="15,10,15,10" Name="txtMessage" />

    When I'm assigning text using following code:

    this.txtMessage.Text = message;

    The window is propery resized to size of text.

    But when I change TexBlock to use Binding:

    <TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="0" Grid.Column="1" Margin="15,10,15,10" Text="{Binding Message}"/>

    The window is not automatically resizing. And text is cut.

    How can I fix this issue? I realy would like to use binding not direct code.
Back to Top