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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:17:47+00:00 2026-05-27T17:17:47+00:00

In my WPF application I’m trying to navigate to other ‘pages’ using the ContentControl.

  • 0

In my WPF application I’m trying to navigate to other ‘pages’ using the ContentControl.
I have this working so far, in my MainViewModel I have initiated the other viewmodels that should be a part of the MainViewModel.

I display my views with a datatemplate like this:

        <DataTemplate DataType="{x:Type vm:NewsViewModel}">
            <Views:NewsView />
        </DataTemplate>

I got a ItemsControl with TextBlocks to display the View(models) PageName property, when I click on this, it does set the ‘CurrentView’ property to the according ViewModel and it gets displayed. So this aint the problem… However, the issue I come across now is how to let the textblock display the CurrentView I have, for example I want it to be another color then the rest of the textblocks so the user can see which view(model) is active.

I tried to do this in the Style for the textblock with a DataTrigger but this only accepts constant values, any ideas?

  • 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-27T17:17:48+00:00Added an answer on May 27, 2026 at 5:17 pm

    Why not switch the ItemsControl to a ListBox since it has built-in selection features? You can style it so it hides the selection highlight and looks the same as your ItemsControl, and base your trigger off of ListBoxItem.IsSelected.

    If you don’t want to do that, you can probably use a IMultiValueConverter to pass the current ViewModel and the active ViewModel to a converter, which would return True if the items are the same, or false if not.

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

Sidebar

Related Questions

I have a Main WPF application and other modules and I am using PRISM
I have a simple WPF application which I am trying to start. I am
I have a WPF application where I'm trying to create a diagnostics panel that's
I have a WPF application and am using the WPF toolkit autocomplete box in
I am working on WPF application and I want to retrieve News Feed using
I have a small WPF application. This application has a button that when clicked,
I have a WPF application using Aero Glass. When using the application under a
I have a WPF-application with a mainwindow and different pages. On one of the
I have a simple WPF application I'm working on, which performs a SQL query
My WPF application is structured using the MVVM pattern. The ViewModels will communicate asynchronously

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.