鼠标悬停菜单像在visual studio中的工具栏

问题描述:

我试图找出它是否有可能实现一个面板弹出包含数据网格鼠标悬停在“扩展器”位。鼠标悬停菜单像在visual studio中的工具栏

寻找一些行为与Visual Studio中的工具箱相似的东西。

即时通讯有重大问题搜索作为即时消息不确定其称为。

请让我知道如果我需要更好地解释自己。

+1

...你需要更好地解释自己;) –

+0

如果您有视觉工作室左侧的工具箱。我想要的行为完全一样,但不是有工具箱项目,我希望它有一个数据网格。还需要更多的解释吗?我可以做一些截​​图如果需要的话:) – user589195

我会促进WPF动画来实现任何种类的菜单,弹出/出现/幻灯片/以某种方式顺利进入行动。

建立在你想例如任何方式的菜单控制基于StackPanel,然后为其位置属性指定一些自定义动画以使其显示并消失。

动画的使用非常简单,因为您只是为特定属性指定开始值,目标值以及在这两者之间进行转换的方式。

例如做一个StackPanel增长和收缩你可以做到以下几点:

// suppose you have a stackpanel named sp. 

// create the actual animation 
DoubleAnimation myDoubleAnimation = new DoubleAnimation(); 
myDoubleAnimation.From = 100; 
myDoubleAnimation.To = 300; 
myDoubleAnimation.Duration = new Duration(TimeSpan.FromSeconds(5)); 

// cerate the storyboard which comprise all your single animations into a compound animation - a storyboard. 
StoryBoard myStoryboard = new Storyboard(); 
myStoryboard.Children.Add(myDoubleAnimation); 

// link the animation with the object it is supposed to work on 
Storyboard.SetTargetName(myDoubleAnimation, sp.Name); 

// specify the target property of ypur StackPanel which should be affected by the animation 
Storyboard.SetTargetProperty(myDoubleAnimation, new PropertyPath(Rectangle.Width)); 

对于一个完整的介绍,你可以开始阅读这里:http://msdn.microsoft.com/en-us/library/ms752312.aspx

也了解,因为在他们的帮助缓解功能你可以构建更复杂的动画。

您可以使用AvalonDock实现这一

enter image description here

这是在XAML做下面的代码:

<avalondock:DockingManager x:Name="dockingManager"> 
    <avalondock:LayoutRoot> 
     <avalondock:LayoutRoot.LeftSide> 
      <avalondock:LayoutAnchorSide> 
       <avalondock:LayoutAnchorGroup> 
        <avalondock:LayoutAnchorable Title="Autohidden Content"> 
         <DataGrid> 
          <DataGrid.Columns> 
           <DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}" Header="Col1"/> 
           <DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}" Header="Col2"/> 
           <DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}" Header="Col3"/> 
          </DataGrid.Columns> 
         </DataGrid> 
        </avalondock:LayoutAnchorable> 
       </avalondock:LayoutAnchorGroup> 
      </avalondock:LayoutAnchorSide> 
     </avalondock:LayoutRoot.LeftSide> 
    </avalondock:LayoutRoot> 
</avalondock:DockingManager> 
+0

由于将有一个适宜的外观和测试,然后标记为答案:) – user589195