Archiv der Kategorie: Windows Presentation Foundation

WPF – ListBox Stretch

<ListBox x:Name=“ArticleListBox“ Grid.Row=“3″ Grid.IsSharedSizeScope=“True“
ScrollViewer.HorizontalScrollBarVisibility=“Disabled“
ItemTemplate=“{DynamicResource ReceiptArticleDataTemplate}“
ItemsSource=“{Binding GuestCheckSource.Items}“
Margin=“{StaticResource StandardMarginHorizontal}“>

<ListBox.ItemContainerStyle>

<Style TargetType=“{x:Type ListBoxItem}“>

<Setter Property=“HorizontalContentAlignment“ Value=“Stretch“/>

</Style>

</ListBox.ItemContainerStyle>

</ListBox>

Data Binding – Debug / Trace

<Window x:Class=“Samples.DataBinding.DataBindingDebug“
xmlns=“http://schemas.microsoft.com/winfx/2006/xaml/presentation“
xmlns:x=“http://schemas.microsoft.com/winfx/2006/xaml“
xmlns:diag=“clr-namespace:System.Diagnostics;assembly=WindowsBase“
Title=“DataBindingDebug“ Height=“100″ Width=“200″>
<Grid>
<TextBlock Text=“{Binding Title, diag:PresentationTraceSources.TraceLevel=High}“ />
</Grid>
</Window>