Skip to content

Commit

Permalink
Move HeaderedControls dependency to samples only
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-hawker committed Aug 1, 2023
1 parent 8db98a8 commit 977ee2a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
10 changes: 10 additions & 0 deletions components/DataTable/samples/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
For UWP / WinAppSDK / Uno packages, place the package references here.
-->
<Project>
<!-- WinUI 2 / UWP / Uno -->
<ItemGroup Condition="'$(IsUwp)' == 'true' OR ('$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '2')">
<PackageReference Include="CommunityToolkit.Uwp.Controls.HeaderedControls" Version="8.0.0-beta.1"/>
</ItemGroup>

<!-- WinUI 3 / WinAppSdk / Uno -->
<ItemGroup Condition="'$(IsWinAppSdk)' == 'true' OR ('$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '3')">
<PackageReference Include="CommunityToolkit.WinUI.Controls.HeaderedControls" Version="8.0.0-beta.1"/>
</ItemGroup>

<!-- WinUI 2 / UWP -->
<ItemGroup Condition="'$(IsUwp)' == 'true'">
<!-- <PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls.Primitives" Version="7.1.2"/> -->
Expand Down
4 changes: 2 additions & 2 deletions components/DataTable/src/DataTable/DataColumn.xaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
Expand Down Expand Up @@ -38,8 +38,8 @@
Width="8"
MinWidth="4"
Margin="0"
Foreground="{ThemeResource ControlStrokeColorSecondaryBrush}"
Background="Transparent"
Foreground="{ThemeResource ControlStrokeColorSecondaryBrush}"
Visibility="{Binding CanResize, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource DataColumnBoolToVisibilityConverter}}">
<controls:ContentSizer.Resources>
<Thickness x:Key="SizerBaseThumbMargin">0</Thickness>
Expand Down
2 changes: 0 additions & 2 deletions components/DataTable/src/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@
<PackageReference Include="CommunityToolkit.Uwp.Converters" Version="8.0.0-beta.1"/>
<PackageReference Include="CommunityToolkit.Uwp.Extensions" Version="8.0.0-beta.1"/>
<PackageReference Include="CommunityToolkit.Uwp.Controls.Sizers" Version="8.0.0-beta.2"/>
<PackageReference Include="CommunityToolkit.Uwp.Controls.HeaderedControls" Version="8.0.0-beta.1"/>
</ItemGroup>

<!-- WinUI 3 / WinAppSdk / Uno -->
<ItemGroup Condition="'$(IsWinAppSdk)' == 'true' OR ('$(IsUno)' == 'true' AND '$(WinUIMajorVersion)' == '3')">
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.0.0-beta.1"/>
<PackageReference Include="CommunityToolkit.WinUI.Extensions" Version="8.0.0-beta.1"/>
<PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.0.0-beta.2"/>
<PackageReference Include="CommunityToolkit.WinUI.Controls.HeaderedControls" Version="8.0.0-beta.1"/>
</ItemGroup>
</Project>
16 changes: 8 additions & 8 deletions components/DataTable/tests/DataTableColumnAutoSizeTestPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">

<controls:HeaderedItemsControl>
<controls:HeaderedItemsControl.Header>
<ListView>
<ListView.Header>
<controls:DataTable>
<controls:DataColumn DesiredWidth="Auto" />
<!-- Need 2nd column to force size of available for testing -->
<controls:DataColumn DesiredWidth="*" />
</controls:DataTable>
</controls:HeaderedItemsControl.Header>
<controls:HeaderedItemsControl.ItemTemplate>
</ListView.Header>
<ListView.ItemTemplate>
<DataTemplate x:DataType="x:String">
<controls:DataRow>
<Border MinWidth="50"
Expand All @@ -26,16 +26,16 @@
<Border Tag="ExtraArea" />
</controls:DataRow>
</DataTemplate>
</controls:HeaderedItemsControl.ItemTemplate>
<controls:HeaderedItemsControl.ItemContainerStyle>
</ListView.ItemTemplate>
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</controls:HeaderedItemsControl.ItemContainerStyle>
</ListView.ItemContainerStyle>

<!-- Content -->
<x:String>1</x:String>
<x:String>SuperLongString</x:String>
<x:String>Short</x:String>
</controls:HeaderedItemsControl>
</ListView>
</Page>

0 comments on commit 977ee2a

Please sign in to comment.