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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:52:41+00:00 2026-06-03T07:52:41+00:00

My WPF application has a number of buttons on its main window. I’m working

  • 0

My WPF application has a number of buttons on its main window. I’m working on an edge case right now where the buttons should be disabled if the database is down or if the application can’t establish a connection to its back-end (the back-end is a Windows service we’ve written).

There are two classes in my View Model library called DbMonitor and ComMonitor (“Com” for “Communications”). They descend from an the same abstract class, implement the IPropertyChanged interface, and have a property called Status (inherited from the abstract base class) which is an enumeration called DeviceStatuses with values Green, Yellow, and Red. I want the Buttons to be enabled only if the Status properties of both objects are Green?

How do get this binding to work in the Xaml, or do I have to do this in my code-behind.

Thanks

Tony

  • 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-03T07:52:42+00:00Added an answer on June 3, 2026 at 7:52 am

    After asking the question, I did some additional research and found a solution that works for me.

    I created a class that implements the IMultiConverter interface that converts my DeviceStatuses enumeration to bool. Then, in my Xaml, I did this:

    <Button ....>
        <Button.IsEnabled>
            <MultiBinding Converter="{StaticResource DeviceStatusToBool}">
                <Binding Path="..." />
                <Binding Path="..." />
            </MuntiBinding>
        </Button.IsEnabled>
    </Button>
    

    This works very well.

    I can’t convert the buttons to use ICommand at this point. Not enough time before our release date.

    Tony

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

Sidebar

Related Questions

I have a DataGrid in a WPF application which has for its ItemsSource a
I am working on a WPF MVVM application. It has a custom canvas class
My WPF application has a feature whereby it renders a large number of images
My WPF application has more than one window, I want to attach some of
All in WPF: Developing a wizard application, user has to answer a number of
My WPF application has more than one window, I need to be able to
Im writing a WPF application that has a zoom and pan ability, but what
I have a wpf application using caliburn.micro. It has a datagrid and a combobox.
I need to write an WPF(4.0) application which has a DB but no tables
I need to convert my WPF application, which has a Ribbon , to use

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.