Are there people here who can help you figure out how to create custom elements for WPF C #?

The only thing I can do is create a class in a project, give it inheritance from an element and call it in XAML code using

<local:Class1/> 

But how to fill these elements? for example if the class itself takes a value on input?

 public Class1(string srt) : base() 

How in this case in the XAML code to set the value of str?

  • No XAML does not support parameter constructors. Use properties (dependencies). You can, of course, come up with some kind of hack, for example, using markup extensions, but without knowing the problem it is difficult to advise something - Andrey NOP
  • and then how to create a custom element so that it can be used in XAML and entering values? Internet surf, I can not find the answers that will be clear to teapots - Mark Sinelschikov
  • one
    Properties of dependence, I wrote. Here is an example: professorweb.ru/my/WPF/Template/level18/18_2.php - Andrey NOP

0