Skip to content

Commit

Permalink
feat: Update TreeView to winui3/release/1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Oct 25, 2023
1 parent 69abdbf commit f668510
Show file tree
Hide file tree
Showing 35 changed files with 3,999 additions and 4,042 deletions.
Original file line number Diff line number Diff line change
@@ -1,56 +1,33 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.UI.Xaml.Controls">

<!--not used, leave here for backword compatability-->
<!-- MUX Reference TreeView.xaml, commit tag winui3/release/1.4.2 -->
<ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="using:Microsoft.UI.Xaml.Controls" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<DataTemplate x:Key="TreeViewItemDataTemplate">
<Grid Height="44" >
<TextBlock
Text="{Binding Content}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Style="{ThemeResource BodyTextBlockStyle}"/>
</Grid>
<Grid Height="44">
<TextBlock Text="{Binding Content}" HorizontalAlignment="Left" VerticalAlignment="Center" Style="{ThemeResource BodyTextBlockStyle}" />
</Grid>
</DataTemplate>

<Style TargetType="local:TreeView" BasedOn="{StaticResource DefaultTreeViewStyle}" />

<Style x:Key="DefaultTreeViewStyle" TargetType="local:TreeView">
<Setter Property="IsTabStop" Value="False" />
<Setter Property="CanDragItems" Value="True"/>
<Setter Property="CanReorderItems" Value="True"/>
<Setter Property="AllowDrop" Value="True"/>
<Setter Property="ItemContainerTransitions">
<Setter.Value>
<TransitionCollection>
<ContentThemeTransition />
<ReorderThemeTransition />
<EntranceThemeTransition IsStaggeringEnabled="False" />
</TransitionCollection>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:TreeView">
<local:TreeViewList
x:Name="ListControl"
Background="{TemplateBinding Background}"
ItemTemplate="{TemplateBinding ItemTemplate}"
ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}"
ItemContainerStyle="{TemplateBinding ItemContainerStyle}"
ItemContainerStyleSelector="{TemplateBinding ItemContainerStyleSelector}"
ItemContainerTransitions="{TemplateBinding ItemContainerTransitions}"
CanDragItems="{TemplateBinding CanDragItems}"
AllowDrop="{TemplateBinding AllowDrop}"
CanReorderItems="{TemplateBinding CanReorderItems}">
</local:TreeViewList>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style TargetType="controls:TreeView" BasedOn="{StaticResource DefaultTreeViewStyle}" />
<Style x:Key="DefaultTreeViewStyle" TargetType="controls:TreeView">
<Setter Property="IsTabStop" Value="False" />
<Setter Property="CanDragItems" Value="True" />
<Setter Property="CanReorderItems" Value="True" />
<Setter Property="AllowDrop" Value="True" />
<Setter Property="ItemContainerTransitions">
<Setter.Value>
<TransitionCollection>
<ContentThemeTransition />
<ReorderThemeTransition />
<EntranceThemeTransition IsStaggeringEnabled="False" />
</TransitionCollection>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:TreeView">
<controls:TreeViewList x:Name="ListControl" Background="{TemplateBinding Background}" ItemTemplate="{TemplateBinding ItemTemplate}" ItemTemplateSelector="{TemplateBinding ItemTemplateSelector}" ItemContainerStyle="{TemplateBinding ItemContainerStyle}" ItemContainerStyleSelector="{TemplateBinding ItemContainerStyleSelector}" ItemContainerTransitions="{TemplateBinding ItemContainerTransitions}" CanDragItems="{TemplateBinding CanDragItems}" AllowDrop="{TemplateBinding AllowDrop}" CanReorderItems="{TemplateBinding CanReorderItems}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style TargetType="local:TreeViewItem" BasedOn="{StaticResource MUX_TreeViewItemStyle}"/>

</ResourceDictionary>
<Style TargetType="controls:TreeViewItem" BasedOn="{StaticResource MUX_TreeViewItemStyle}" />
</ResourceDictionary>
Loading

0 comments on commit f668510

Please sign in to comment.