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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:43:49+00:00 2026-06-03T18:43:49+00:00

I have a new issue with the Label button now. The code below binds

  • 0

I have a new issue with the Label button now. The code below binds the view to the view model:

<Label Name="isImageValid"  Content="Image not Created" Margin="0,7,1,0" Style="{StaticResource LabelField}"
                Grid.ColumnSpan="2" Grid.Row="15" Width="119" Height="28" Grid.RowSpan="2"
                Grid.Column="1" IsEnabled="True" 
                Visibility="{Binding isImageValid}" />

And the following is the code from my ViewModel:

 private System.Windows.Visibility _isImageValid;
 public System.Windows.Visibility isImageValid
        {

            get
            {

                return _isImageValid;
            }
            set
            {


                _isImageValid = value;
               this.RaisePropertyChanged(() => this.isImageValid);

            }
        }
  private void OnImageResizeCompleted(bool isSuccessful)
    {

        if (isSuccessful)
        {

            this.SelectedStory.KeyframeImages = true;
            isImageValid = System.Windows.Visibility.Visible;
        }
        else
        {
            this.SelectedStory.KeyframeImages = false;

        }
    }

The Label is meant to stay hidden until “OnImageResizeCompleted” is called, but for some reason the image is visible all the time. What would I need to change to hide it, please?

  • 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-03T18:43:51+00:00Added an answer on June 3, 2026 at 6:43 pm

    Your issue is not with the actual binding mode, a label doesn’t need two way binding because it doesn’t usually set its source.

    As @blindmeis suggested, you should use a converter instead of returning a Visibility value directly from the viewmodel, there is one built into the framework you can use. You should also ensure your datacontext is set correctly, if it isn’t then the label won’t be able to bind to the specified property. Do you have other items on the same window that are binding correctly to the viewmodel? You should also check your output window for binding errors – they will be mentioned there. Finally you should also check that your property is notifying correctly – that is impossible to tell from the code you provided.

    Your control/window should look something like this

    <UserControl    x:Class="..."
                    x:Name="MyControl"
    
                    xmlns:sysControls="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"
    
                    >   
        <UserControl.Resources> 
            <sysControls:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        </UserControl.Resources>
    
        <Grid>
            <Label  Visibility="{Binding IsImageValid, Converter={StaticResource BooleanToVisibilityConverter}}" />
        </Grid>
    </UserControl>
    

    and the C#:

    public class MyViewModel : INotifyPropertyChanged
    {
    
        public bool IsImageValid 
        {
            get { return _isImageValid; }
            set 
            {
                _isImageValid = value;
                OnPropertyChanged("IsImageValid");
            }
        }
    
        protected void OnPropertyChanged(string propertyName)
        {
            if (this.PropertyChanged != null)
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    
        public event PropertyChangedEventHandler PropertyChanged;
    
        private bool _isImageValid;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I`m new to sql and have been stuck on the following issue for almost
I have an issue with .Net reflection. The concept is fairly new to me
I’m new to Selenium and I have come across a test case issue in
I have a WPF sorting/binding issue. (Disclaimer: I am very new to WPF and
I am just new to programming in Unix and have a small issue that
I'm fairly new to SVN and I have a weird behavior issue. I'm working
I am new to MVC and facing one issue. I have a xml file
We are new to ROR, We have issue in creating Login/Logout process in ROR
Hi I am new to android and I am having an issue I have
I am fairly new to C++, but i have ran into an issue which

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.