This is a migrated thread and some comments may be shown as answers.

Auto Resizing Problem

0 Answers 86 Views
Window
This is a migrated thread and some comments may be shown as answers.
Marcin
Top achievements
Rank 1
Veteran
Marcin asked on 11 Oct 2012, 03:53 PM
I have following window:

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

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.

No answers yet. Maybe you can help?

Tags
Window
Asked by
Marcin
Top achievements
Rank 1
Veteran
Share this question
or