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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:33:15+00:00 2026-05-25T10:33:15+00:00

I just thought about converting one of our custom controls to WPF, however it

  • 0

I just thought about converting one of our custom controls to WPF, however it uses another custom control of ours that is written Winforms.

As there is little point in using WPF without MVVM. How can I databind to a Winforms control that is used within a WPF control.

(I don’t have much WPF experience, so I may be missing the point completely)

  • 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-05-25T10:33:16+00:00Added an answer on May 25, 2026 at 10:33 am

    I think you will have to wrap the WinForms control in a class exposing DependencyProperties or at least implementing INotifyPropertyChanged.

    So you’d have a class such as:

    public class WinFormsWrapper : WindowsFormsHost
    {
       //You'll have to setup the control as needed
       private static MyWinFormsControl _control;
    
       public static readonly DependencyProperty IsSpinningProperty = DependencyProperty.Register("IsSpinning", typeof(bool), typeof(WinFormsWrapper), 
            new FrameworkPropertyMetadata(_control.IsSpinning, new PropertyChangedCallback(IsSpinning_Changed)));
    
        private static void IsSpinning_Changed(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            _control.IsSpinning = (bool)e.NewValue;
        }
    
        public bool IsSpinning
        {
            get { return (bool)GetValue(IsSpinningProperty); }
            set { SetValue(IsSpinningProperty, value); }
        }
    }
    

    Assuming that you have an IsSpinning property on your WinForms control. Depending on your needs, it may be simpler to implement INotifyPropertyChanged instead of using DependencyProperties.


    Added by Ian Ringrose:

    This example code is clearly wrong (see comments about _control being static), but shows how to solve the problem. As I am not using WPF at present, I am not going to edit the code as I can’t test my edits.

    I am keeping this answer as the accepted answer, as it contains the information needed to solve the problem.

    I have added this to the answer, as comments do sometimes get deleted and this is getter views from people doing google searches.

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

Sidebar

Related Questions

I just thought about the non-blocking infrastructure of tornado and event-driven programming. Actually I'm
I thought that layout is just a widget that keeps more widgets inside. But
I probably just haven't thought this through, or perhaps I'm simply unaware of an
I was just putting some thought into different languages (as I'm reviewing for final
I may not understand what the return statement does(I thought it just returned a
I thought to be clever and just put an transparent UIButton over an UIImageView
I thought I had this figured out but it turns out I'm just deleting
I was just refreshing my JavaScript/Jquery skills and I thought of making a basic
I have a php application that has about 50-55 code files. The file that
I am about to embark upon yet another large PHP project. This time, I

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.