private void ListBoxItemMouseEnter(object sender, MouseEventArgs e) { FrameworkElement listBoxItem = sender as FrameworkElement; FrameworkElement child = VisualTreeHelperAdditional.GetVisualChild <Image>(listBoxItem);//.FindName( "image" ) as FrameworkElement; if (child != null) { child.Opacity = 1; } }
private void ListBoxItemMouseLeave(object sender, MouseEventArgs e) { if (e.LeftButton == MouseButtonState.Released) { droppedData = null; } FrameworkElement listBoxItem = sender as FrameworkElement; FrameworkElement child = VisualTreeHelperAdditional.GetVisualChild <Image>(listBoxItem);//.FindName( "image" ) as FrameworkElement; if (child != null && droppedData == null) { child.Opacity = 0; } }