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

  • Home
  • SEARCH
  • 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 146573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:37:38+00:00 2026-05-11T08:37:38+00:00

A better explanation, I hope: I have a toolbar with 3 buttons on it,

  • 0

A better explanation, I hope:

  • I have a toolbar with 3 buttons on it, all three bound to a Command (including a CommandParameter)
  • this toolbar is used on several screens
  • the xaml of the toolbar is exactly the same over all those screens

I want to remove the toolbar instance and replace it with a user control that provides 3 commands, so I can keep the bindings in each screen. The plan is to later change the toolbar functionality, but the external programming interface (namely, 3 commands) is the same.

So:

  • I created a user control, and created 3 sets of dependency properties for each command (OneCommand, OneCommandParameter, OneCommandTarget) so I can use these for the binding.
  • I moved the toolbar xaml inside the user control xaml.
  • I modified the bindings on the toolbar buttons to bind to the intristic user control properties
  • on each screen (or really, only the first for now) I replaced the original toolbar with the user control,binding the new properties to the correct commands.

The control shows, but the buttons don’t work. That’s about it.

—

Original explanation – not so clear:

I have a WPF user control encapsulating a number of buttons. Previously, the control was a Toolbar with a number of buttons on it, but since I need exact the same functionality on a number of screens, I refactored the toolbar into a custom control.

However, I’d like to keep the command bindings of the original buttons.

  • I created 3 sets of dependency properties (XCommand, XCommandParameter and XCommandTarget) on the usercontrol.
  • In the user control xaml I bind the ‘real’ buttons to those properties (each button to each set of properties).
  • Where I use the usercontrol, I bind the new properties to the real command bindings.

In essence, I want to keep the ICommandSource functionality for each ‘command’ that the user control exposes. However, this dual databinding scenario doesn’t seem to work, or I’m doing something wrong. 🙂

Is there a better way to do this? All I need is to ‘bridge’ the commands from outside the control to the inner buttons so the Execute and CanExecute functionality remains.

  • 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. 2026-05-11T08:37:38+00:00Added an answer on May 11, 2026 at 8:37 am

    I solved this. There was a bug in my RelativeSource in the internal control bindings. It works fine as expected, now.

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

Sidebar

Related Questions

Jump to the EDIT for a better explanation! I have tried to get this
This might be confusing, so just ask if a better explanation is needed. I
any better way to write this ? $(this).parent().parent().find( dd ul).toggle(); update.. I am trying
I have bumped into this concept using Python distutils2/packaging . I did google it,
I hope the title is chosen well enough to ask this question. Feel free
I have a plugin that exposes a wcf service. if I test this service
Is it better to have a field status enum('active', 'hidden', 'deleted') OR status tinyint(3)
To help better explain my Question, here is what i have: I am using
So, I know this has been done to death but all the answers I've
I don't know whats wrong with my jQuery code. A better explanation on what

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.