locked
Listbox Visual States Problem ? RRS feed

  • Question

  • Hello World

    I am Using a List Box Control and Bind Button In It

    <ListBox x:Name="MyTempList" Width="200" Height="100">
       <ListBox.ItemTemplate>
          <DataTemplate>
             <StackPanel Orientation="Horizontal">
                 <Button x:Name="myListButton" Content="{Binding Name}" Width="20" Height="50"/>
             </StackPanel>
          </DataTemplate>
       </ListBox.ItemTemplate>
    </ListBox>
     Now I Want that whenever User Click On Aly Button Of ListBox Than Its Background Color Will Be Changed. Please Tell Me How That Possible
    Wednesday, June 16, 2010 8:28 AM

Answers

  •  Can you not just have a click event attached to that button and update the MyTempList.Background property in the event?

    <Button  x:Name...  Click="Button_Click"/>

    Wednesday, June 16, 2010 1:38 PM