R
R
rad952020-02-23 19:21:04
WPF
rad95, 2020-02-23 19:21:04

How to bind controls directly?

I have created a UserControl which has a Slider. How do I directly enter the Slider when creating an instance of this UserControl? That is, a ready-made instance of the slider class and it must be directly brought into this control

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Korotenko, 2020-02-23
@rad95

Throw out the properties you need, or change the scope for the slider by making it public

R
Roman, 2020-02-25
@yarosroman

Use DependencyProperty. You declare properties using DP in your UserControl, and change them for example in slider events. Using DP will allow you to bind to them in xaml.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question