Usercontrol, what is it? When to use?

Asked

Viewed 1,627 times

3

I am studying the best way to do a user control in a WPF application, but I have some questions regarding the UserControl available in VS 2015.

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

The one from UserControl is for this purpose? If yes, how to use? If not, what alternative to my solution?

  • 4

    I’ll answer back later, but it has nothing to do with permissions, access control, none of that. It is a user interface object (button, text box, etc.) customized by the user (in this case the programmer)

  • 1

    Bigown good afternoon. Blz, If you succeed, be sure to answer your answers are great and come helping me a lot.

1 answer

9


The UserControl is a WPF control used as a basis for the programmer to create their own controls (GUI elements) composing other existing controls as if they were one. It has advantages and disadvantages. It is different from CustomControl which 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, it can be creative.

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

Of course one can create a control that is the data entry of a login. But not that will only be useful if you have one design very well planned, if it works as a team, if it is reused several times. It is an advanced programming and do not recommend until have a very large programming domain in general and WPF (it is not easy to do right).

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

It is not at all what it is intended to do with user access control, this is something more complex that has nothing ready in the . NET even less in WPF that only deals with screens, and from what I understand want a functionality that depends on a model where the screen will only be a final element.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.