UserControl, what is it? When to use?

2

I am studying how to best control users in a WPF application, but I have some doubts about UserControl available in VS 2015.

I have already programmed an access control, ie user and login , user registration and etc., but now I need to define what each user can edit, or just view, or even want view.

What is UserControl for this purpose? If yes, how to use it? If not, what is the alternative to my solution?

    
asked by anonymous 08.08.2016 / 20:08

1 answer

5

The UserControl is a WPF control used as the basis for the programmer to create his own controls (GUI elements) by composing other controls as if they were one. It has advantages and disadvantages. It is different from the CustomControl that is used to extend a specific control. It can be used to create a control that is a combination of a text box with a button, for example. Or you can create a set of checkbox that can enable or disable some of its members according to the state of one of them. Anyway, you can be creative.

It has to do with user interface object in a general way. It is not about permissions and access control. It should not be read as "user control", but rather a "user-created control (programmer)".

Of course you can create a control that is the input of a login . But this is not only useful if you have a well-designed design , if you work in teams, if it is reused several times. It is an advanced programming and I do not recommend until you have a very large domain programming in general and WPF (which is not easy to do right).

It is a middle ground between a basic control and a form.

It is not even close to what you intend to do with user access control, this is something more complex that has nothing ready in .Net even less in WPF that only deals with screens, and from what I understand you want a feature that depends on a model where the screen will be just a final element.

If you have specific questions about the other subject you can ask several questions. I stopped the main one that was asked, within this context.

    
09.08.2016 / 14:00