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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:16:43+00:00 2026-05-23T00:16:43+00:00

i have created a custom user control which im using on my main xaml

  • 0

i have created a custom user control which im using on my main xaml control:

<Controls:CustomControl  Width="200" Height="20" 
TotalCount="{Binding TotalRecordCount}" SuccessCount="{Binding ValidationCount}" ErrorCount="{Binding ValidationErrorCount}" Margin="0,5,0,0"  HorizontalAlignment="Left"> 
</Controls:CustomControl>

I wanted to make the private variables of my custom usercontrol being ErrorCount,SuccessCount and total count(which are of type int32) Bindable so i can bind values to them. Right now when i try to bind it to my item source it gives the following error e exception message is “Object of type ‘System.Windows.Data.Binding’ cannot be converted to type ‘System.Int32’

Many thanks,
Michelle

  • 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-23T00:16:44+00:00Added an answer on May 23, 2026 at 12:16 am

    You need to implement the Properties using DependencyProperty don’t use private variables to hold these values. Here is an example:-

        #region public int SuccessCount
    
        public int SuccessCount
        {
            get { return (int)GetValue(SuccessCountProperty); }
            set { SetValue(SuccessCountProperty, value); }
        }
    
        public static readonly DependencyProperty SuccessCountProperty =
            DependencyProperty.Register(
                "SuccessCount",
                typeof(int),
                typeof(CustomControl),
                new PropertyMetadata(0, OnSuccessCountPropertyChanged));
    
        private static void OnSuccessCountPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            CustomControl source = d as CustomControl;
            int value = (int)e.NewValue;
    
            // Do stuff when new value is assigned.
        }
        #endregion public int SuccessCount
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom user control, which is basicly a ItemsControl with it's
I have a somewhat complex custom user control, created in C# .NET, which is
I have created a user control which exposes a custom type property called SoftwareItem.
I have created a custom WPF user control which is intended to be used
I have made one custom user control (search text box), which basically consists of
I created a custom password box user control which is able to show and
I created a custom control which contains an Image control. I'd like to have
friends, i have created custom title bar using following titlebar.xml file with code <?xml
I have created a custom dialog for Visual Studio Setup Project using the steps
If have created a custom role within SqlServer which I added to the db__denydatareader

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.