contextmenu

How to get the PlacementTarget on WPF Context menu when item click using MVVM pattern

て烟熏妆下的殇ゞ 提交于 2019-12-06 16:35:31
How to get the PlacementTarget of selected ContextMenu when using MVVM pattern ? I can get PlacementTarget like this when using MenuItem click event. But how it do it MVVM ? public void changeGaugeColor(object sender, RoutedEventArgs e) { MenuItem tempMenuItem = (MenuItem)sender; MenuItem mi = (MenuItem)sender; bd = (BidirectionalDial)cm.PlacementTarget; } I realise that this is an old post, but someone might find this useful to know. Assuming that you have bound your view to your view model, then you can then bind your ContextMenu.DataContext to your view model in the following way: First,

C# 中 ContextMenuStrip 和 ContextMenu区别

有些话、适合烂在心里 提交于 2019-12-06 16:10:01
简单来说,就是版本不同,只不过是升级后建议功能更加强大的ContextMenuStrip罢了,升级后的元件功能更强 。 ContextMenu是VS2005里的,而ContextMenuStrip是VS2008以后的版本里面的。 ContextMenuStrip 替换 ContextMenu, 【1】可以将 ContextMenuStrip 与任何控件关联,单击鼠标右键会自动显示快捷菜单。 【2】可以通过使用 Show 方法以编程方式显示 ContextMenuStrip。 【3】ContextMenuStrip 支持可取消的 Opening 和 Closing 事件以处理动态填充和多次单击方案。 【4】ContextMenuStrip 支持图像、菜单项复选状态、文本、访问键、快捷键和级联菜单。 尽管 ContextMenuStrip 对以前版本的 ContextMenu 控件的功能进行了替换和添加,但考虑到向后兼容性和将来的使用(如果的确需要),仍然保留了 ContextMenu。 建议采用ContextMenuStrip 来源: https://www.cnblogs.com/xixiuling/p/11993348.html

Extending windows explorer context menu

China☆狼群 提交于 2019-12-06 15:54:35
I'm having hard times figuring out why this doesn't work on my computer. I've read this article http://msdn.microsoft.com/en-us/library/bb776820.aspx and tried it, and it works for an unknown file type, but for know such as .bmp it doesn't - I've also deleted other keys under .bmp - didn't help. I've tried this in HKEY_CLASSES_ROOT.bmp and in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.bmp I need to implement this in my program so it has custom context menu items on some file types like bmp. btw. I've tried ContextEdit (a freeware program) - also didn't work -

WPF ContextMenu Design. How to set Background in WPF MenuItem?

时间秒杀一切 提交于 2019-12-06 15:23:23
I create popup menu like this. <DockPanel.ContextMenu> <ContextMenu Background="#CD252220" Opacity="0.95" Foreground="LightGray" BorderBrush="DarkGray"> <MenuItem Header="_Save Image..." x:Name="btSave" IsEnabled="False" Click="btSave_Click" Style="{StaticResource MyStyle}"> <MenuItem.Icon> <Image Source="icons/save.png" Width="16" Height="16" Style="{StaticResource IconStyle}"/> </MenuItem.Icon> </MenuItem> </ContextMenu> </DockPanel.ContextMenu> Why left-side of this menu is WHITE????? It'll be a #CD252220 color or transparent, bun not white!!!!!! How to fix it? :) http://itrash.ru/idb

how to pass data when using MenuItem.ItemContainerStyle

非 Y 不嫁゛ 提交于 2019-12-06 15:07:58
问题 i've been trying to have a dynamic ContextMenu to show the name property of each of the object in its collection of objects . here is concrete example ,i'm connecting to a webservice to pull contacts and groups of a particular account.so i have those as global variables . i display the contacts in a listbox and i want to show on right click of a contact in the listbox the list of groups that it can be added to . to be able to add a contact to a group i need the id of the contact(which i have)

Disabling the Flash Player default context menu in OpenLaszlo applications

狂风中的少年 提交于 2019-12-06 14:46:18
When an OpenLaszlo application is deployed using the SWF10/11 runtime, is it possible to completely disable the Flash Player context menu on desktop computers? That's only possible starting with Flash Player 11.2. I have done a test run with a modified version of OpenLaszlo based on the flex4.6 branch, adding Flash 11.2+ support to the OpenLaszlo compiler. With the following LZX code I managed to remove the default Flash Player context menu completely: <canvas width="100%" height="800" proxied="false"> <passthrough when="$as3"> import flash.events.MouseEvent; </passthrough> <handler name=

How do I add items to the Finder context menu in Mac OS X using JAVA?

独自空忆成欢 提交于 2019-12-06 13:29:32
问题 I'm trying to port Java application to Mac OS, My program needs to add items to Finder context menu, Is there a way to add items using Java ? Thanks 回答1: An old question, but for prosperity, I'd like to try to answer this. The Liferay Nativity (Java) library is a cross-platform way of programatically adding icon overlays and context menus to file browsers, for Mac, Windows and Linux. On Mac, Liferay Nativity relies on the Objective-C-based 'Finder Sync' framework: Finder Sync overview (Mac

How to add ContextMenuStrip to ToolStripMenuItem

本小妞迷上赌 提交于 2019-12-06 13:22:16
I want that when I click on a menu item, display a context menu with items such as "delete", "rename", etc. How to bind itself a context menu when you right-click on the menu item? The first idea jumping in my mind was hook up some MouseDown event on the ToolStripMenuItem and show the second ContextMenuStrip at the mouse position in screen coordinates. But it's not such simple. The problem is doing so will require hooking up the event for every items, on that event somehow showing the second ContextMenuStrip will close the current ContextMenuStrip (even we add some Closing event handler and

Android: help create Context menu from listview

可紊 提交于 2019-12-06 12:29:33
this is the class. i want to add context menu to it on longpress but as a newbie i find i difficult. Please help. private ListView lvUsers; private ArrayList<UserBO> mListUsers; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.select); mListUsers = getUsers(); lvUsers = (ListView) findViewById(R.id.lv_user); lvUsers.setAdapter(new ListAdapter(this, R.id.lv_user, mListUsers)); } public ArrayList<UserBO> getUsers(){ DBAdapter dbAdapter=DBAdapter.getDBAdapterInstance(this); try

Android: Theme ContextMenu item selection

时间秒杀一切 提交于 2019-12-06 11:10:06
How can I theme the list seletor in a ContextMenu? For ListViews I used the way described here: http://brainflush.wordpress.com/2009/03/15/understanding-android-themes-and-styles/ So I assigned the created style to my theme like this: <style name="Theme...." parent="@android:style/Theme.Light"> <item name="android:listViewStyle">@style/ListView</item> </style> ialexander Try Override context menu colors in Android and see if it helps. It says you can't override the standard context menu selector but goes on to give code for context on long-press. To theme any list item I assign a background on