Solved

WPF "defaults"? - Display issues

Posted on 2014-01-16
3
451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 4

Accepted Solution

by:
WernerVonBraun earned 0 total points
ID: 39784910
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
ID: 39784913
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
ID: 39784915
Et voilá
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

627 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