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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:31:00+00:00 2026-06-10T09:31:00+00:00

Simple question. We want a divider to appear between each item in a horizontally

  • 0

Simple question. We want a divider to appear between each item in a horizontally styled listbox. Think the arrows between entries in a crumbtrail. However, we don’t want that divider to be part of the selection, so it really should go between each ListBoxItem. Is it possible to do that?

The only two ways I can think to do this is to insert ‘separator’ items into the data and template them differently, but that requires mucking with the items collection, which you may not be able to do in a data bound situation.

The only other way would be to style the actual ListBoxItem to have a separator outside of the highlighting border, then template the last one in the list separately.

Can anyone think of any other way to do this?

  • 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-10T09:31:01+00:00Added an answer on June 10, 2026 at 9:31 am

    Interesting question!
    As you said, one way would be to mock the ItemsSource collection.
    Such as:

    <ListBox.ItemsSource>
       <MultiBinding Converter="{StaticResource mockConverter}">
         <Binding Path="YourCustomList" />
       </MultiBinding>
    </ListBox.ItemsSource>
    

    Note that I used multibinding with only one binding. I believe that is the correct way in order for the converter to be “re-run”. This way, when you modify items in “YourCustomList”, it will retrigger the converter.

    Unlike this, which will trigger converter only once(when ItemsSource is first binded against)

    <ListBox ItemsSource="{Binding YourCUstomList, Converter={StaticResource mockCOnverter}}" />
    

    ^ wont work if you add new items.(Converter is only re-run when YourCustomList property changes)

    MockConverter will be easy, just make sure you generate list with seperators. You need new class for a seperator. This way you can easily use DataTemplates(DataType). Next you probably have to set up a new trigger in ItemContainerStyle in order to set IsEnabled=false when object=Seperator.

    It will be relatively painless and I see no complications. It’s a little ugly because seperators should not be a ListBoxItems.

    Perhaps this could also work.
    You can override ListBox ItemsPanelTemplate with your own. In your own template, you can do whatever you want. Perhaps add seperators. This way, you wont touch ItemsSource.

    Check out StackPanel.cs for code.
    I can’t provide with you a code right now, but the idea is this; you inherit from StackPanel, and overwrite Measure() and Arrange(). With those functions, you can calculate how big your stackPanel should be, and provide the location(X,y) where the seperators should be drawn at.
    Note that the seperators have to be Children of StackPanel and they need to have IsHitTestVisible=False(so they wont generate events).

    Later solution takes time, but if you are learning WPF, then why not?

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

Sidebar

Related Questions

A simple question, I think: I want to put a tag into an ASP.NET
Well this is a simple question i want to filter two elements sorted reverse
Simple question, I just want to select the text from the <Template> tag. Here's
Simple question I guess, I want to use PHP to write an update to
Really simple question: From within GWT I want to forward the user away from
Simple question: I am opening a file in matlab 7.x, and I want to
Very simple question, but I want to start using a consistent naming convention for
I have a simple question. I have a long std::string that I want to
I have what may be a very simple question. I want to process a
$Hello_all, a simple question, in a project I want to raise the property changed

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.