Я работаю над формой Xaml, которая содержит ListBox. Полосы прокрутки отображаются вертикально при запуске из моего примера вызывающего приложения (разработанного в Windows Forms с использованием C #). Та же самая форма при запуске из другого стороннего приложения (которое я считаю приложением WPF) показывает полосы прокрутки по горизонтали. Код Xaml моего ListBox:
<ListBox x:Name="AppliedTagsListBox" ItemsSource="{Binding Path=Tags, Mode=TwoWay}" Style="{StaticResource TagsListBoxStyle}" ItemContainerStyle="{StaticResource TagsListBoxItemStyle}" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" VerticalAlignment="Stretch" BorderBrush="Transparent"/>
<Style x:Key="TagsListBoxStyle" TargetType="{x:Type ListBox}">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WrapPanel IsItemsHost="True"></WrapPanel>
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<Border BorderThickness="1" BorderBrush="LightGray" CornerRadius="15,15,15,15" Margin="0,0,5,3">
<Border.Style>
<Style>
<Style.Triggers>
<Trigger Property="Border.IsMouseOver" Value="True">
<Setter Property="Border.Background" Value="SkyBlue"/>
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<DockPanel>
<TextBlock Padding="15,6,7,7" Text="{Binding}"/>
<Button FontWeight="Bold" Content="X" Background="Transparent" Margin="5,0,12,0" TextBlock.TextAlignment="Center" HorizontalAlignment="Stretch" BorderBrush="Transparent" Command="{Binding Path=RemoveTag}">
<Button.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="Transparent">
<!--<ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Center"/>-->
<Image Height="10" Width="10" Source="images/icons/Cross.32.png"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Cursor" Value="Hand"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Resources>
</Button>
</DockPanel>
</Border>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TagsListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border Background="Transparent">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Любые предложения о том, как можно получить одинаковое поведение в обоих приложениях.