menuitem

How to correctly bind menu items?

时光怂恿深爱的人放手 提交于 2019-11-29 19:30:26
问题 How do i correctly bind a dynamical created list of menu items. I have tried several thing but none seem to work. I get the proper list of names, however my ViewSwitchCommand does not seem to fire correctly. <MenuItem Foreground="White" Header="Names" ItemsSource="{Binding Player.ToonNames}" Command="{Binding ViewSwitchCommand}" CommandParameter="{Binding Header}"/> However if i don't do it dynamically and do it like this then everything works just fine can get it to work <MenuItem Foreground

CSS: How can I center a horizontal list? Display:Inline not working

£可爱£侵袭症+ 提交于 2019-11-29 17:04:12
问题 I am having major trouble getting the simplest of codes to work. I want my css horizontal list to be centered, that's all. Link here: http://bit.ly/LtIBai I have this code: #megaMenu.megaMenuHorizontal ul.megaMenu { text-align: center; } #megaMenu.megaMenuHorizontal ul.megaMenu > li { display: inline; } Yet it will not center? NOTE: The window must be at "tablet portrait" size to see the code I'm referring to. Approximately 800px wide, when the logo is centered and the menu falls to the next

WPF menu item with image

烂漫一生 提交于 2019-11-29 16:36:18
问题 How to define MenuItem.Icon so that the MenuItemHeader text would be placed below the menu item image?Thanks for help! 回答1: The easy way way is to not use the Icon property but to instead put the icon in the Header: <Menu> <MenuItem> <MenuItem.Header> <StackPanel> <Image Width="20" Height="20" Source="/XSoftArt.WPFengine;component/Images/export32x32xp.png" /> <ContentPresenter Content="Reports" /> </StackPanel> </MenuItem.Header> </MenuItem> <MenuItem Header="Export" /> <MenuItem Header="New

Navigation drawer menu item with titles and sub titles

∥☆過路亽.° 提交于 2019-11-29 15:17:06
问题 I have a navigation drawer prototype. we have heading and subheading in the same. am using menu group to include the titles. 1) just want to add sub title or help text for the navigation drawer. 2) want to customise the icon size to fit the whole heading and sub heading so it looks like the image below. <item android:id="@+id/nav_home" android:icon="@drawable/ic_menu_home" android:subtitle="View your biorhythm" <!-- This should be sub title. --> android:title="Home" /> 回答1: Inside in

Android: background color when menu item is pressed

浪子不回头ぞ 提交于 2019-11-29 14:27:20
I'm trying to change the background color to the menu item when it is pressed. Change the background color but not the color when pressed. WHISED: Background: dark gray Background pressed: orange OBTAINED: Background: dark gray Background pressed: blue (default Android) What I can do? Thanks Styles.xml <style name="AppTheme2" parent="android:Theme.Holo"> <item name="android:popupMenuStyle">@style/MyApp.PopupMenu</item> </style> <style name="MyApp.PopupMenu" parent="android:Widget.Holo.ListPopupWindow"> <item name="android:popupBackground">@drawable/menu_item_selector</item> </style> menu_item

WPF : MenuItem.CommandParameter binding set to null

╄→尐↘猪︶ㄣ 提交于 2019-11-29 14:19:05
I have the following ContextMenu defined for my data grid: <igDP:XamDataGrid.ContextMenu> <ContextMenu ItemsSource="{Binding CommandViewModels}" > <ContextMenu.ItemContainerStyle> <Style TargetType="MenuItem"> <Setter Property="Command" Value="{Binding Command}" /> <Setter Property="CommandParameter" Value="{Binding CommandParameter}" /> <Setter Property="Header" Value="{Binding Name}" /> <Setter Property="Icon" Value="{Binding Icon}" /> </Style> </ContextMenu.ItemContainerStyle> </ContextMenu> </igDP:XamDataGrid.ContextMenu> A CommandViewModel class is defined as follows: public class

How to add line divider for menu item Android

核能气质少年 提交于 2019-11-29 12:19:31
问题 My menu item become bigger so that I want group them and make a line divider to separate each group. What should I do now ? <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <!--group1--> <item android:id="@+id/action_addtag" android:title="@string/add_hashtag_string" app:showAsAction="never" /> <item android:id="@+id/action_block_list" android:title="Block" app:showAsAction="never" /> <item android:id="@+id/action_report

asp.net adding class to current menuItem

蓝咒 提交于 2019-11-29 11:45:43
I am new the asp.net so i will appreciate a full code answer. I have a web site in asp.net and c# i added a menu to the site.master page it looks like this: <asp:Menu ID="mainMenu" runat="server" autopostback="true"> <Items> <asp:MenuItem Text="Home" Value="Home" ></asp:MenuItem> <asp:MenuItem Text="Pipes" Value="Pipes"></asp:MenuItem> <asp:MenuItem Text="View & Query" Value="View & Query"></asp:MenuItem> <asp:MenuItem Text="API" Value="API"></asp:MenuItem> </Items> </asp:Menu> I now need to add that when the user is on a specific page for example Pipes, then the right menuItem should have a

Animated menu item “jumps” when animation starts

偶尔善良 提交于 2019-11-29 10:56:29
I am using the code from this question: Animated Icon for ActionItem to animate my refresh ActionBarButton . It works fine, except that the style doesn't seem to be right. When I click the item, it starts rotating, but only after it "jumps" a few pixels. It seems like the style of the ImageView is different from the style of the menu item. The item is defined like this: <item android:id="@+id/action_refresh" android:orderInCategory="100" android:icon="@drawable/ic_menu_refresh" android:showAsAction="ifRoom" <!-- added this myself, didn't have any effect --> style="@android:style/Widget

Why is this WPF RoutedCommand bound Context MenuItem disabled?

余生长醉 提交于 2019-11-29 10:37:00
I'm still fumbling my way around WPF at the moment, and can not figure out why this context menu item is disabled: <Window x:Class="DisabledMenuItemProblem.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:DisabledMenuItemProblem" Title="Window1" Height="300" Width="300"> <TextBlock Text="fooooobaaaaaar"> <TextBlock.ContextMenu> <ContextMenu> <MenuItem Header="Foo" Command="{x:Static local:MyCommands.FooBar}" /> </ContextMenu> </TextBlock.ContextMenu> </TextBlock> </Window> using System