0

I have a comboBox, user controls and a button. SelectionChanged event is not firing in my UI App but when I copy the same combobox code in a different WPF app, selectionChanged event is firing. I don't understand why event is not triggered just here.

    <Window x:Class="ExecutionInformation.TesterApp.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:ExecutionInformation.TesterApp.UserControls"
    mc:Ignorable="d"
    Title="MainWindow" Height="Auto" Width="800">
  <ScrollViewer>
<Grid>
    <StackPanel>
        <Label Content="Execution Information service" Margin="20,10,20,10" 
    HorizontalAlignment="Center" FontSize="15" FontFamily="Bold"/>
    </StackPanel>
    <StackPanel Margin="20">
        <!--<ComboBox Name="CmbAPIList" ItemsSource="{StaticResource ExecInfoServiceApis}"
          DisplayMemberPath ="ValueString" 
          SelectedValuePath="ValueString" Margin="100,20,100,0"
          SelectedValue="{Binding ColorString}" SelectionChanged="CmbAPIList_SelectionChanged"/>-->
        <ComboBox Name="CmbAPIList" 
          SelectionChanged="CmbAPIList_SelectionChanged">
            <ComboBoxItem>ApproveTestStartAsync</ComboBoxItem>
            <ComboBoxItem>CompleteTestAsync</ComboBoxItem>
            <ComboBoxItem>GetPartAsync</ComboBoxItem>
            <ComboBoxItem>GetAssemblyAsync</ComboBoxItem>
            <ComboBoxItem>PutAssemblyAttributesAsync</ComboBoxItem>
        </ComboBox>

        <local:ApproveTestStartUC x:Name="approveTestStartUC" Visibility="Collapsed" Margin="20,10,20,10" Background="Cyan" />
        <local:CompleteTestUC x:Name="completeTestUC"  Visibility="Collapsed" Margin="20,10,20,10" />
        <local:GetPartUC x:Name="getPartUC" Visibility="Collapsed" Margin="20,10,20,10" />
        <local:GetAssembly x:Name="getAssemblyUC" Visibility="Collapsed" Margin="20,10,20,10" />
        <local:PutAssemblyAttributesUC x:Name="putAssemblyUC" Visibility="Collapsed" Margin="20,10,20,10"/>

        <WrapPanel Margin="15" HorizontalAlignment="Center">
            <Button Name="btnShowResults" Click="btnShowResults_Click" Visibility="Collapsed"  Width="100">Show Results</Button>
        </WrapPanel>
        <Border BorderThickness="1" BorderBrush="LightGreen">
            <TextBlock Name="TxtResults" Visibility="Collapsed"></TextBlock>
        </Border>
    </StackPanel>
</Grid>
</ScrollViewer>

Commented ComboBox code in the above code works without any issues.

Thanks

Manju
  • 21
  • 2
  • 9

0 Answers0