I have following window:
When I'm assigning text using following code:
The window is propery resized to size of text.
But when I change TexBlock to use Binding:
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.
<
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.