4

I was wondering how could I save a user control just like we can save a c# class in a dll file and import that file whenever we need to use that class. How could we import that control and use it. It will be nice if we could make custom controls and save them for reuse instead of having to copy the xaml and code behind every time we had to use it.

1 Answer 1

7

You have exactly that flexibility with WPF and a lot of choices. Here is an excellent introduction to your options:

These choices include:

  • Deriving from UserControl
  • Deriving from Control
  • Deriving from FrameworkElement

The tradeoffs are described in detail in the article.

Sign up to request clarification or add additional context in comments.

2 Comments

Dead link. Any ideas on a new one?
Link is fine now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.