Browse Source

Lots of progress towards a half-decent folders list in Settings

Antony Male 10 years ago
parent
commit
0dda6a9230

BIN
lib/Itenso.Windows.Controls.ListViewLayout.dll


BIN
lib/Itenso.Windows.Controls.ListViewLayout.pdb


+ 1 - 0
src/SyncTrayzor/App.xaml

@@ -13,6 +13,7 @@
             <s:ApplicationLoader.MergedDictionaries>
                 <ResourceDictionary Source="NotifyIcon/TaskbarIconResources.xaml"/>
                 <ResourceDictionary Source="Xaml/Resources.xaml"/>
+                <ResourceDictionary Source="Xaml/PassiveListView.xaml"/>
                 
                 <ResourceDictionary>
                     <design:ViewModelLocator x:Key="ViewModelLocator"/>

+ 18 - 13
src/SyncTrayzor/Pages/Settings/SettingsView.xaml

@@ -8,6 +8,7 @@
         xmlns:settings="clr-namespace:SyncTrayzor.Pages.Settings"
         xmlns:xaml="clr-namespace:SyncTrayzor.Xaml"
         xmlns:l="clr-namespace:SyncTrayzor.Localization"
+        xmlns:lvlm="clr-namespace:Itenso.Windows.Controls.ListViewLayout;assembly=Itenso.Windows.Controls.ListViewLayout"
         mc:Ignorable="d" 
         d:DataContext="{d:DesignInstance settings:SettingsViewModel}"
         Title="{l:Loc SettingsView_Title}"
@@ -146,33 +147,37 @@
                     </GroupBox>
                 </DockPanel>
             </TabItem>
-            
+
             <TabItem Header="Folders">
-                <ListView ItemsSource="{Binding FolderSettings}">
+                <ListView Width="410"
+                          ItemsSource="{Binding FolderSettings}"
+                          Style="{StaticResource PassiveListViewStyle}"
+                          lvlm:ListViewLayoutManager.Enabled="True">
                     <ListView.View>
-                        <GridView>
-                            <GridViewColumn Header="Folder" DisplayMemberBinding="{Binding FolderName}"/>
-                            <GridViewColumn Header="Watched">
+                        <GridView AllowsColumnReorder="False">
+                            <GridViewColumn Header="Folder" DisplayMemberBinding="{Binding FolderName}" lvlm:RangeColumn.IsFillColumn="True"/>
+                            <GridViewColumn>
+                                <GridViewColumn.Header>
+                                    <CheckBox Content="Watched" Margin="0,0,5,0"/>
+                                </GridViewColumn.Header>
                                 <GridViewColumn.CellTemplate>
                                     <DataTemplate>
-                                        <CheckBox IsChecked="{Binding IsWatched}"/>
+                                        <CheckBox IsChecked="{Binding IsWatched}" HorizontalAlignment="Left"/>
                                     </DataTemplate>
                                 </GridViewColumn.CellTemplate>
                             </GridViewColumn>
-                            <GridViewColumn Header="Notifications">
+                            <GridViewColumn>
+                                <GridViewColumn.Header>
+                                    <CheckBox Content="Notifications" Margin="0,0,5,0"/>
+                                </GridViewColumn.Header>
                                 <GridViewColumn.CellTemplate>
                                     <DataTemplate>
-                                        <CheckBox IsChecked="{Binding IsWatched}"/>
+                                        <CheckBox IsChecked="{Binding IsWatched}" HorizontalAlignment="Left"/>
                                     </DataTemplate>
                                 </GridViewColumn.CellTemplate>
                             </GridViewColumn>
                         </GridView>
                     </ListView.View>
-                    <ListView.ItemContainerStyle>
-                        <Style TargetType="{x:Type ListViewItem}">
-                            <Setter Property="Focusable" Value="False"/>
-                        </Style>
-                    </ListView.ItemContainerStyle>
                 </ListView>
             </TabItem>
         </TabControl>

+ 9 - 0
src/SyncTrayzor/Pages/ThirdPartyComponentsViewModel.cs

@@ -131,6 +131,15 @@ namespace SyncTrayzor.Pages
                     LicenseText = this.LoadLicense("Mono.Options.txt")
                 },
                 new ThirdPartyComponent()
+                {
+                    Name = "ListView Layout Manager",
+                    Description = "WPF: Customizing ListView/GridView Column-Layout",
+                    Homepage = "http://www.codeproject.com/Articles/25058/ListView-Layout-Manager",
+                    License = "The Code Project Open License (CPOL) 1.02",
+                    Notes = "Used for layout",
+                    LicenseText = this.LoadLicense("ListViewLayoutManager.txt")
+                },
+                new ThirdPartyComponent()
                 {
                     Name = "PropertyChanged.Fody",
                     Description = "Injects INotifyPropertyChanged code into properties at compile time",

+ 208 - 0
src/SyncTrayzor/Resources/Licenses/ListViewLayoutManager.txt

@@ -0,0 +1,208 @@
+Preamble
+--------
+
+This License governs Your use of the Work. This License is intended to allow
+developers to use the Source Code and Executable Files provided as part of the
+Work in any application in any form.
+
+The main points subject to the terms of the License are:
+
+ - Source Code and Executable Files can be used in commercial applications;
+ - Source Code and Executable Files can be redistributed; and
+ - Source Code can be modified to create derivative works.
+ - No claim of suitability, guarantee, or any warranty whatsoever is provided.
+   The software is provided "as-is".
+ - The Article(s) accompanying the Work may not be distributed or republished
+   without the Author's consent
+
+This License is entered between You, the individual or other entity reading or
+otherwise making use of the Work licensed pursuant to this License and the
+individual or other entity which offers the Work under the terms of this License
+("Author").
+
+License
+-------
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CODE PROJECT
+OPEN LICENSE ("LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER
+APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE
+OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HEREIN, YOU ACCEPT AND AGREE TO BE
+BOUND BY THE TERMS OF THIS LICENSE. THE AUTHOR GRANTS YOU THE RIGHTS CONTAINED
+HEREIN IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. IF YOU
+DO NOT AGREE TO ACCEPT AND BE BOUND BY THE TERMS OF THIS LICENSE, YOU CANNOT
+MAKE ANY USE OF THE WORK.
+
+ 1. Definitions.
+
+    a. "Articles" means, collectively, all articles written by Author which
+        describes how the Source Code and Executable Files for the Work may be
+        used by a user.
+    b. "Author" means the individual or entity that offers the Work under the
+       terms of this License.
+    c. "Derivative Work" means a work based upon the Work or upon the Work and
+       other pre-existing works.
+    d. "Executable Files" refer to the executables, binary files, configuration
+       and any required data files included in the Work.
+    e. "Publisher" means the provider of the website, magazine, CD-ROM, DVD or
+       other medium from or by which the Work is obtained by You.
+    f. "Source Code" refers to the collection of source code and configuration
+       files used to create the Executable Files.
+    g. "Standard Version" refers to such a Work if it has not been modified, or
+       has been modified in accordance with the consent of the Author, such
+       consent being in the full discretion of the Author.
+    h. "Work" refers to the collection of files distributed by the Publisher,
+       including the Source Code, Executable Files, binaries, data files,
+       documentation, whitepapers and the Articles.
+    i. "You" is you, an individual or entity wishing to use the Work and
+    exercise your rights under this License.
+
+ 2. Fair Use/Fair Use Rights. Nothing in this License is intended to reduce,
+    limit, or restrict any rights arising from fair use, fair dealing, first
+    sale or other limitations on the exclusive rights of the copyright owner
+    under copyright law or other applicable laws.
+
+ 3. License Grant. Subject to the terms and conditions of this License, the
+    Author hereby grants You a worldwide, royalty-free, non-exclusive, perpetual
+    (for the duration of the applicable copyright) license to exercise the
+    rights in the Work as stated below:
+
+    a. You may use the standard version of the Source Code or Executable Files
+       in Your own applications.
+    b. You may apply bug fixes, portability fixes and other modifications
+       obtained from the Public Domain or from the Author. A Work modified in
+       such a way shall still be considered the standard version and will be
+       subject to this License.
+    c. You may otherwise modify Your copy of this Work (excluding the Articles)
+       in any way to create a Derivative Work, provided that You insert a
+       prominent notice in each changed file stating how, when and where You
+       changed that file.
+    d. You may distribute the standard version of the Executable Files and
+       Source Code or Derivative Work in aggregate with other (possibly
+       commercial) programs as part of a larger (possibly commercial) software
+       distribution.
+    e. The Articles discussing the Work published in any form by the author may
+       not be distributed or republished without the Author's consent. The
+       author retains copyright to any such Articles. You may use the Executable
+       Files and Source Code pursuant to this License but you may not repost or
+       republish or otherwise distribute or make available the Articles, without
+       the prior written consent of the Author.
+
+  Any subroutines or modules supplied by You and linked into the Source Code or
+  Executable Files of this Work shall not be considered part of this Work and
+  will not be subject to the terms of this License.
+ 
+ 4. Patent License. Subject to the terms and conditions of this License, each
+    Author hereby grants to You a perpetual, worldwide, non-exclusive,
+    no-charge, royalty-free, irrevocable (except as stated in this section)
+    patent license to make, have made, use, import, and otherwise transfer the
+    Work.
+ 
+ 5. Restrictions. The license granted in Section 3 above is expressly made
+    subject to and limited by the following restrictions:
+
+    a. You agree not to remove any of the original copyright, patent, trademark,
+       and attribution notices and associated disclaimers that may appear in the
+       Source Code or Executable Files.
+    b. You agree not to advertise or in any way imply that this Work is a
+       product of Your own.
+    c. The name of the Author may not be used to endorse or promote products
+        derived from the Work without the prior written consent of the Author.
+    d. You agree not to sell, lease, or rent any part of the Work. This does not
+       restrict you from including the Work or any part of the Work inside a
+       larger software distribution that itself is being sold. The Work by
+       itself, though, cannot be sold, leased or rented.
+    e. You may distribute the Executable Files and Source Code only under the
+        terms of this License, and You must include a copy of, or the Uniform
+        Resource Identifier for, this License with every copy of the Executable
+        Files or Source Code You distribute and ensure that anyone receiving
+        such Executable Files and Source Code agrees that the terms of this
+        License apply to such Executable Files and/or Source Code. You may not
+        offer or impose any terms on the Work that alter or restrict the terms
+        of this License or the recipients' exercise of the rights granted
+        hereunder. You may not sublicense the Work. You must keep intact all
+        notices that refer to this License and to the disclaimer of warranties.
+        You may not distribute the Executable Files or Source Code with any
+        technological measures that control access or use of the Work in a
+        manner inconsistent with the terms of this License.
+    f. You agree not to use the Work for illegal, immoral or improper purposes,
+        or on pages containing illegal, immoral or improper material. The Work
+        is subject to applicable export laws. You agree to comply with all such
+        laws and regulations that may apply to the Work after Your receipt of
+        the Work.
+ 
+ 6. Representations, Warranties and Disclaimer. THIS WORK IS PROVIDED "AS IS",
+    "WHERE IS" AND "AS AVAILABLE", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES OR
+    CONDITIONS OR GUARANTEES. YOU, THE USER, ASSUME ALL RISK IN ITS USE,
+    INCLUDING COPYRIGHT INFRINGEMENT, PATENT INFRINGEMENT, SUITABILITY, ETC.
+    AUTHOR EXPRESSLY DISCLAIMS ALL EXPRESS, IMPLIED OR STATUTORY WARRANTIES OR
+    CONDITIONS, INCLUDING WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF
+    MERCHANTABILITY, MERCHANTABLE QUALITY OR FITNESS FOR A PARTICULAR PURPOSE,
+    OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT, OR THAT THE WORK (OR ANY
+    PORTION THEREOF) IS CORRECT, USEFUL, BUG-FREE OR FREE OF VIRUSES. YOU MUST
+    PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE WORK OR DERIVATIVE
+    WORKS.
+ 
+ 7. Indemnity. You agree to defend, indemnify and hold harmless the Author and
+    the Publisher from and against any claims, suits, losses, damages,
+    liabilities, costs, and expenses (including reasonable legal or attorneys’
+    fees) resulting from or relating to any use of the Work by You.
+ 
+ 8. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN
+    NO EVENT WILL THE AUTHOR OR THE PUBLISHER BE LIABLE TO YOU ON ANY LEGAL
+    THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY
+    DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK OR OTHERWISE
+    EVEN IF THE AUTHOR OR THE PUBLISHER HAS BEEN ADVISED OF THE POSSIBILITY OF
+    SUCH DAMAGES.
+ 
+ 9. Termination.
+
+    a. This License and the rights granted hereunder will terminate
+       automatically upon any breach by You of any term of this License.
+       Individuals or entities who have received Derivative Works from You under
+       this License, however, will not have their licenses terminated provided
+       such individuals or entities remain in full compliance with those
+       licenses. Sections 1, 2, 6, 7, 8, 9, 10 and 11 will survive any
+       termination of this License.
+    b. If You bring a copyright, trademark, patent or any other infringement
+       claim against any contributor over infringements You claim are made by
+       the Work, your License from such contributor to the Work ends
+       automatically.
+    c. Subject to the above terms and conditions, this License is perpetual (for
+        the duration of the applicable copyright in the Work). Notwithstanding
+        the above, the Author reserves the right to release the Work under
+        different license terms or to stop distributing the Work at any time;
+        provided, however that any such election will not serve to withdraw this
+        License (or any other license that has been, or is required to be,
+        granted under the terms of this License), and this License will continue
+        in full force and effect unless terminated as stated above.
+
+10. Publisher. The parties hereby confirm that the Publisher shall not, under
+    any circumstances, be responsible for and shall not have any liability in
+    respect of the subject matter of this License. The Publisher makes no
+    warranty whatsoever in connection with the Work and shall not be liable to
+    You or any party on any legal theory for any damages whatsoever, including
+    without limitation any general, special, incidental or consequential damages
+    arising in connection to this license. The Publisher reserves the right to
+    cease making the Work available to You at any time without notice
+
+11. Miscellaneous
+
+    a. This License shall be governed by the laws of the location of the head
+       office of the Author or if the Author is an individual, the laws of
+       location of the principal place of residence of the Author.
+    b. If any provision of this License is invalid or unenforceable under
+        applicable law, it shall not affect the validity or enforceability of
+        the remainder of the terms of this License, and without further action
+        by the parties to this License, such provision shall be reformed to the
+        minimum extent necessary to make such provision valid and enforceable.
+    c. No term or provision of this License shall be deemed waived and no breach
+        consented to unless such waiver or consent shall be in writing and
+        signed by the party to be charged with such waiver or consent.
+    d. This License constitutes the entire agreement between the parties with
+        respect to the Work licensed herein. There are no understandings,
+        agreements or representations with respect to the Work not specified
+        herein. The Author shall not be bound by any additional provisions that
+        may appear in any communication from You. This License may not be
+        modified without the mutual written agreement of the Author and You.

+ 12 - 1
src/SyncTrayzor/SyncTrayzor.csproj

@@ -88,6 +88,9 @@
     <Reference Include="Hardcodet.Wpf.TaskbarNotification">
       <HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.5\lib\net45\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
     </Reference>
+    <Reference Include="Itenso.Windows.Controls.ListViewLayout">
+      <HintPath>..\..\lib\Itenso.Windows.Controls.ListViewLayout.dll</HintPath>
+    </Reference>
     <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <HintPath>..\packages\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll</HintPath>
       <Private>True</Private>
@@ -96,6 +99,7 @@
       <HintPath>..\packages\NLog.3.2.0.0\lib\net45\NLog.dll</HintPath>
     </Reference>
     <Reference Include="PresentationFramework" />
+    <Reference Include="PresentationFramework.Aero" />
     <Reference Include="Pri.LongPath">
       <HintPath>..\packages\Pri.LongPath.1.3.2.0\lib\net45\Pri.LongPath.dll</HintPath>
     </Reference>
@@ -458,6 +462,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Xaml\PassiveListView.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Xaml\Resources.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -553,6 +561,9 @@
   <ItemGroup>
     <EmbeddedResource Include="Resources\Licenses\Mono.Options.txt" />
   </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Resources\Licenses\ListViewLayoutManager.txt" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="..\packages\Fody.1.26.4\build\Fody.targets" Condition="Exists('..\packages\Fody.1.26.4\build\Fody.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
@@ -579,4 +590,4 @@
   <Target Name="AfterBuild">
     <CallTarget Targets="Configs" />
   </Target>
-</Project>
+</Project>

+ 253 - 0
src/SyncTrayzor/Xaml/PassiveListView.xaml

@@ -0,0 +1,253 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">
+
+    <LinearGradientBrush x:Key="GridViewColumnHeaderBackground" EndPoint="0,1" StartPoint="0,0">
+        <GradientStop Color="#FFFFFFFF" Offset="0"/>
+        <GradientStop Color="#FFFFFFFF" Offset="0.4091"/>
+        <GradientStop Color="#FFF7F8F9" Offset="1"/>
+    </LinearGradientBrush>
+    <LinearGradientBrush x:Key="GridViewColumnHeaderBorderBackground" EndPoint="0,1" StartPoint="0,0">
+        <GradientStop Color="#FFF2F2F2" Offset="0"/>
+        <GradientStop Color="#FFD5D5D5" Offset="1"/>
+    </LinearGradientBrush>
+    <!--<LinearGradientBrush x:Key="GridViewColumnHeaderHoverBackground" EndPoint="0,1" StartPoint="0,0">
+        <GradientStop Color="#FFBDEDFF" Offset="0"/>
+        <GradientStop Color="#FFB7E7FB" Offset="1"/>
+    </LinearGradientBrush>
+    <LinearGradientBrush x:Key="GridViewColumnHeaderPressBackground" EndPoint="0,1" StartPoint="0,0">
+        <GradientStop Color="#FF8DD6F7" Offset="0"/>
+        <GradientStop Color="#FF8AD1F5" Offset="1"/>
+    </LinearGradientBrush>-->
+    <Style x:Key="GridViewColumnHeaderGripper" TargetType="{x:Type Thumb}">
+        <Setter Property="Canvas.Right" Value="-9"/>
+        <Setter Property="Width" Value="18"/>
+        <Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource TemplatedParent}}"/>
+        <Setter Property="Padding" Value="0"/>
+        <Setter Property="Background" Value="{StaticResource GridViewColumnHeaderBorderBackground}"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type Thumb}">
+                    <Border Background="Transparent" Padding="{TemplateBinding Padding}">
+                        <Rectangle Fill="{TemplateBinding Background}" HorizontalAlignment="Center" Width="1"/>
+                    </Border>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+
+    <Style x:Key="PassiveGridViewColumnHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
+        <!-- This used to be Center, but Stretch is more useful -->
+        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
+        <!-- Likewise this used to be Center -->
+        <Setter Property="VerticalContentAlignment" Value="Bottom"/>
+        <Setter Property="Background" Value="{StaticResource GridViewColumnHeaderBackground}"/>
+        <Setter Property="BorderBrush" Value="{StaticResource GridViewColumnHeaderBorderBackground}"/>
+        <Setter Property="BorderThickness" Value="0"/>
+        <Setter Property="Padding" Value="2,0,2,0"/>
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
+                    <Grid SnapsToDevicePixels="true">
+                        <Border x:Name="HeaderBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,1" Background="{TemplateBinding Background}">
+                            <Grid>
+                                <Grid.RowDefinitions>
+                                    <RowDefinition MaxHeight="7"/>
+                                    <RowDefinition/>
+                                </Grid.RowDefinitions>
+                                <Rectangle x:Name="UpperHighlight" Fill="#FFE3F7FF" Visibility="Collapsed"/>
+                                <Border Padding="{TemplateBinding Padding}" Grid.RowSpan="2">
+                                    <ContentPresenter x:Name="HeaderContent" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="0,0,0,1" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                                </Border>
+                            </Grid>
+                        </Border>
+                        <Border x:Name="HeaderHoverBorder" BorderThickness="1,0,1,1" Margin="1,1,0,0"/>
+                        <Border x:Name="HeaderPressBorder" BorderThickness="1,1,1,0" Margin="1,0,0,1"/>
+                        <Canvas>
+                            <Thumb x:Name="PART_HeaderGripper" Style="{StaticResource GridViewColumnHeaderGripper}"/>
+                        </Canvas>
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <!--<Trigger Property="IsMouseOver" Value="true">
+                            <Setter Property="Background" TargetName="HeaderBorder" Value="{StaticResource GridViewColumnHeaderHoverBackground}"/>
+                            <Setter Property="BorderBrush" TargetName="HeaderHoverBorder" Value="#FF88CBEB"/>
+                            <Setter Property="Visibility" TargetName="UpperHighlight" Value="Visible"/>
+                            <Setter Property="Background" TargetName="PART_HeaderGripper" Value="Transparent"/>
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="true">
+                            <Setter Property="Background" TargetName="HeaderBorder" Value="{StaticResource GridViewColumnHeaderPressBackground}"/>
+                            <Setter Property="BorderBrush" TargetName="HeaderHoverBorder" Value="#FF95DAF9"/>
+                            <Setter Property="BorderBrush" TargetName="HeaderPressBorder" Value="#FF7A9EB1"/>
+                            <Setter Property="Visibility" TargetName="UpperHighlight" Value="Visible"/>
+                            <Setter Property="Fill" TargetName="UpperHighlight" Value="#FFBCE4F9"/>
+                            <Setter Property="Visibility" TargetName="PART_HeaderGripper" Value="Hidden"/>
+                            <Setter Property="Margin" TargetName="HeaderContent" Value="1,1,0,0"/>
+                        </Trigger>-->
+                        <Trigger Property="Height" Value="Auto">
+                            <Setter Property="MinHeight" Value="20"/>
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Style.Triggers>
+            <Trigger Property="Role" Value="Floating">
+                <Setter Property="Opacity" Value="0.4082"/>
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
+                            <Canvas x:Name="PART_FloatingHeaderCanvas">
+                                <Rectangle Fill="#FF000000" Height="{TemplateBinding ActualHeight}" Opacity="0.4697" Width="{TemplateBinding ActualWidth}"/>
+                            </Canvas>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Trigger>
+            <Trigger Property="Role" Value="Padding">
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
+                            <Border x:Name="HeaderBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0,1,0,1" Background="{TemplateBinding Background}"/>
+                            <ControlTemplate.Triggers>
+                                <Trigger Property="Height" Value="Auto">
+                                    <Setter Property="MinHeight" Value="20"/>
+                                </Trigger>
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+
+
+    <ControlTemplate x:Key="PassiveListViewItemControlTemplate" TargetType="{x:Type ListViewItem}">
+        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2" SnapsToDevicePixels="True">
+            <Border x:Name="InnerBorder" BorderThickness="1" CornerRadius="1">
+                <Grid>
+                    <Grid.RowDefinitions>
+                        <RowDefinition MaxHeight="11"/>
+                        <RowDefinition/>
+                    </Grid.RowDefinitions>
+                    <Rectangle x:Name="UpperHighlight" Fill="#75FFFFFF" Visibility="Collapsed"/>
+                    <GridViewRowPresenter Columns="{TemplateBinding GridView.ColumnCollection}" Content="{TemplateBinding Content}" Grid.RowSpan="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                </Grid>
+            </Border>
+        </Border>
+        <ControlTemplate.Triggers>
+            <!--<Trigger Property="IsMouseOver" Value="True">
+                <Setter Property="Background">
+                    <Setter.Value>
+                        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                            <GradientStop Color="#FFF1FBFF" Offset="0"/>
+                            <GradientStop Color="#FFD5F1FE" Offset="1"/>
+                        </LinearGradientBrush>
+                    </Setter.Value>
+                </Setter>
+                <Setter Property="BorderBrush" Value="#FFCCF0FF"/>
+                <Setter Property="Visibility" TargetName="UpperHighlight" Value="Visible"/>
+            </Trigger>
+            <Trigger Property="IsSelected" Value="True">
+                <Setter Property="Background">
+                    <Setter.Value>
+                        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                            <GradientStop Color="#FFD9F4FF" Offset="0"/>
+                            <GradientStop Color="#FF9BDDFB" Offset="1"/>
+                        </LinearGradientBrush>
+                    </Setter.Value>
+                </Setter>
+                <Setter Property="BorderBrush" Value="#FF98DDFB"/>
+                <Setter Property="BorderBrush" TargetName="InnerBorder" Value="#80FFFFFF"/>
+                <Setter Property="Visibility" TargetName="UpperHighlight" Value="Visible"/>
+                <Setter Property="Fill" TargetName="UpperHighlight" Value="#40FFFFFF"/>
+            </Trigger>
+            <MultiTrigger>
+                <MultiTrigger.Conditions>
+                    <Condition Property="IsSelected" Value="True"/>
+                    <Condition Property="Selector.IsSelectionActive" Value="False"/>
+                </MultiTrigger.Conditions>
+                <Setter Property="Background">
+                    <Setter.Value>
+                        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                            <GradientStop Color="#FFEEEDED" Offset="0"/>
+                            <GradientStop Color="#FFDDDDDD" Offset="1"/>
+                        </LinearGradientBrush>
+                    </Setter.Value>
+                </Setter>
+                <Setter Property="BorderBrush" Value="#FFCFCFCF"/>
+            </MultiTrigger>
+            <MultiTrigger>
+                <MultiTrigger.Conditions>
+                    <Condition Property="IsSelected" Value="True"/>
+                    <Condition Property="IsMouseOver" Value="True"/>
+                </MultiTrigger.Conditions>
+                <Setter Property="Background">
+                    <Setter.Value>
+                        <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                            <GradientStop Color="#FFEAF9FF" Offset="0"/>
+                            <GradientStop Color="#FFC9EDFD" Offset="1"/>
+                        </LinearGradientBrush>
+                    </Setter.Value>
+                </Setter>
+                <Setter Property="BorderBrush" Value="#FF98DDFB"/>
+            </MultiTrigger>-->
+            <Trigger Property="IsEnabled" Value="False">
+                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
+            </Trigger>
+        </ControlTemplate.Triggers>
+    </ControlTemplate>
+
+    <SolidColorBrush x:Key="ListBorder" Color="#828790"/>
+    <Style x:Key="PassiveListViewStyle" TargetType="{x:Type ListView}">
+        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
+        <Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
+        <Setter Property="BorderThickness" Value="1"/>
+        <Setter Property="Foreground" Value="#FF042271"/>
+        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
+        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
+        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
+        <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
+        <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
+        <Setter Property="VerticalContentAlignment" Value="Center"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ListView}">
+                    <Themes:ListBoxChrome x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" SnapsToDevicePixels="true">
+                        <ScrollViewer Padding="{TemplateBinding Padding}" Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}">
+                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
+                        </ScrollViewer>
+                    </Themes:ListBoxChrome>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
+                        </Trigger>
+                        <MultiTrigger>
+                            <MultiTrigger.Conditions>
+                                <Condition Property="IsGrouping" Value="true"/>
+                                <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
+                            </MultiTrigger.Conditions>
+                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
+                        </MultiTrigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="ItemContainerStyle">
+            <Setter.Value>
+                <Style TargetType="{x:Type ListViewItem}">
+                    <Setter Property="Template" Value="{StaticResource PassiveListViewItemControlTemplate}"/>
+                    <!-- Not strictly part of the passiveness, but still useful -->
+                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
+                </Style>
+            </Setter.Value>
+        </Setter>
+        <Style.Resources>
+            <Style TargetType="GridViewColumnHeader" BasedOn="{StaticResource PassiveGridViewColumnHeaderStyle}"/>
+        </Style.Resources>
+    </Style>
+</ResourceDictionary>