contextmenu

Command bind to ContextMenu (which on ListBoxItem in ListBox) don't work [duplicate]

半腔热情 提交于 2019-12-22 09:01:09
问题 This question already has an answer here : ContextMenu Command Binding to parent and to self (1 answer) Closed 3 years ago . In WPF, with MVVM light, there's a Class (which is consist of some students), and the Class hold some Student s. Right-Click one Student's name, then will show a MessageBox , it is ok in this way: ClassDetailView.xaml <UserControl DataContext="{Binding ClassDetail, Source={StaticResource Locator}}"> <DockPanel> <ListBox ItemsSource="{Binding Students}" DisplayMemberPath

How can I test context menu functionality in a web app?

我怕爱的太早我们不能终老 提交于 2019-12-22 08:46:16
问题 I'm playing with a grails app that has a contextmenu (on right-click). The context menu is built using Chris Domigan's jquery contextmenu plugin. While the contextmenus do actually work, I want to have automated tests, and I can't work out how to do it. I've tried Selenium 2.05a (ie. Webdriver), but there's no rightClick method. I notice that HtmlUnit has a rightclick method, but I don't seem to be able to detect any difference in the DOM between before the click and after it. 回答1: Currently

Context menu is cut in some situations in WPF

我与影子孤独终老i 提交于 2019-12-22 08:12:04
问题 Context menu is truncated in different .NET Framework. See images inside ZIP file (there are two screenshots, one from XP and other from Win7). I created a simple Visual Studio 2010 solution which repro my issue. ( http://www.mediafire.com/download.php?doq7gsh75qgvzwq ). On XP it seems to work fine, but not on Windows 7. The issue can be reproduced on Windows 7 if target .NET Framework is 3.5 (including SP1) (please see the image from zip). If I change the target framework to 4.0 it works

JavaFX ContextMenu how do I get the clicked Object?

爷,独闯天下 提交于 2019-12-22 06:10:28
问题 I am learning javafx.scene.control.ContextMenu, and right now I am facing a problem: how do I get the clicked Object from EventHandler? both event.source() and event.target() return the MenuItem. let me explain with an example: what should I write inside the function handle? TextField text = new TextField(); Label label1 = new Label("hello"); Label label2 = new Label("world"); Label label3 = new Label("java"); ContextMenu menu = new ContextMenu(); MenuItem item = new MenuItem("copy to text

WPF: Hiding ContextMenu when empty

无人久伴 提交于 2019-12-22 03:43:03
问题 I have a context menu that gets menu items through databinding (I'm using the MVVM pattern): <ContextMenu ItemsSource="{Binding Path=ContextMenuItems}" /> This works fine. However, in the cases when there are no menu items to show, I don't want the context menu to show up at all. Is there a way to accomplish this? Some kind of XAML trigger maybe? I've tried catching the Opened event och closing the context menu when there are no children. This works but the context menu still flashes by...

WPF: Hiding ContextMenu when empty

半城伤御伤魂 提交于 2019-12-22 03:42:19
问题 I have a context menu that gets menu items through databinding (I'm using the MVVM pattern): <ContextMenu ItemsSource="{Binding Path=ContextMenuItems}" /> This works fine. However, in the cases when there are no menu items to show, I don't want the context menu to show up at all. Is there a way to accomplish this? Some kind of XAML trigger maybe? I've tried catching the Opened event och closing the context menu when there are no children. This works but the context menu still flashes by...

Override the general paste context menu in Android

a 夏天 提交于 2019-12-22 01:05:13
问题 I think that this is not possible but I think it is better to ask someone who knows the answer for sure. Is it possible to create an android application that affect the context menu in all applications so that when the user long press an edit text view, not only the paste option will be visible but also my customized paste function? What I want to do is to make it easy for the user to import texts from my application without leaving the application they are working in. One thing I have

ContextMenu with footer view (to add checkbox for 'make default' option)

你离开我真会死。 提交于 2019-12-21 23:50:37
问题 Is there a standard way to add a footer to a context menu , in which I can add a checkbox to make the selected option the default one? Similar to the context menu that comes up when choosing the default home screen for example. From the Api docs for ContextMenu I see that you can set a header view, but not a footer view. Also the setCheckable / setGroupCheckable methods don't seem to help much here. Does this need to be done via a custom (alert) dialog? I would be wondering if nobody has yet

Accepting File Argument in Python (from Send To context menu)

試著忘記壹切 提交于 2019-12-21 20:24:06
问题 I'm going to start of by noting that I have next to no python experience. alt text http://www.aquate.us/u/9986423875612301299.jpg As you may know, by simply dropping a shortcut in the Send To folder on your Windows PC, you can allow a program to take a file as an argument. How would I write a python program that takes this file as an argument? And, as a bonus if anyone gets a chance -- How would I integrate that with a urllib2 to POST the file to a PHP script on my server? Thanks in advance.

How to add a Column ContextMenu in the WPF DataGrid

穿精又带淫゛_ 提交于 2019-12-21 20:19:50
问题 I'm trying to add a context menu to a column in the WPF datagrid and don't quite see how this is possible. I know how to add one to the datagrid, but I would like to have different menu items based on the column as well have the menu click event be aware of column or better yet the cell that the context menu was chosen for. My ultimate goal is to create a context menu that has a "Clear" menu item which will be used to null out the data in that column. I don't want an empty string or false in