menuitem

BottomNavigationView - How to uncheck all MenuItems and keep Titles being displayed?

空扰寡人 提交于 2019-11-29 09:31:45
As I liked the design from BottomNavigationView I decided to implement a new Menu for my App with it, instead of just using simple buttons. I took this post as a guideline. According to BottomNavigationView 's documentation , its purpose is to provide quick navigation between top-level views of an app. It is primarily designed for use on mobile. In my case, I just want each MenuItem to launch an activity, but by default there is always one MenuItem selected: I tried to set the color to white with: app:itemIconTint="@color/white" app:itemTextColor="@color/white" Still, visibly selected MenuItem

How do you bind a command to a MenuItem (WPF)?

喜欢而已 提交于 2019-11-29 08:56:30
问题 Here is my code from the View.xaml.cs: private RelayCommand _closeCommand; public ICommand CloseCommand { get { if (_closeCommand == null) { _closeCommand = new RelayCommand(param => this.OnClose()); } return _closeCommand; } } public void OnClose() { Close(); } And here is some code from my View.xaml: <Window.ContextMenu> <ContextMenu> <MenuItem Name="menuItem_Close" Header="Close" Command="{Binding CloseCommand}" /> </ContextMenu> </Window.ContextMenu> When I run the program and select the

WPF: Menu Items only bind command parameters once

戏子无情 提交于 2019-11-29 08:24:55
Ive noticed this a couple of times when using menus with commands, they are not very dynamic, check this out. I am creating a menu from a collection of colours, I use it to colour a column in a datagrid. Anyway when i first bring up the menu (its a context menu) the command parameter binding happens and it binds to the column that the context menu was opened on. However the next time i bring it up it seems wpf caches the menu and it doesnt rebind the command parameter. so i can set the colour only on the initial column that the context menu appeared on. I have got around this situation in the

WPF C# - Change the brush of a menu's background

亡梦爱人 提交于 2019-11-29 06:22:39
Does anyone know how to change the brush for a menu's background? This sounds simple, but I don't see any obvious way to do this. You'd think that the Background property would change it, but it doesn't. Here's what my menu looks like (notice the default white background): Example Code: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Window.Resources> <SolidColorBrush x:Key="menuItemBrush" Color="#FF505050" /> </Window.Resources> <Grid x

add menu item to default context menu

感情迁移 提交于 2019-11-29 02:04:07
I'd like to add a menu item to the default ContextMenu of a RichTextBox . I could create a new context menu but then I lose the spell check suggestions that show up in the default menu. Is there a way to add an item without re-implementing everything? It's not too tricky to reimplement the RichTextBox context menu with spelling suggestions, Cut, Paste, etc. Hook up the context menu opening event as follows: AddHandler(RichTextBox.ContextMenuOpeningEvent, new ContextMenuEventHandler(RichTextBox_ContextMenuOpening), true); Within the event handler build the context menu as you need. You can

Solved: How to add dividers in Bottom Navigation View

折月煮酒 提交于 2019-11-29 01:00:06
问题 I'm trying to add divider in menu items of BottomNavigationView All items are showing horizontally in the bottom but I'm not able to add dividers into it. Bottom Navigation View xml: <android.support.design.widget.BottomNavigationView android:id="@+id/navigation" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:focusable="false" app:itemBackground="@color/colorPrimaryDark" app:itemIconTint="@color/bottom_navigation_selector" app:itemTextColor="@color

Ugly “disabled” images of TMainMenu

 ̄綄美尐妖づ 提交于 2019-11-28 19:20:00
问题 Delphi 2010, Win32 VCL. I need to create a main menu for my application with the most standard look. TMainMenu looks nice in all Windows versions, the only bad thing is when it displaying images for items with Enabled=False. Delphi has some strange method for building that disabled images (b/w extrusion with bevels, for me it looks like spew). I want to make a patch for that procedure in VCL sources and let menu to select disabled images from the same TImageList, but I can't find it. Is it

How to select a Menu Item without closing the Menu?

最后都变了- 提交于 2019-11-28 17:57:26
By default when you select an item from a TMainMenu or TPopupMenu etc, the menu closes after it was clicked. I would like to change this behavior so that when I select on a menu item, the menu does not close but remains visible and open at the point it was last clicked, making it easier to select another menu item if desired. Of course, switching focus to another control should hide the menu like normal, but if the focus is still on the menu keep it visible. If this is possible, I would like this behavior to only work on specified menu items. In other words, if I can make all the menu items

Android ActionBar MenuItem LowerCase

风格不统一 提交于 2019-11-28 17:26:35
I want to make MenuItem title in the ActionBar to LowerCase. my menu.xml <item android:id="@+id/register" android:title="Register" android:showAsAction="ifRoom|withText"/> <item android:id="@+id/unregister" android:title="Unregister" android:showAsAction="ifRoom|withText"/> On the ActionBar it sees "REGISTER" and "UNREGISTER", but I want that it sees as "Register" and "Unregister". Is it possible to make first letter upper and next letters lower at MenuItem? And how I can do that? Solution for native ActionBar implementation: <?xml version="1.0" encoding="utf-8"?> <resources> <style name=

How can I bind an ObservableCollection of ViewModels to a MenuItem?

谁说胖子不能爱 提交于 2019-11-28 17:06:21
When I bind Menu Items with an ObservableCollection, only the "inner" area of the MenuItem is clickable: alt text http://tanguay.info/web/external/mvvmMenuItems.png In my View I have this menu: <Menu> <MenuItem Header="Options" ItemsSource="{Binding ManageMenuPageItemViewModels}" ItemTemplate="{StaticResource MainMenuTemplate}"/> </Menu> Then I bind it with this DataTemplate : <DataTemplate x:Key="MainMenuTemplate"> <MenuItem Header="{Binding Title}" Command="{Binding DataContext.SwitchPageCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Menu}}}" Background="Red"