To say a user "cannot" is redundant; you can simple add a rule to the user that says "can add customer".
At run time, the "ui" can access the "rule" for a given user and transaction, and enabled / disable that "menu item", tab, groupbox etc.
In most cases, the user never gets past the menu based on a rule. And which is friendlier than totally removing a menu item. In your case, if you want to enabled / disable add / edit / replace buttons, you need to establish "intent" first; which transates to less code but a few more menu items (to pass transaction codes).
Your "logging" gets more useable data too.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
Thanks. I found what I wanted in the Dispatcher class (which class Application uses). I needed to see more than I thought, because there is so much important code, however, what I originally was looking for was basically the following in Dispatcher.PushFrameImpl():
Where did you tell me everything what Application.Run() does and how it does it? If you can't understand my question or don't know the answer to my question, then I would like an answer from someone who does.
I told you where to find the information. Whatever that method does is internal to Microsoft, so they are the people to answer the question. What you have still not done, is to explain exactly what problem (if you actually have one) you are trying to solve.
I'm trying to drag a user control around a canvas. I want to prevent the user from dragging the control outside the canvas.. See my comment in green.
private void Control_MouseMove(object sender, MouseEventArgs e)
var draggableControl = sender as UserControl;
if (isDragging && draggableControl != null)
Point currentPosition = e.GetPosition(this.Parent as UIElement);
var transform = draggableControl.RenderTransform as TranslateTransform;
if (transform == null)
transform = new TranslateTransform();
draggableControl.RenderTransform = transform;
// Problem: currentPosition is the distance from the window's Left edge,
// not the left edge of the canvas
var newX = currentPosition.X - clickPosition.X;
if (newX < 0)
newX = 0;
if (newX > parent.ActualWidth)
newX = parent.Width - this.Width;
transform.X = newX;
transform.Y = currentPosition.Y - clickPosition.Y;
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
I describe, is the Edge Browser window tab, drag and drop out to generate a new form, the drag process mouse followed by a label image. What can I do to achieve a similar drag-and-drop operation?
What can I do to achieve the following functions, do you really want to use the mouse hook, Microsoft itself should not be in the UWP program to use Win32 things.
The main thing is that WPF mouse-moving event cannot be triggered outside the window.