menuitem

WPF: “ApplicationCommands.New” showing incorrect Source in case of MenuItem

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 07:11:35
问题 I am new to WPF and am going through the examples of Professional WPF in .net 4.5. In the commands chapter, there is an example where multiple controls can send the same command. I am using a Button, CheckBox and MenuItem to trigger the New command. The issue I am facing is that if MenuItem is pressed for the first time, the source shows correctly. However, after clicking the Button or CheckBox, then clicking MenuItem shows me the source of the last control Button or CheckBox, whichever was

Why is item.getMenuInfo() null?

牧云@^-^@ 提交于 2019-12-02 06:41:51
Within my ListVeiw item I have 4-8 ImageView(some of them are invisible depended of some value) and 4 TextView. When I Long click to item of Listview the (AdapterContextMenuInfo) item.getMenuInfo() returns me null. In my adapter I have defined the following methods: public int getCount() { return NewList.size(); } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public void Remove(int id){ notifyDataSetChanged(); } public View getView(int position, View convertView, ViewGroup parent){ View vi=convertView; NewsFeedHolder holder;

changing menu item programmatically is not working in android

无人久伴 提交于 2019-12-02 06:17:53
I have a menu item and I want to change its visibility programmatically. The menu is this <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/pencil" android:orderInCategory="100" android:showAsAction="always" android:visible="true" android:title="@string/for_pencil"/> </menu> then some where in my code I have ((MenuItem) findViewById(R.id. pencil)).setVisible(false); Error: E/AndroidRuntime(13845): FATAL EXCEPTION: main E/AndroidRuntime(13845): java.lang.ClassCastException: com.android.internal.view.menu

How can i change the icon color of searchview in actionbar?

吃可爱长大的小学妹 提交于 2019-12-02 05:50:25
This is my menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_search" android:icon="@drawable/search_icon" android:title="@string/action_search" app:actionViewClass="android.widget.SearchView" app:showAsAction="always" /> <item android:id="@+id/action_favorite" android:icon="@drawable/favorite_icon" android:title="@string/action_favorite" app:showAsAction="always" /> <item android:id="@+id/themes" android:title="@string/overflow_menu_item" app:showAsAction="never"> <menu> <item android:id=

java.lang.NullPointerException when try listview.getChildAt()

孤街浪徒 提交于 2019-12-02 04:54:56
There is ListView with correct values: public class FragmentTab1 extends SherlockFragment { ListView list; LazyAdapter adapter; @Override public void onViewCreated(View view, Bundle savedInstanceState) { list = (ListView) getActivity().findViewById(android.R.id.list); //also I tried view.findViewById(android.R.id.list) ............ adapter = new LazyAdapter(getActivity(), mSource); list.setAdapter(adapter); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){ View rootView = inflater.inflate(R.layout.fragmenttab1, container, false);

WPF: “ApplicationCommands.New” showing incorrect Source in case of MenuItem

南楼画角 提交于 2019-12-02 03:19:33
I am new to WPF and am going through the examples of Professional WPF in .net 4.5. In the commands chapter, there is an example where multiple controls can send the same command. I am using a Button, CheckBox and MenuItem to trigger the New command. The issue I am facing is that if MenuItem is pressed for the first time, the source shows correctly. However, after clicking the Button or CheckBox, then clicking MenuItem shows me the source of the last control Button or CheckBox, whichever was pressed. I couldn't find what was wrong with my code or why is this behavior shown by MenuItem in WPF.

asp:MenuItem / CSS

こ雲淡風輕ζ 提交于 2019-12-02 02:16:49
I have an asp menu, with only 1 (top) level of menu items. Each of the menu items needs to have a different way to be recognized by CSS (for unique hover, etc.). I'm trying to avoid a javascript solution. Currently I can find no way with just asp and CSS to control individual menu items. Any help would be appreciated! <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal"> <Items> <asp:MenuItem NavigateUrl="~/Default.aspx" Text="My Tab" /> <asp:MenuItem NavigateUrl="foo.aspx" Text="etc" /> </Items> </asp:Menu>

Android Studio Menu Item click not working

ⅰ亾dé卋堺 提交于 2019-12-02 01:43:45
So my menu items wont do anything except show the enlarging animation when clicked on. Im trying to open a new activity with them, I have toast attached to one to see if does anything at all and I'm getting nothing. Is this a common issue? minSdkVersion 17 targetSdkVersion 27 Layout <android.support.design.widget.BottomNavigationView android:id="@+id/navigation" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginEnd="0dp" android:layout_marginStart="0dp" android:background="?android:attr/windowBackground" app:layout_constraintBottom_toBottomOf="parent" app

C# how to disable keybinding

我的未来我决定 提交于 2019-12-02 01:05:29
The MenuItem control has the convenient property IsEnabled (inherited from UIElement ). This allows me to, when appropriate, hide the command exposed by that menu option. But if that command is also bound to a key (e.g. Ctrl+K), the user can still access it. How do I get the IsEnabled functionality to a KeyBinding ? If you bind the KeyBinding to an ICommand , you can just set the ICommand.CanExecute to false (and potentially raise CanExecuteChanged ). This will "disable" the KeyBinding since the command itself will be disabled. 来源: https://stackoverflow.com/questions/15706070/c-sharp-how-to

ASP.Net Menu Control - Horizontal - Not Showing Sub Options

痴心易碎 提交于 2019-12-01 22:16:28
I am trying to use the ASP:Menu control. It is rather simple. I want it Horizontal. Each of those first level items will have Sub items. I can get it Horizontal and when I hover over the Instant Reports or the Configurable Reports choice it seems to pop down a div or something but it is empty. I have tried formatting and everything I can think of as well as find on the internet. What am I doing wrong? <asp:Menu ID="mnuChoices" runat="server" Orientation="Horizontal" DataSourceID="dsSiteMap"> </asp:Menu> <asp:SiteMapDataSource ID="dsSiteMap" runat="server" ShowStartingNode="false" /> Here is