Skip Navigation LinksHome / Search


Results Per Page

Found 34 results for ListBox.
Date between: <not defined> and <not defined>
Search in: News , Articles , Tips , Shows , Showcase , Books

Order by Publish Date   Ascending Title   Rating  

  • Changing the Layout for the Selected Item in ListBox

    0 comments  /  posted by  Silverlight Show  on  Jul 07, 2009 (11 months ago)

    Chris Klug experienced a problem with changing the layout for the selected item in ListBox. The thing that caused troubles, was the fact that it was supposed to show a compact information layout for all items except the selected item. Find out what's the solution of the problem.

    The selected item should have a more verbose layout and some extra functionality. Initially that seemed like a tiny problem. That would just be a ItemTemplate with a VisualStateManager. Apparently not…!

    Why not? Well…the DataTemplate does not support a VisualStateManager. When you select an item in the ListBox, the VisualStateManager that is used to change the layout is in the items ControlTemplate and not in the items DataTemplate. So the Layout in the DataTemplate does not have the ability to change its layout based on the state.

  • 0 comments  /  posted by  Silverlight Show  on  Jun 11, 2009 (more than a year ago)
    Tags: Grouping , Sorting , Listbox , WPF

    Karl Shifflett is ready with the next sample in the WPF Sample Applications Series. This sample is the result of the question “how can I do multi-level grouping?” and provides a brief description of the problem, the solution and full source code.

    WPF provides the CollectionViewSource for codeless sorting and grouping of data.  The SortDescriptions and GroupDescriptions collections can be modified at runtime if desired.  The SortDescription provides the ability to set the sort direction as I’ve done for the Sales.

  • 0 comments  /  posted by  Silverlight Show  on  May 29, 2009 (more than a year ago)
    Tags: Listbox , MVVM

    Brian Genisio is continuing his series of “Adventures in MVVM” and this time talks about a few different approaches to working with List Boxes with the MVVM pattern.

    What I am writing here is generally true of all controls that derive from Selector, including ListBox and ComboBox.  This example was developed in Silverlight, but the same concepts also apply to WPF.

  • Flipping Items in Listbox

    0 comments  /  posted by  Silverlight Show  on  May 21, 2009 (more than a year ago)
    Lee has created custom Listbox and listboxitem to add a few properties to hold the datatemplates.

    There are many posts which shows how to do the flip animation, here is mine. In the sample the flip animation is applied to the ListBoxItem in the Styles.

  • 0 comments  /  posted by  Silverlight Show  on  May 20, 2009 (more than a year ago)
    Tags: ComboBox , Listbox

    Kevin Dockx will show you how to make a Silverlight combobox editable.

    Well, it's actually easier than you might think, so for all of you who want this kind of behaviour: here's how you do it! :-)  The same technique can also be used to make an editable listbox, and usual, sourcecode is included at the end of this post.

  • Enhancing the ScrollIntoViewCentered method for WPF's ListBox

    0 comments  /  posted by  Silverlight Show  on  Apr 21, 2009 (more than a year ago)
    Tags: ListBox , Controls , WPF
    David Anson has one WPF blog post in which he is talking about the ScrollIntoViewCentered method for WPF's ListBox.

    Earlier this month I blogged about adding the ScrollIntoViewCentered method to WPF's ListBox control. At the time, I explained why it was necessary to set ScrollViewer.CanContentScroll to False for the code I'd written to function. The limitation didn't matter for my scenario, so I didn't spend too much time worrying about it then...

    However, after putting the code into use for my RepositoryExplorer version control system browser side-project, I discovered a bug. And further investigation proved that it wasn't a bug in my code - it was a bug in WPF!

  • 2 comments  /  posted by  Nikolay Raychev  on  Apr 02, 2009 (more than a year ago)
    In Silverlight 3 you can make multiple selections in a ListBox. You just need to set the SelectionMode parameter:

    <ListBox Margin="5" x:Name="lbTasks"   
        ItemsSource="{Binding Tasks, ElementName=MainPageView}"   
                <StackPanel Orientation="Horizontal" Margin="2">  
                    <TextBlock FontWeight="Bold" FontSize="13"   
                        Foreground="#ff006882" Text="{Binding Text}">  

    You have 3 options for the SelectionMode:
    • Single - you can select only one item.
    • Multiple - you can select multiple items by selecting one item, holding Ctrl or Shift key and pressing another item.
    • Extended - you can again select multiple items but the Shift key acts differently. With the help of the Shift key you can select items range by just pressing one item, holding Shift and pressing another one.
  • Adding the ScrollIntoViewCentered method to WPF's ListBox

    0 comments  /  posted by  Silverlight Show  on  Mar 31, 2009 (more than a year ago)

    David Anson has typed a ScrollIntoViewCentered extension method that you may call to bring one of the items in a WPF ListBox into view.

    In my scenario, the user would recognize the item when he/she saw it, so my problem wasn't about setting focus or rendering a highlight; it was just about bringing the item into view so it could be seen and manipulated. I started in the obvious place: the ListBox.ScrollIntoView method. Sure enough, a call to this method scrolled the item into view just like it was supposed to - and yet I wasn't completely satisfied... :)

  • 0 comments  /  posted by  Jan Jelinek  on  Mar 30, 2009 (more than a year ago)
    Tags: Silverlight 3 beta 1 , WrapPanel , ListBox , Photo gallery
    Here is one end-to-end tutorial on how to build photo gallery using Silverlight 3 new control WrapPanel as a ItemPanel for ListBox.
  • 0 comments  /  posted by  Silverlight Show  on  Mar 11, 2009 (more than a year ago)
    Tags: ListBox , Layout , MVVM

    Andrej Tozon has a quick tip on making the ListBox items behave as disabled.

    The data context of this ListBox is a ViewModel with the Lights property. Lights is a collection of five Light objects.

    One property that the Light object exposes is the Brush property; it will simply point to a solid color brush of a red, yellow or green color, respectively. The Ellipse’s Fill property is bound to the Brush property as can observed in the above code.

Help us make SilverlightShow even better. Whether you'd like to suggest a change in the structure, content organization, section layout or any other aspect of SilverlightShow appearance - we'd love to hear from you! Need material (article, tutorial, or other) on a specific topic? Let us know and SilverlightShow content authors will work to have that prepared for you. (hide this)