Solved

WPF "defaults"? - Display issues

Posted on 2014-01-16
3
438 Views
Last Modified: 2014-01-16
Hi there...

I designed a ListView using WPF, and - for example - for the selected Items I have a nice looking background gradient:

                    <MultiTrigger>
                        <MultiTrigger.Conditions>
                            <Condition Property="ListBoxItem.IsSelected" Value="True"/>
                        </MultiTrigger.Conditions>
                        <Setter Property="Background">
                            <Setter.Value>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="1,0">
                                    <GradientStop Color="#FFFFD1FF" Offset="0.986"/>
                                    <GradientStop Color="#FFF8B2F8" Offset="0.5"/>
                                </LinearGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </MultiTrigger>

However, when I run this application on a Windows Server Standard edition it reverts back to the standard look and feel for a ListView, so the selected item has black text on a dark blue background.

First of all... is there anything I can do to stop this? To make the listview behave the same across the board.

Failing that, can I change the "fallback" scheme for the ListView. So basically I'd be instructing the system to use the LinearGradientBrush IF IT CAN, but if not, then at least use a paler solid background brush instead?

Cheers


Pino
0
Comment
Question by:WernerVonBraun
  • 3
3 Comments
 
LVL 4

Accepted Solution

by:
WernerVonBraun earned 0 total points
Comment Utility
Never mind. I found a solution. In the Window resources I add something like this:

 <Window.Resources>
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
                             Color="Red" />
            <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}"
                             Color="Blue" />
 </Window.Resources>

(obviously I'm not using blue text on a red background but I'm only illustrating the nature of the solution). On an OS that can handle it, my MultiTriggers override the system settings, but on something like Windows XP it at least falls back gracefully to something that is not entirely cack.
0
 
LVL 4

Author Comment

by:WernerVonBraun
Comment Utility
BTW - I realised that the standard listview pattern is to have WHITE text on a dark blue background, but my GridColumn DataTemplates were using labels and they stayed happily black. Just to add to the confoozin...
0
 
LVL 4

Author Closing Comment

by:WernerVonBraun
Comment Utility
Et voilá
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now