Tech Off Thread

1 post

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Changing the way a listbox selections are displayed in a WPF Windows Store App

Back to Forum: Tech Off
  • User profile image

    Ok, I'm going to admit up front that I've been out of the WPF game for about a year, and some of the differences between WPF and Windows Store App XAML is driving me mad. This should be a simple question, I just have a mental block for some reason.

    I have a style for a ColorPicker to use in my Windows 8 app. Here it is:

    <Style x:Key="ColorPickerStyle" TargetType="ListBox">
            <Setter Property="ItemsPanel">
                        <StackPanel Orientation="Horizontal" Background="AliceBlue" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
            <Setter Property="ItemTemplate">
                        <Rectangle x:Name="recData" Width="20" Height="20" Fill="{Binding}" Stroke="Black" StrokeThickness="1"/>

    Here is what it looks like when it's displayed:

    Generic Forum Image

    I love the way it looks, but the last I'd like to do is change how the selected color looks. All I want to do is remove the selected item color and make the selected item's rectangle have a StrokeThickness of 2. I tried to do this with triggers, but they don't seem to exist in WSA XAML. I tried to do it with the VisualStateManager, but I somehow kept messing up the XAML so that it crashes when I run.

    Can someone help me through this before I lose my freakin' mind?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.