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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:00:26+00:00 2026-05-16T21:00:26+00:00

Okay i’m trying to understand WPF and the popular MVVM Pattern. Now i have

  • 0

Okay i’m trying to understand WPF and the popular MVVM Pattern.

Now i have this issue. I’m using a ribbon control with several tabs.
In my ViewModel i have a property “ActiveTab (string)” Which should reflect the currently active tab.

Since ribboncontrol doesn’t have any property that shows this information i can’t bind to it.

So i was thinking:

I could bind the selected event like this:

        <r:RibbonTab Label="tab1" Selected="RibbonTab_Selected"></r:RibbonTab>
        <r:RibbonTab Label="tab2" Selected="RibbonTab_Selected"></r:RibbonTab>
        <r:RibbonTab Label="tab3" Selected="RibbonTab_Selected"></r:RibbonTab>
        <r:RibbonTab Label="tab4" Selected="RibbonTab_Selected"></r:RibbonTab>
        <r:RibbonTab Label="tab5" Selected="RibbonTab_Selected"></r:RibbonTab>

Then in codebehind set the property in the viewmodel by using Activetab = sender.Label

But Then i would need a refference to my viewmodel in the codebehind of my view.

I’m trying to solve this problem without using any code behind files. (MVVM).

Now the real question:
Is it somehow possible to use an eventtrigger or eventsetter. that when the selected event gets fired. A setter automaticly sets the activetab property to the sender.Label value?.

Using xaml only.

—
My excuses for my rather bad english and maybe noobish question. I’m very new at wpf =)


UPDATE:
As i just found out, there is a isSelected property on a ribbonTab.

Now i have some issues on how to bind it to the property in my viewmodel.

I tried the following code:

<Style TargetType="{x:Type r:RibbonTab}">
                <Style.Triggers>
                    <Trigger Property="IsSelected" Value="True">
                        <Setter Property="{Binding SelectedTab}" Value="{Binding RelativeSource=Self, Path=Label}" />
                    </Trigger>
                </Style.Triggers>
            </Style>

But this doesn’t work:

Error   1   Cannot find the Style Property 'SelectedTab' on the type 'Microsoft.Windows.Controls.Ribbon.RibbonTab'. 

SelectedTab offcourse is in my viewmodel and not in ribbonTab …

How can i make the setter, set the property on my viewmodel with the value of the tab? =)

Thanks in advance!!

  • 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-16T21:00:26+00:00Added an answer on May 16, 2026 at 9:00 pm

    The August release of the Microsoft Ribbon, the RibbonTab has a IsSelected dependency property, so you should be able to bind to that.

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

Sidebar

Related Questions

Okay, so I have an issue with an AJAX request. I currently have this
Okay, none of the previous questions I have seen with this error seem to
Okay so my question is this. Say I have a simple C++ code: #include
Okay, so I'm trying to make a game that uses this algorithm: http://www.codeproject.com/Articles/15573/2D-Polygon-Collision-Detection But
Okay, so I've known about this for like 600 years now, but I've only
Okay i have this problem with every page i make. im not sure what
Okay let me do a better job explaining this. Assume I have a person
Okay, what have I done wrong here? I'm trying to .POST data from a
Okay so I have two import pieces of code involved in this. This first
Okay. I have this code on my site: <?php session_start(); include database.php; include bruger.php;

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.