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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:34:48+00:00 2026-05-25T02:34:48+00:00

This is the part where is not working. My dependency property has a default

  • 0

This is the part where is not working. My dependency property has a default value which is Entradas.Entero, and that value must be run this line:

Grid.SetColumnSpan(button0, 3);

And it should refresh it in my user control design, however there’s no changes in it.

public partial class TableroUserControl : UserControl
{
    public enum Entradas
    {
        Entero, Decimal
    }

    public Entradas Entrada
    {
        get { return (Entradas)GetValue(EntradaProperty); }
        set { SetValue(EntradaProperty, value); }
    }

    static void textChangedCallBack(DependencyObject property, DependencyPropertyChangedEventArgs args)
    {
        Button button0 = ((TableroUserControl)property).button0;

        switch ((Entradas)args.NewValue)
        {
            case Entradas.Entero:
                Grid.SetColumnSpan(button0, 3);
                break;
            case Entradas.Decimal:
                Grid.SetColumnSpan(button0, 2);
                break;
        }
    }

    public static readonly DependencyProperty EntradaProperty =
        DependencyProperty.Register("Entrada", typeof(Entradas), typeof(TableroUserControl), new PropertyMetadata(Entradas.Entero, new PropertyChangedCallback(textChangedCallBack)));

    public TableroUserControl()
    {
        InitializeComponent();
    }
}
  • 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-25T02:34:49+00:00Added an answer on May 25, 2026 at 2:34 am

    You might also consider doing this with a value converter. You should be able to bind the Grid.ColumnSpan attached property of button0 to the Entrada property of your user control. Then use a value converter to convert it to an integer. This way you don’t have to deal with callbacks and state/timing issues.

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

Sidebar

Related Questions

This is really more of a serverfault/IT question, but I am not part of
Please bear with me if this question isn't well formulated. Not knowing is part
It seems that this part of my code is where the exception occurs: c
I'm working on re-writing an old build that was originally designed (or not, as
It is worth noting that this part of the app (this option from the
I am working on a fairly big project that uses maven for dependency management.
This part of my code works fine: #include <stdio.h> int main(){ //char somestring[3] =
I have been putting off developing this part of my app for sometime purely
I am trying to learn and writting this part of code. while testing few
I just started learning C but I don't understand this part of the code.

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.