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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:09:24+00:00 2026-05-14T20:09:24+00:00

I’ve scoured the Internet but my search-foo must not work if it’s out there

  • 0

I’ve scoured the Internet but my search-foo must not work if it’s out there cause I just can’t find the proper search terms to get me the answer I am looking for. So I turn to the experts here as a last resort to point me in the right direction.

What I’m trying to do is create a composite control of a text box and a list box but I want to allow the control consumer to decide what to do when say the checkbox is checked/unchecked and I just can’t figure it out… Maybe i’m going about it all wrong.

What I’ve done thus far is to:

  1. create a custom control that extends ListBox
  2. expose a custom DP named “Text” (for the Text box but it’s not the important part)
  3. craft the generic.xaml so that the list items have a default ItemTemplate/DataTemplate
    1. inside the DataTemplate I’m trying to set the “Checked” or “Unchecked” events
  4. expose ‘wrapper’ events as DPs in the custom control that would get ‘set’ via the template when instatiated

As soon as I try something like the following (inside generic.xaml):

<DataTemplate>
    <...>
    <CheckBox Checked="{TemplateBinding MyCheckedDP}"/>
    <...>
</DataTemplate>

I get runtime exceptions, the designer – vs2010 – pukes out a LONG list of errors that are all very similar and nothing I do can make it work.

I went so far as to try using the VisualTreeHelper but no magic combination I could find would work nor would it allow me to traverse the tree because when the OnApplyTemplate method fires the listbox items don’t exist yet and aren’t in the tree.

So hopefully this all makes sense but if not please let me know and I’ll edit the post for clarifications.

Thanks to all for any pointers or thoughts… Like I said maybe I’m heading about it in the wrong way from the start…

EDIT (Request for xaml)

generic.xaml datatemplate:

<DataTemplate >
    <StackPanel Orientation="Horizontal" >
        <local:FilterCheckbox x:Name="chk">
            <TextBlock Text="{Binding Path=Display}" />
        </local:FilterCheckbox>
    </StackPanel>
</DataTemplate>

usercontrol.xaml (invocation of custom control)

<local:MyControl FancyName="This is the fancy name"
    ItemChecked="DoThisWhenACheckboxIsChecked" <-- this is where the consumer "ties" to the checkbox events
    ItemsSource="{Binding Source={StaticResource someDataSource}}" 
/>
  • 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-14T20:09:25+00:00Added an answer on May 14, 2026 at 8:09 pm

    Well I dislike answering my own question but the answer above doesn’t work for me nor does the link referenced do what i’m looking for.

    I’m posting this only answer so that i can maintain the 100% answer rate…

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

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this
Seemingly simple, but I cannot find anything relevant on the web. What is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.