private void SearchButton_MouseEnter(object sender, MouseEventArgs e) { SearchScopeBox.BeginAnimation(WidthProperty, _oc); SearchBox.BeginAnimation(WidthProperty, _oa); if (SearchScopeBox.HasItems) { return; } SearchScopeBox.Items.Add("робітники"); SearchScopeBox.Items.Add("відділення"); SearchScopeBox.Items.Add("посади"); SearchScopeBox.Items.Add("проекти"); }
public RootItem(CSharpBar bar) { _Bar = bar; Icon = ThemeHelper.GetImage(KnownImageIds.Namespace); this.ReferenceCrispImageBackground(EnvironmentColors.MainWindowActiveCaptionColorKey); SetResourceReference(ForegroundProperty, VsBrushes.CommandBarTextActiveKey); Header = new ThemedToolBarText(); _Menu = new SymbolList(bar._SemanticContext) { Container = _Bar._SymbolListContainer, ContainerType = SymbolListType.NodeList, Header = new StackPanel { Margin = WpfHelper.MenuItemMargin, Children = { new Separator { Tag = new ThemedMenuText("Search Declaration") }, new StackPanel { Orientation = Orientation.Horizontal, Children = { ThemeHelper.GetImage(KnownImageIds.SearchContract).WrapMargin(WpfHelper.GlyphMargin), (_FinderBox = new MemberFinderBox() { MinWidth = 150 }), (_ScopeBox = new SearchScopeBox{ Contents = { new ThemedButton(KnownImageIds.StopFilter, "Clear filter", ClearFilter).ClearBorder() } }), } }, } }, Footer = _Note = new TextBlock { Margin = WpfHelper.MenuItemMargin } .ReferenceProperty(TextBlock.ForegroundProperty, EnvironmentColors.SystemGrayTextBrushKey) }; _Bar.SetupSymbolListMenu(_Menu); _FinderBox.TextChanged += SearchCriteriaChanged; _ScopeBox.FilterChanged += SearchCriteriaChanged; _ScopeBox.FilterChanged += (s, args) => _FinderBox.Focus(); }
private void SearchButton_MouseLeave(object sender, MouseEventArgs e) { var ob = new DoubleAnimation { From = SearchBox.Width, To = 0, Duration = TimeSpan.FromSeconds(0.2) }; var od = new DoubleAnimation { From = SearchScopeBox.Width, To = 0, Duration = TimeSpan.FromSeconds(0.2) }; SearchScopeBox.BeginAnimation(WidthProperty, od); SearchBox.BeginAnimation(WidthProperty, ob); }
public RootItem(CSharpBar bar) { _Bar = bar; Icon = ThemeHelper.GetImage(KnownImageIds.Namespace); this.ReferenceCrispImageBackground(EnvironmentColors.MainWindowActiveCaptionColorKey); SetResourceReference(ForegroundProperty, VsBrushes.CommandBarTextActiveKey); Header = new ThemedToolBarText(); SubMenuHeader = new StackPanel { Margin = WpfHelper.MenuItemMargin, Children = { new Separator { Tag = new ThemedMenuText("Search Declaration") }, new StackPanel { Orientation = Orientation.Horizontal, Children = { ThemeHelper.GetImage(KnownImageIds.SearchContract).WrapMargin(WpfHelper.GlyphMargin), (_FinderBox = new MemberFinderBox(Items) { MinWidth = 150 }), (_ScopeBox = new SearchScopeBox{ Contents = { new ThemedButton(KnownImageIds.StopFilter, "Clear filter", ClearFilter).ClearBorder().ClearMargin() } }), } }, } }; SubmenuOpened += RootItem_SubmenuOpened; _FinderBox.TextChanged += SearchCriteriaChanged; _ScopeBox.FilterChanged += SearchCriteriaChanged; _ScopeBox.FilterChanged += (s, args) => { _FinderBox.Focus(); }; }