2017-08-31 118 views
0

我正在使用syncfusion:menuItemAdv控件來顯示應用程序的分層菜單項。 OnMouseOver或OnMouseClicked(ExpandMode屬性)它顯示鼠標懸停菜單項上的子項目。但它不會在鼠標離開時消失。但是,如果我點擊窗口上的任何其他位置(可能丟失焦點),則清除子菜單項。SyncFusion菜單項在鼠標離開時不會消失

所以,而不是清除失去焦點上的子菜單項。我想在鼠標離開時這麼做,因爲用戶可能會打開任何其他應用程序而不會導致丟失的焦點事件,並且可能會感到困惑。所以,我想在鼠標離開時清除項目列表。

我知道,我可以編寫一個行爲,並可以掛鉤它在鼠標離開事件,但我不知道如何清理該列表。由於這個庫沒有暴露任何方法。用物品來源鍛鍊可能會造成一些麻煩。

任何幫助表示讚賞。

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> 

enter image description here

+0

代碼隱藏是否允許在您的應用程序中? – sTrenat

+0

我可以設法稍後再將其推入行爲 –

回答

2

我們已經檢查報告的行爲,並認爲這是錯誤。此錯誤的修復將包含在我們的第3捲髮行版中,該發行版計劃於9月底前推出。

Regards, Durga S.