ObservableCollection オブジェクトにバインドされたコンボ ボックスがあるこの WPF を作成しました。Windows 7 でアプリを実行すると、バインディングは完全に機能し、すべて問題ありません。WindowsXPでこれを実行すると、すべてがうまく見えますが、ドロップダウンは空です。誰でもこれを経験したことがあり、何とか修正しましたか?
このための XAML は次のとおりです (その一部)。
<StackPanel x:Name="spUnrecRxItems">
<Border BorderBrush="Silver" CornerRadius="3,3,3,3" BorderThickness="0,3,0,0" Height="Auto"
HorizontalAlignment="Left" Margin="23,6,0,0" Width="200" Background="#FFEFEEEE">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Name="tbUR1" Foreground="#FFDE2226" FontSize="14" FontWeight="Bold"
TextWrapping="Wrap" Width="Auto" HorizontalAlignment="Left" FontFamily="Arial" Grid.Row="0"
Margin="10,10,0,0" Text="{Binding DrugName}" />
<TextBlock Foreground="#FF484747" HorizontalAlignment="Left"
Margin="10,0,0,0" FontSize="12" Text="{Binding FillMinMaxDate}" Grid.Row="1" />
<TextBlock Foreground="#FF484747" HorizontalAlignment="Left"
Margin="10,0,0,0" FontSize="12" Text="{Binding PhysiciansName}" Grid.Row="2" />
<TextBlock ForceCursor="False" Foreground="#FF707170" HorizontalAlignment="Left"
Margin="10,0,0,0" Name="tbSourceCount" VerticalAlignment="Top" FontSize="12"
MouseDown="tbSource_MouseDown" Text="{Binding SourceCount, StringFormat=Source ({0})}" Grid.Row="3">
</TextBlock>
</Grid>
</Border>
<Expander x:Name="expManualRec" Background="DarkGray" Width="180" HorizontalAlignment="Center">
<Expander.Header>
<TextBlock HorizontalAlignment="Center" Text="Reconcile" Foreground="White" />
</Expander.Header>
<Grid Height="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ComboBox x:Name="cboReconType" HorizontalAlignment="Center" Margin="8 0 0 0" Width="160" Height="Auto" Grid.Row="1"
SelectionChanged="cboReconType_SelectionChanged" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=ItemsControl}, Path=DataContext.ReconTypes}" />
<ComboBox x:Name="cboRecReason" HorizontalAlignment="Center" Margin="8 0 0 0" Width="160" Height="Auto" Grid.Row="2"
SelectedValue="{Binding code}">
<ComboBox.Style>
<Style TargetType="ComboBox">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=cboReconType, Path=Text}" Value="Create A Question">
<Setter Property="ComboBox.Visibility" Value="Hidden" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=cboReconType, Path=Text}" Value="No Action">
<Setter Property="ComboBox.Visibility" Value="Visible" />
<Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource AncestorType=ItemsControl}, Path=DataContext.ReconReasons}" />
<Setter Property="DisplayMemberPath" Value="description" />
<Setter Property="SelectedValuePath" Value="code" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=cboReconType, Path=Text}" Value="Previous Questionnaire">
<Setter Property="ComboBox.Visibility" Value="Visible" />
<Setter Property="ItemsSource" Value="{Binding RelativeSource={RelativeSource AncestorType=ItemsControl}, Path=DataContext.InterviewQuestionnaires}" />
<Setter Property="DisplayMemberPath" Value="QuestionnaireName" />
<Setter Property="SelectedValuePath" Value="interviewquestionnaire_id" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=cboReconType, Path=Text}" Value="">
<Setter Property="ComboBox.Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>
</Style>
</ComboBox.Style>
</ComboBox>