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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:36:29+00:00 2026-05-19T04:36:29+00:00

I am trying to create a custom ItemsControl by directly inheriting from ItemsControl (WPF/Silverlight,

  • 0

I am trying to create a custom ItemsControl by directly inheriting from ItemsControl (WPF/Silverlight, I am using same code base for both). I have created an Item class for it by inheriting from ContentControl. I want to create IsSelected property for the Item class. I reflected the ListBoxItem class but am not very clear how IsSelected property is getting set.
Any suggestions/ pointers will be really helpful.

  • 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-19T04:36:29+00:00Added an answer on May 19, 2026 at 4:36 am

    If you want an ItemsControl with no ListBox features except that it internally supports the concept of selection, you can easily create a lookless ListBox that is indistinguishable from an ItemsControl. Here are the two two side by side and you can’t tell the difference. The only difference is that the left list supports selection internally.

    <Grid>
        <Grid.Resources>
            <x:Array Type="sys:String" x:Key="sampleData">
                <sys:String>Red</sys:String>
                <sys:String>Green</sys:String>
                <sys:String>Blue</sys:String>
            </x:Array>
        </Grid.Resources>
        <UniformGrid Columns="2">
            <ItemsControl ItemsSource="{StaticResource sampleData}"/>
            <ListBox ItemsSource="{StaticResource sampleData}">
                <ListBox.Style>
                    <Style TargetType="ListBox">
                        <Setter Property="Focusable" Value="False"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="ListBox">
                                    <ItemsPresenter/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ListBox.Style>
                <ListBox.ItemContainerStyle>
                    <Style TargetType="ListBoxItem">
                        <Setter Property="Focusable" Value="False"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="ListBoxItem">
                                    <ContentPresenter/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ListBox.ItemContainerStyle>
            </ListBox>
        </UniformGrid>
    </Grid>
    

    So the best advice is if you want selection, derive from ListBox and style away what you don’t want about it or at least derive from Selector.

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

Sidebar

Related Questions

I'm trying to create custom view that draws image downloaded from Url. The code
I am trying to create custom array indexed from 1 using subscript operator. Getting
I'm trying to create a custom component to extend PrimeFaces. I have a simple
I am trying to create a custom popup view that can be called from
Im trying to create a custom formatter in Symfony 1.4. I have embedded form
I've been trying to create a custom skin/template for a TabControl in WPF. I
My application is trying to create custom objects from NSImage objects (coming from the
Trying to create a custom component that gets it's layout from an XML file
I am trying to create a custom scrollbar and am using images as button.
I am trying to create a custom checkbox using CSS only and havent had

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.