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 8367789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:14:48+00:00 2026-06-09T13:14:48+00:00

I am stuck on integrating a user control into a mvvm application. The user

  • 0

I am stuck on integrating a user control into a mvvm application.

The user control is a custom calendar and was not wrtitten using MVVM principles (I don’t want to re-write it in MVVM).

I have a mouse down event that is fired in the user control (Which is combination of three different user controls).

The event fired code looks like this:

public static readonly RoutedEvent DateEvent = 
    EventManager.RegisterRoutedEvent("dateEvent", RoutingStrategy.Bubble, 
    typeof(RoutedEventHandler), typeof(UserControl2));

public event RoutedEventHandler dateEvent
{
    add{AddHandler(DateEvent, value);}
    remove{ RemoveHandler(DateEvent, value);}
}

private void UserControl_MouseUp(object sender, MouseButtonEventArgs e)
{
    RaiseEvent(new RoutedEventArgs(UserControl2.DateEvent, this));
}

How do I subscribe to this routed event in my main app viewModel? I know it is not very MVVM but as I said I cant be doing with re-writing my user control.

I know that this event will bubble up the tree until it is marked as handled. I know to add a public void method to deal with the event – I’m just not sure how to implement the interception of the event in the first place.

  • 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-09T13:14:50+00:00Added an answer on June 9, 2026 at 1:14 pm

    I think you should read the RelayCommand section of this.

    WPF MVVM Apps

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

Sidebar

Related Questions

Actually I am a new user of eclipse.... I am integrating a library into
I'm integrating an application with the osCommerce shopping cart and want users to be
I am integrating Banner Ads into my BB application. Unfortunatelly, I am getting a
I'm currently integrating springs-security into our new web application stack. We will need to
Kinda stuck here... I have an application with lets say 5000 rows of data
I stuck with problem of mail application , i am developing a website for
I stuck while trying to compile qpid c++ with boost 1_47_0 using Visual Studio
I'm writing an integration test for a rails application using Capybara within Rspec. After
I'm writing an integration test for a rails application using webrat. After filling out
i am integrating twitter application in my application my application is created in xcode

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.