Skip to content

Commit

Permalink
rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
w-ahmad committed Feb 4, 2024
1 parent 7e57bf7 commit a3b2ca2
Show file tree
Hide file tree
Showing 29 changed files with 74 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- name: Build
run: |
msbuild /restore /t:Build,Pack src/WinUI3.TableView/WinUI3.TableView.csproj /p:Configuration=Release /p:PackageVersion=${{ steps.version.outputs.version-without-v }}
msbuild /restore /t:Build,Pack src/WinUI.TableView/WinUI.TableView.csproj /p:Configuration=Release /p:PackageVersion=${{ steps.version.outputs.version-without-v }}
- name: Upload artifacts
uses: actions/upload-artifact@v1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# WinUI3.TableView
TableView for WinUI3 is derived from ListView and has basic functionalities like editing, column resizing, sorting and multi sorting.
# WinUI.TableView
TableView for WinUI is derived from ListView and has basic functionalities like editing, column resizing, sorting and multi sorting.

## Multi Sorting ![image](https://github.com/w-ahmad/WinUI3.TableView/assets/17172092/52fc3607-daae-4c63-8edb-05269397f53a)

Expand Down
6 changes: 3 additions & 3 deletions src/SampleApp/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
xmlns:table="using:WinUI3.TableView"
xmlns:table="using:WinUI.TableView"
mc:Ignorable="d">

<Grid Loaded="OnRootGridLoded"
Expand All @@ -31,12 +31,12 @@
Margin="8,0,0,0" />
</DataTemplate>
</table:TableViewTemplateColumn.CellTemplate>
<!--<table:TableViewTemplateColumn.EditingTemplate>
<table:TableViewTemplateColumn.EditingTemplate>
<DataTemplate>
<CalendarDatePicker HorizontalAlignment="Stretch"
Date="{Binding First_ascent, Mode=TwoWay}" />
</DataTemplate>
</table:TableViewTemplateColumn.EditingTemplate>-->
</table:TableViewTemplateColumn.EditingTemplate>
</table:TableViewTemplateColumn>
</table:TableViewColumnsColection>

Expand Down
3 changes: 1 addition & 2 deletions src/SampleApp/SampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
<SelfContained>true</SelfContained>
<WindowsPackageType>None</WindowsPackageType>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\WinUI3.TableView\WinUI3.TableView.csproj" />
<ProjectReference Include="..\WinUI.TableView\WinUI.TableView.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
28 changes: 14 additions & 14 deletions src/WinUI3.TableView.sln → src/WinUI.TableView.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34408.163
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUI3.TableView", "WinUI3.TableView\WinUI3.TableView.csproj", "{48F8B84A-7C15-4204-A659-23F83B574767}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleApp", "SampleApp\SampleApp.csproj", "{8D3695E5-C1B4-4E36-BAD9-BBD87B283CB0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WinUI.TableView", "WinUI.TableView\WinUI.TableView.csproj", "{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|arm64 = Debug|arm64
Expand All @@ -17,18 +17,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{48F8B84A-7C15-4204-A659-23F83B574767}.Debug|arm64.ActiveCfg = Debug|arm64
{48F8B84A-7C15-4204-A659-23F83B574767}.Debug|arm64.Build.0 = Debug|arm64
{48F8B84A-7C15-4204-A659-23F83B574767}.Debug|x64.ActiveCfg = Debug|x64
{48F8B84A-7C15-4204-A659-23F83B574767}.Debug|x64.Build.0 = Debug|x64
{48F8B84A-7C15-4204-A659-23F83B574767}.Debug|x86.ActiveCfg = Debug|x86
{48F8B84A-7C15-4204-A659-23F83B574767}.Debug|x86.Build.0 = Debug|x86
{48F8B84A-7C15-4204-A659-23F83B574767}.Release|arm64.ActiveCfg = Release|arm64
{48F8B84A-7C15-4204-A659-23F83B574767}.Release|arm64.Build.0 = Release|arm64
{48F8B84A-7C15-4204-A659-23F83B574767}.Release|x64.ActiveCfg = Release|x64
{48F8B84A-7C15-4204-A659-23F83B574767}.Release|x64.Build.0 = Release|x64
{48F8B84A-7C15-4204-A659-23F83B574767}.Release|x86.ActiveCfg = Release|x86
{48F8B84A-7C15-4204-A659-23F83B574767}.Release|x86.Build.0 = Release|x86
{8D3695E5-C1B4-4E36-BAD9-BBD87B283CB0}.Debug|arm64.ActiveCfg = Debug|arm64
{8D3695E5-C1B4-4E36-BAD9-BBD87B283CB0}.Debug|arm64.Build.0 = Debug|arm64
{8D3695E5-C1B4-4E36-BAD9-BBD87B283CB0}.Debug|x64.ActiveCfg = Debug|x64
Expand All @@ -41,6 +29,18 @@ Global
{8D3695E5-C1B4-4E36-BAD9-BBD87B283CB0}.Release|x64.Build.0 = Release|x64
{8D3695E5-C1B4-4E36-BAD9-BBD87B283CB0}.Release|x86.ActiveCfg = Release|x86
{8D3695E5-C1B4-4E36-BAD9-BBD87B283CB0}.Release|x86.Build.0 = Release|x86
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Debug|arm64.ActiveCfg = Debug|arm64
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Debug|arm64.Build.0 = Debug|arm64
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Debug|x64.ActiveCfg = Debug|x64
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Debug|x64.Build.0 = Debug|x64
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Debug|x86.ActiveCfg = Debug|x86
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Debug|x86.Build.0 = Debug|x86
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Release|arm64.ActiveCfg = Release|arm64
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Release|arm64.Build.0 = Release|arm64
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Release|x64.ActiveCfg = Release|x64
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Release|x64.Build.0 = Release|x64
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Release|x86.ActiveCfg = Release|x86
{0D5C9403-6F03-4EC2-B81C-09F46F8636DA}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Markup;
using System.Collections;
using System.Collections.Specialized;
using System.Text;
using System.Threading.Tasks;

namespace WinUI3.TableView;
namespace WinUI.TableView;
public class TableView : ListView
{
public TableView()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Data;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public abstract class TableViewBoundColumn : TableViewColumn
{
private Binding _binding = new();

public Binding Binding
public virtual Binding Binding
{
get => _binding;
set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Windows.System;
using Windows.UI.Core;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public class TableViewCell : ContentControl
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public class TableViewCheckBoxColumn : TableViewBoundColumn
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.UI.Xaml;

namespace WinUI3.TableView;
namespace WinUI.TableView;

[StyleTypedProperty(Property = nameof(HeaderStyle), StyleTargetType = typeof(TableViewColumnHeader))]
public abstract class TableViewColumn : DependencyObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using Windows.UI.Core;
using SD = CommunityToolkit.WinUI.Collections.SortDirection;

namespace WinUI3.TableView;
namespace WinUI.TableView;

[TemplateVisualState(Name = VisualStates.StateNormal, GroupName = VisualStates.GroupCommon)]
[TemplateVisualState(Name = VisualStates.StatePointerOver, GroupName = VisualStates.GroupCommon)]
Expand All @@ -25,6 +25,7 @@ public class TableViewColumnHeader : ContentControl
private bool _canSort;
private TableViewColumn? _column;
private TableView? _tableView;
private Button? _optionsButton;

public TableViewColumnHeader()
{
Expand Down Expand Up @@ -68,9 +69,16 @@ protected override void OnApplyTemplate()
base.OnApplyTemplate();

_tableView = this.FindAscendant<TableView>();
_optionsButton = GetTemplateChild("PART_OptionsButton") as Button;
_column = (TableViewColumn)DataContext;
_column.HeaderControl = this;
_canSort = _column is TableViewBoundColumn { CanSort: true, Binding.Path.Path.Length: > 0 };

if (_optionsButton is not null && _column is TableViewBoundColumn)
{
_optionsButton.Visibility = Visibility.Visible;
_optionsButton.Tapped += OnOptionsButtonTaped;
}
}

private void OnOptionsButtonTaped(object sender, TappedRoutedEventArgs e)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Collections.ObjectModel;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public class TableViewColumnsColection : ObservableCollection<TableViewColumn> { }
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public class TableViewComboBoxColumn : TableViewBoundColumn
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public class TableViewHeaderRow : ItemsControl
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public class TableViewNumberColumn : TableViewBoundColumn
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Collections.Specialized;
using System.Linq;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public class TableViewRow : Control
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.UI.Xaml;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public class TableViewTemplateColumn : TableViewColumn
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public class TableViewTextColumn : TableViewBoundColumn
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;

namespace WinUI3.TableView;
namespace WinUI.TableView;

public class TableViewToggleSwitchColumn : TableViewBoundColumn
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:toolkit="using:CommunityToolkit.WinUI.Controls"
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
xmlns:local="using:WinUI3.TableView">
xmlns:local="using:WinUI.TableView">

<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />

Expand Down Expand Up @@ -101,6 +101,32 @@
Visibility="Collapsed"
VerticalAlignment="Top"
Glyph="{ThemeResource SortIconAscending}" />

<Button x:Name="PART_OptionsButton"
Grid.Column="1"
Padding="4,6,4,4"
BorderThickness="0"
Visibility="Collapsed"
Background="Transparent"
Opacity="0"
VerticalAlignment="Bottom">
<FontIcon Grid.Row="1"
Grid.ColumnSpan="2"
FontSize="11"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Glyph="{ThemeResource OptionsButtonIcon}" />
<Button.Flyout>
<Flyout Placement="BottomEdgeAlignedLeft">
<StackPanel>
<TextBlock Style="{ThemeResource BaseTextBlockStyle}"
Text="All items will be removed. Do you want to continue?"
Margin="0,0,0,12" />
<Button Content="Yes, empty my cart" />
</StackPanel>
</Flyout>
</Button.Flyout>
</Button>
</Grid>

<toolkit:ContentSizer Margin="0,0,-4,0"
Expand Down Expand Up @@ -338,14 +364,14 @@

<Style TargetType="local:TableViewHeaderRow"
BasedOn="{StaticResource DefaultTableViewHeaderRowStyle}" />

<Style TargetType="local:TableViewColumnHeader"
BasedOn="{StaticResource DefaultTableViewColumnHeaderStyle}" />

<Style TargetType="local:TableViewCell"
BasedOn="{StaticResource DefaultTableViewCellStyle}" />

<Style TargetType="local:TableViewRow"
<Style TargetType="local:TableViewRow"
BasedOn="{StaticResource DefaultTableViewRowStyle}" />

<Style TargetType="local:TableView"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.UI.Xaml.Controls;
using System.Diagnostics;

namespace WinUI3.TableView;
namespace WinUI.TableView;

/// <summary>
/// Names and helpers for visual states in the control.
Expand Down
File renamed without changes.

0 comments on commit a3b2ca2

Please sign in to comment.