I'm trying to display a string in XAML using Label control. Following is my XAML code :
<Label Height="28" HorizontalAlignment="Left" Margin="233,68,0,0" Name="label13" VerticalAlignment="Top">
<Label.Content>
<MultiBinding StringFormat="{}{0} x {1}">
<Binding Path="Width" />
<Binding Path="Height" />
</MultiBinding>
</Label.Content>
Width and Height are two properties of my class Movie.
I want the label to display : "Width x Height" ex. 800 x 640
However the label control remains empty. Any help is appreciated.
I WANT TO DO THIS WITHOUT USING A CONVERTER.
I have modified my xaml by using a TextBlock instead of Label. But still it wont populate display the output.
<TextBlock Height="28" HorizontalAlignment="Left" Margin="233,68,0,0" Name="label13" VerticalAlignment="Top">
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} x {1}">
<Binding Path="Width" />
<Binding Path="Height" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…