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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:15:18+00:00 2026-06-08T01:15:18+00:00

I create a own ComboBoxItem. Here I have simplified the code. The ComboBoxItem contain

  • 0

I create a own ComboBoxItem. Here I have simplified the code. The ComboBoxItem contain a CheckBox.

ComboBoxItem Control xaml:

<ComboBoxItem x:Class="WpfApplication1.MyCombobox"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             Height="50"
             Width="200">
    <!-- ... -->
    <StackPanel>
        <CheckBox IsChecked="{Binding Path=IsCheckboxChecked}" IsEnabled="{Binding Path=IsCheckboxEnabled}">
            <CheckBox.LayoutTransform>
                <ScaleTransform ScaleX="1" ScaleY="1" />
            </CheckBox.LayoutTransform>
        </CheckBox>
        <!-- ... -->
    </StackPanel>
</ComboBoxItem>

ComboBoxItem Control c# (code behind)

public partial class MyCombobox
{
    public MyCombobox()
    {
        InitializeComponent();
        DataContext = this;

        //Defaults
        IsCheckboxChecked = false;
        IsCheckboxEnabled = true;

        //...
    }

    //...

    public string Text { get; set; }

    public bool IsCheckboxChecked { get; set; }

    public bool IsCheckboxEnabled { get; set; }

    //...
}

and I include it so:

<WpfApplication1:MyCombobox IsCheckboxChecked="{Binding Path=IsMyCheckBoxChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsCheckboxEnabled="{Binding Path=IsMyCheckBoxEnabled, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Text="Write your Text here" />

When I run my application I get this error:

A fatal error occurred: a ‘Binding’ cannot be set on the
‘IsCheckboxChecked’ property of type ‘MyCombobox’. A ‘Binding’ can
only be set on a Dependency Property of a DependencyObject

What do I make wrong?

  • 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-08T01:15:20+00:00Added an answer on June 8, 2026 at 1:15 am

    well the error is pretty clear: You have to make a DP of your IsCheckboxChecked field:

    public static readonly DependencyProperty IsCheckboxCheckedProperty = DependencyProperty.Register("IsCheckboxChecked", typeof(bool), typeof(MyComboBox));
    public bool IsCheckboxChecked
    {
        get { return (bool)GetValue(IsCheckboxCheckedProperty); }
        set { SetValue(IsCheckboxCheckedProperty, value); }
    }
    

    instead of:

    public bool IsCheckboxChecked { get; set; }
    

    but this also means you’d have to make your MycomboBox class inherit the DependencyObject class:

    public partial class MyCombobox : DependencyObject
    

    I suggest this: http://msdn.microsoft.com/en-gb/library/ms752347.aspx

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

Sidebar

Related Questions

I create my own class which extend ScrollView but scroll bar disapear. How Can
I want to create my own class named Point, but am running into issues
I have to create my own Section Header View of a UITableView, with a
I need to create my own UIView class and it is not something I
I create my own user control which only contains a panel : When I
People create their own websites using WYSIWYG creator i give them. These websites have
To create my own address book i have copy all contacts from address book
I want to create a new User Control which displays my own combobox. (The
When should I create my own custom exception class rather than using a one
Create own TextBox, Button etc control as own control using User control in C#

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.