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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:24:20+00:00 2026-05-24T02:24:20+00:00

Having work a bit and thanks to the answer I am now using :

  • 0

Having work a bit and thanks to the answer I am now using :

public class PopupProgramazione : DependencyObject
    {
        public static readonly DependencyProperty ShowProperty = DependencyProperty.Register("FirstNo", typeof(bool), typeof(PopupProgramazione), null);

        public bool Show
         {
            get { return (bool)GetValue(ShowProperty); }
            set { SetValue(ShowProperty, value); }
         }
    }

in my view Model:

   public PopupProgramazione Popup
    {
        get { return _Popup; }
        set
        {
            _Popup = value;
            RaisePropertyChanged("Popup");
        }
    }

    public void Programmazione(InterventoSchedeConsuntivi intervento)
    {
        Popup.Show = true;
        InterventoPopupProgramazione = intervento;
    }

the strange problem comes with the xaml :

<local:PopupProgrammazione 
             x:Name="popupProg"
            Height="300" 
            Width="400"
            Canvas.ZIndex="2"
            Canvas.Left="150"
            Canvas.Top="150" Grid.RowSpan="4" Grid.Column="2" Margin="7,4,12,296"
            Visibility="{Binding Path=Popup.Show, Mode=TwoWay, Converter={StaticResource BoolToVisibilityConverter}}"
            DataContext="{Binding Path=InterventoPopupProgramazione}"
            >
        </local:PopupProgrammazione>

If I have only Visibility set it works well and I can see that I am getting through the converter using the debug.

If have both, then the initialisation of the popup is not made.( the popup is shown whereas Popup.Show=false). But If I close the popup :

private void Close_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.Visibility = Visibility.Collapsed;
        }

and then pass by my function to open it, it works but without passing by the converter.

Could someone explain me what is going on there?

[EDIT]
Instead of binding specifically my usercontrol to a dedicated object, I use the datacontext of main xaml and then it works perfectly.
[/EDIT]

  • 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-24T02:24:21+00:00Added an answer on May 24, 2026 at 2:24 am

    You need to use a dependancy property

    http://msdn.microsoft.com/en-us/library/ms752914.aspx

    A decent tutorial
    http://www.switchonthecode.com/tutorials/wpf-tutorial-introduction-to-dependency-properties

    basically you need to set up the static method … this will register the property and let you bind to it in XAML. You then repoint your property to get and set the dependancy property for use in your code.

    It looks a lot harder than it is 😉

    Edit:

    oh … sorry maybe i misunderstood .. cant you just bind to the value that is in the viewmodel just like you did for showPopup? Failing that register with the property changed event?

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

Sidebar

Related Questions

I'm having a bit of trouble trying to get class variables to work in
We're having a bit of fun here at work. It all started with one
I'm having a bit of a problem using FieldOffset correctly with arrays. The code
thanks for you help in advance. I'm having a bit of a trying time
Bit of a newb but just having a small problem using jquery cycle all
I'm writing a Flex application using Flash Builder 4 and I'm having a bit
At work we're having issues with different people wanting/suggesting different names for a new
We work heavily with serialization and having to specify Serializable tag on every object
I'm having trouble getting the following to work in SQL Server 2k, but it
I'm having some trouble getting log4net to work from ASP.NET 3.5. This is the

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.