Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void ListItem_MouseEnter(object sender, MouseEventArgs e)
- {
- var grid = sender as Grid;
- grid.SetValue(Canvas.ZIndexProperty, 5);
- }
- <UserControl x:Class="SilverlightApplication1.Page"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Width="400" Height="300">
- <Grid x:Name="LayoutRoot" Background="White">
- <ListBox x:Name="ListBox1">
- <ListBoxItem Content="Test 1" MouseEnter="ListBoxItem_MouseEnter" />
- <ListBoxItem Content="Test 2" MouseEnter="ListBoxItem_MouseEnter" />
- <ListBoxItem Content="Test 3" MouseEnter="ListBoxItem_MouseEnter" />
- <ListBoxItem Content="Test 4" MouseEnter="ListBoxItem_MouseEnter" />
- </ListBox>
- </Grid>
- </UserControl>
- using System;
- using System.Windows.Controls;
- using System.Windows.Input;
- namespace SilverlightApplication1
- {
- public partial class Page : UserControl
- {
- public Page()
- {
- InitializeComponent();
- }
- private void ListBoxItem_MouseEnter(object sender, MouseEventArgs e)
- {
- ListBoxItem listBoxItem = (ListBoxItem)sender;
- listBoxItem.SetValue(Canvas.ZIndexProperty, 5);
- }
- }
- }
Add Comment
Please, Sign In to add comment