Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8728443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:38:33+00:00 2026-06-13T08:38:33+00:00

I have a UserControl (and background ViewModel) that I use across multiple projects –

  • 0

I have a UserControl (and background ViewModel) that I use across multiple projects – it’s quite generic. Inevitably, in one project I have to modify it slightly to show an extra command (preferably as an extra button in the grids context menu, but if need be just an extra button). How can I implement this but keep the class generic?

edit: I’m aware of patterns like dependency injection in C#, but when it comes to xaml I don’t know how to proceed. So as well as specific ways to accomplish this I’m also after possible design options.

If more details are required let me know.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:38:35+00:00Added an answer on June 13, 2026 at 8:38 am

    To have some form of reuse I broke down the generic xaml page into usercontrols, built a specific xaml page and referenced the generic usercontrols where possible. It’s not what I wanted to do, but it’s better than a completely new xaml page for every instance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I have a WPF UserControl (MainControl - not shown in code below) that
I have ElementFlowContainer user control that contains ElementFlow from FluidKit.Showcase project. <UserControl x:Class=Controls.ElementFlowContainer> <Grid>
I have a UserControl with something that does some background work. When thing has
I have one ==> UserControl . Inside that UserControl ==> One ItemsControl . Now
I have a canvas that I want sized to fit a background ImageBrush. One
I have a UserControl that has a repeating-image background set with the following code:
I have an UserControl that contains a Button : <UserControl> <Button> </UserControl> I want
I have a UserControl with a Border element within it that I want to
I have a UserControl that listens to it's own MouseLeave in order to change
I have a UserControl that exists of only two TextBlocks: <UserControl [...] x:Name=root> <StackPanel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.