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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:51:02+00:00 2026-06-17T08:51:02+00:00

I am developing a WPF project and right now I am working on the

  • 0

I am developing a WPF project and right now I am working on the Ribbon area.

Inside of the Ribbon I have some controls such as RibbonComboBox, RibbonTextBox, etc.

I have several RibbonTab in my Ribbon so I set one view model for each RibbonTab as following:

<rb:Ribbon Name="Ribbon">

        <rb:RibbonTab Header="Tab One" Name="tab1">

            <rb:RibbonTab.DataContext>
                <vm:TabOneViewModel />
            </rb:RibbonTab.DataContext>

So, each control within those tabs inherits their respective view model.

When I run the application everything works as expected. The problem starts when I resize the container window to a very small size, after doing this: Every control loses their bindings since their DataContext is replaced by an object called DisconnectedItem.

I have done some research and found that this is due to the controls stop being part of the visual tree and for that reason the binding engine sets their DataContext to DisconnectedItem.

What can I do to prevent my controls from losing their DataContext?

EDIT:

I just found that the main problem comes from the RibbonGroup control which after collapsing causes its visual children lose their DataContext.

  • 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-17T08:51:03+00:00Added an answer on June 17, 2026 at 8:51 am

    I just found a workaround for the RibbonGroup control issue here

    The solution I took is creating a new control which inherits from RibbonGroup control.

        public class MyRibbonGroup : RibbonGroup
        {
        public MyRibbonGroup() 
            : base()
        {
        }
    
        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
        {
            base.OnPropertyChanged(e);
    
            // Force the bindings to be restored after 
            // the ribbon group collapsed or expanded to a menu button.
            if (e.Property == RibbonGroup.IsCollapsedProperty)
            {
                object objDataContext = this.DataContext;
                this.DataContext = null;
                this.DataContext = objDataContext;
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a WPF project and I started developing the Ribbon area.
I am working on a project on WPF and I have to create some
I am developing a WPF project in vb.net and have multiple windows in it.
I am developing wpf application in C#. I have successfully created the setup project
I am developing wpf application. I have created the setup project. It runs successfully
i am developing a project (WPF) and i have a Datagrid the load more
I am developing a C# WPF project with an embedded SQLite Database. I have
I am developing an application using WPF/MVVM. I have a WCF data service project
I have a WPF Linq-to-SQL project which I have been developing using MS Visual
I'm developing a WPF app using MVVM. Most of my views have only xaml

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.