私はこれがあなたが求めていることをすると信じています:
<StackPanel xmlns:local="clr-namespace:SilverlightApplication;assembly=SilverlightApplication">
<StackPanel.Resources>
<local:BoolToUIElementVisibilityConverter x:Name="BoolToUIElementVisibilityConv"/>
</StackPanel.Resources>
<Button Content="Item" x:Name="YourButton">
</Button>
<ListBox Visibility="{Binding Path=IsMouseOver, ElementName=YourButton, Converter={StaticResource BoolToUIElementVisibilityConv}}">
<ListBoxItem>a</ListBoxItem>
<ListBoxItem>b</ListBoxItem>
<ListBoxItem>c</ListBoxItem>
</ListBox>
</StackPanel>
クラスで:
using System.Windows.Data;
using System;
using System.Globalization;
using System.Windows;
namespace SilverlightApplication
{
public class BoolToUIElementVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if ((bool)value == true)
return Visibility.Visible;
else
return "Collapsed";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}