我希望在我的silverlight应用程序中关闭鼠标输出弹出窗口。我怎样才能做到这一点?
另外,如果可能的话,我的要求是在鼠标停止一段时间后关闭弹出窗口,意味着当用户退出鼠标时,经过一段时间的延迟后,应该关闭弹出窗口。
谢谢, PALAK
我正在尝试处理弹出窗口的mouseleave事件,但我不知道为什么它没有被调用。 能否请你举一个[Dispatchertimer]的例子。
这是.xaml代码:
<Grid x:Name="LayoutRoot" Background="Transparent">
<StackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal">
<telerik:RadButton x:Name="rbtnSave" Content="Save" Click="rbtnSave_Click" ToolTipService.ToolTip="Save Changes">
</telerik:RadButton>
<Border x:Name="borderSaveChanges" BorderThickness="1,0,0,0" BorderBrush="{StaticResource SCBCxWhite}" Width="2" Height="20"></Border>
<telerik:RadButton x:Name="rbtnMenu" Background="{StaticResource SCBCxBlue}" Click="rbtnMenu_Click"
Content="Menu" ToolTipService.ToolTip="Configurations Settings" >
</telerik:RadButton>
<Popup x:Name="PopUpMenu" FlowDirection="LeftToRight"
HorizontalAlignment="Left" VerticalAlignment="Center">
<Grid x:Name="popGrid" Background="{StaticResource PopUpBackgroundImg}" Margin="-70,5,20,20" Height="100" Width="200" HorizontalAlignment="Left" VerticalAlignment="Center" >
<Grid.RowDefinitions>
<RowDefinition Height="15"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="5"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<telerik:RadButton x:Name="imgClose" Click="imgClose_Click" HorizontalAlignment="Right"
VerticalAlignment="Top" Grid.Row="1" Margin="0,8,15,5" Style="{StaticResource RadButtonEllipseClose}"/>
<ListBox Style="{StaticResource WindowControlListBox}" Background="Transparent" Height="100" Width="200" BorderThickness="0" Grid.Row="2">
<ListBoxItem Style="{StaticResource WindowControlListBoxItem}" Content="Configuration"></ListBoxItem>
<ListBoxItem Style="{StaticResource WindowControlListBoxItem}" Content="Settings"></ListBoxItem>
</ListBox>
</Grid>
</Popup>
<Border x:Name="borderMenu" BorderThickness="1,0,0,0" BorderBrush="{StaticResource SCBCxWhite}" Width="2" Height="20"></Border>
<telerik:RadButton x:Name="rbtnInformation" Click="rbtnInformation_Click" Content="Help" ToolTipService.ToolTip="Help">
</telerik:RadButton>
<Border x:Name="borderInfo" BorderThickness="1,0,0,0" BorderBrush="{StaticResource SCBCxWhite}" Width="2" Height="20"></Border>
<telerik:RadButton x:Name="rbtnMinimize" Click="rbtnMinimize_Click" Content="Dock" ToolTipService.ToolTip="Minimize">
</telerik:RadButton>
<Border x:Name="borderMinimize" BorderThickness="1,0,0,0" BorderBrush="{StaticResource SCBCxWhite}" Width="2" Height="20"></Border>
<telerik:RadButton x:Name="rbtnClose" Click="rbtnClose_Click" Content="Close" ToolTipService.ToolTip="Close" >
</telerik:RadButton>
</StackPanel>
</Grid>