Hide the close button on the context-sensitive menu? (XAF) - winforms

I want to remove the close button from the context-sensitive menu that appears when I right click a record in list view.
I found instructions how to do it for web forms but I am using Winforms.
I don't want to deactivate the controller because I still need the close button on the main toolbar.
I am wondering whether to move the barContainerClose from the barContainerView
In the template

Related

How know if right click is on a "text being edited" not/before "text changed" event in winforms?

My question might be simple but I couldn't find specific answer on web.
I have a winforms application with a grid inside, in which I have implemented a context menu to be shown on right click on cells. These cells include text elements that can be edited. When user clicks or double clicks on the cell, the text can be edited and that's what I want. The problem is when the text is in edit mode and user right clicks on it again, 2 context menus are shown on each other. One is my context menu and the other is windows right click on text including options like copy, paste etc.
I wonder if there is any event like "text being edited" or "windows default context menu opened" that can be used for such scenarios? Or what is the proper way of solving this problem, which I guess must be a common one.
In these cases I want to show only the windows right-click menu, not mine.
Perhaps you need the Control.GotFocus event: https://msdn.microsoft.com/en-us/library/system.windows.forms.control.gotfocus%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
You could look for focus, then prevent right clicks in the control until the control has lost focus (Control.LostFocus). If the control gets focus from a right click, then you could open your context menu (I think).

How to handle multiple usercontrols in windows 8?

In my mainpage i added around 15 user controls and 10 more button images.Whenever click on particular button image displaying corresponding usercontrol.usercontrol having close button to close that control.my question is if user not closing particular usercontrol and click on another button image it's displaying another usercontrol.How to close previuos usercontrol when click on another button image. general idea we can disabling usercontrols by it's visibilty property when click on other button.But in my case so many usercontrols and buttons are there.it's hectic to write code like that for close previous usercontrols .Any other ideas to close that ?

Template for Button with an appended toggleButton (ToggleButton shows context menu on clicking)

How to make a control which has both button and togglebutton/Combobox? on clicking the toggle button i should be able fire a command depends on the selection.
1. I want some templates to achieve this (i.e. On clicking left side of the control, i have to fire Open command and on selecting right side of the control it should open other options ).
2. Also, is there any way to achieve such that i just have to provide various items like "Open", "Show previous versions" and the button takes the first item (in this case "Open")

WPF + PRISM - show modal popup window with controls in it?

I am following the 'Stock Trader RI' example by the Prism team,
but it does not address this exactly :
I have a Shell with a Main Region in it.
In this shell I have some filter fields and a grid.
When I press on a button - I would like to load a screen that allows me to change the filters,
and then press 'Save'. This would then call a service to update the fields, and close the pop-up.
Here is an illustration of the 'Shell' before pressing the button (left) and after (right) :
Problems are :
The 'Stock Trader RI' sample app only uses a modaless dialog popup. I need a MODAL pop-up (background will continue to refresh, but user will not have access to it as long as pop-up is active).
Need to have Silverlight-like effect when pop-up shows, meaning - 'Shell' needs to appear 'disabled' (like a gray mask over it).
Pop-up window should have no 'X' button and no 'minimize' or 'maximize' buttons. The pop-up window should be simply a rectangle with curved-corners.
I don't think I can use a 'Notification Window' or a 'Confirmation Window' because I cannot put inside them whatever I want. This is an example with 2 fields, but the pop-up might be much more complex with tabs, and a lot of information shown to the user.
So how do I show a modal pop-up from my "WPF+PRISM" Shell-View-Model once the 'Edit' button is pressed ? (Meaning, once the 'EditCommand' is executed...)
I have found a solution here.
Basically it uses InteractionRequest and it allows me to open a window (that I can style however I want, without the 'Maximize' 'Minimize buttons), and also - I can choose for it to be Modal.
Great thing about this solution is - that I can use custom pop-ups and not only Notification or Confirmation pop-ups.
Also - I can pass information back to the class the invoked the 'InteractionRequest'.
Only thing that it doesn't solve - is that I cannot make the calling view look disabled by adding a gray semi-transparent over it ... haven't figured out yet how to do that...

Grids - Action Column to behave like a Flyout Menu

I'm using ExtJS for my project and can see that there is a way to embed "actioncolumns" inside of Grid columns. However, my "action" isn't just a single click, it actually needs to show a flyout menu (similar to the Menu control). Is there a direct way to do this in Ext? Or do I have to implement all this functionality myself?
There is no direct way. You need to create a menu and show it manually in the event handler for action button. You can also show menu as a context menu for the grid (right click).

Resources