【问题标题】:SyncFusion Menu item doesn't disappear on mouse leaveSyncFusion 菜单项在鼠标离开时不会消失
【发布时间】:2017-09-05 18:41:34
【问题描述】:

我正在使用 syncfusion: menuItemAdv 控件来显示应用程序的分层菜单项。 OnMouseOver 或 OnMouseClicked(ExpandMode 属性)它在鼠标悬停菜单项时显示子项。但它不会在鼠标离开时消失该列表。但是,如果我单击窗口上的其他任何位置(可能失去焦点),那么它会清除子菜单项。

所以,与其清除失去焦点的子菜单项。我想在鼠标离开时这样做,因为用户可能会打开任何其他应用程序而不会导致失去焦点事件并且可能会感到困惑。所以,我想在鼠标离开时清除项目列表。

我知道,我可以编写一个行为并且可以在鼠标离开事件上挂钩它,但我不知道如何清理该列表。因为该库没有公开任何方法。与物品来源调和可能会搞砸一些事情。

感谢任何帮助。

xaml如下

<Window x:Class="WpfApp1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp1"
        xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Window.DataContext>
        <local:MainWindowVM></local:MainWindowVM>
    </Window.DataContext>
    <Grid>

        <syncfusion:MenuAdv Width="300" Height="40" ItemsSource="{Binding League}" ExpandMode="ExpandOnMouseOver">
            <syncfusion:MenuAdv.ItemTemplate >
                <HierarchicalDataTemplate DataType="local:MenuList" ItemsSource="{Binding Teams}" >
                    <StackPanel Orientation="Vertical" VerticalAlignment="Top" >
                        <Label Content="{Binding Name}" Height="Auto" FontFamily="Arial" FontSize="12" VerticalAlignment="Top" Margin="0,3,0,0"  VerticalContentAlignment="Center"/>
                    </StackPanel>
                </HierarchicalDataTemplate>
            </syncfusion:MenuAdv.ItemTemplate>
        </syncfusion:MenuAdv>


    </Grid>
</Window>

【问题讨论】:

  • 您的应用中是否允许使用代码隐藏功能?
  • 我可以设法让以后我可以把它变成行为

标签: c# .net wpf xaml syncfusion


【解决方案1】:

我们已检查报告的行为并将其视为错误。此错误的修复将包含在我们计划于 9 月底推出的第 3 卷 SP2 版本中。

问候, 杜尔加 S.

【讨论】:

    猜你喜欢
    • 2016-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-08
    • 1970-01-01
    • 2013-03-09
    相关资源
    最近更新 更多