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

The Archive Base Latest Questions

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

I have been working on a C# 4.0 WPF project and need to figure

  • 0

I have been working on a C# 4.0 WPF project and need to figure out how to databind a Boolean value. I have a reference to my Application.Current object in a window. My “App” object contains a boolean field called “Downloaded” that is true if the user has downloaded information from a web service. I need to databind a textbox’s IsEnabled field to this Downloaded value. Any tips? Here is what I have come up with so far. (Any useful links to better learn WPF XAML are greatly appreciated!)

C# code:

class MainWindow : Window
{
    private App MyApp = App.Current as App; 
}

XAML:

<TextBox ... IsEnabled="{Binding Source=MyApp, Path=Downloaded}" />
  • 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-13T22:47:27+00:00Added an answer on May 13, 2026 at 10:47 pm

    WPF can’t resolve that Source. If you’re specifying a Source in XAML, it will typically be a resource elsewhere in the XAML (e.g. an ObjectDataProvider). MyApp is actually a path from your Window object, not a source in itself.

    What you probably want is a multipart path:

    {Binding Path=MyApp.Downloaded}
    

    However, you’ll still have a few problems with this:

    1. MyApp is a private field. WPF allows binding only to properties (and they should normally be public). So change MyApp to be a public property.
    2. The binding shown is relative to the local DataContext, which will not by default be the Window. So you either need to set the DataContext to the Window (generally poor style), place the MyApp property on a view model class and set the Window.DataContext to be that view model (generally the recommended style) or use a RelativeSource or ElementName on the binding to make it resolve the path against the Window object instead of the DataContext.

    Note also you must implement INotifyPropertyChanged on your App class, and raise PropertyChanged for the Downloaded property.

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

Sidebar

Related Questions

I have been working on an application, and was trying to figure out why
I've been working on a WPF application and need to be able to show
I have been working on a WPF Application that is essentially a WYSIWYG editor,
I have been working through a very small-scale WPF project in order to familiarize
I have been working on a web services related project for about the last
I have been working with Struts for some time, but for a project I
I've recently been working on a project using WPF to produce a diagram. In
Ok been working with WPF for a while but I need some help. I
I've been working on a commandline application, and have recently decided to add a
I have a WPF application which so far has been client only, but now

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.