M
M
Michael2015-07-28 10:37:42
OOP
Michael, 2015-07-28 10:37:42

How to assign interface to PasswordBox?

How to create your own UserControl PasswordBox in WPF, and assign your interface to it, for example, IPasswordBox?
The problem is that the main PasswordBox class cannot be inherited.
Is it possible somehow without creating your own UserControl, add your own interface to the PasswordBox control?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tex0, 2015-07-28
@Sing303

The problem is that the main PasswordBox class cannot be inherited.

I can suggest describing the required IPasswordBox interface, then creating a UserControl, inheriting it from IPasswordBox and aggregating the standard PasswordBox there, highlighting the necessary properties for the interface functionality.
(Well, in general, use aggregation. Also a crutch, but already more sane, if only because you don’t need to write your bike, but connect an existing one)

D
Dmitry Kovalsky, 2015-07-28
@dmitryKovalskiy

Do I understand correctly that you want to create a UserControl without creating a UserControl?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question