Skip to content

Commit ac62e14

Browse files
committed
add initial docs files
1 parent d69d757 commit ac62e14

File tree

7 files changed

+259
-0
lines changed

7 files changed

+259
-0
lines changed

docs/docfx.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
3+
"metadata": [
4+
{
5+
"src": [
6+
{
7+
"src": "../src",
8+
"files": [
9+
"WinUI.TableView.csproj"
10+
]
11+
}
12+
],
13+
"dest": "api",
14+
"filter": "filterConfig.yml",
15+
"memberLayout": "samePage",
16+
"properties": {
17+
"TargetFramework": "net8.0-windows10.0.19041.0"
18+
},
19+
"disableGitFeatures": false,
20+
"disableDefaultFilter": false
21+
}
22+
],
23+
"build": {
24+
"content": [
25+
{
26+
"files": [
27+
"**/*.{md,yml}"
28+
],
29+
"exclude": [
30+
"_site/**"
31+
]
32+
}
33+
],
34+
"resource": [
35+
{
36+
"files": [
37+
"images/**"
38+
]
39+
}
40+
],
41+
"output": "../artifacts/_site",
42+
"template": [
43+
"default",
44+
"modern"
45+
],
46+
"globalMetadata": {
47+
"_appName": "WinUI.TableView",
48+
"_appTitle": "WinUI.TableView",
49+
"_enableSearch": true,
50+
"_disableNextArticle": true,
51+
"pdf": false
52+
},
53+
"postProcessors": [
54+
"ExtractSearchIndex"
55+
],
56+
"disableGitFeatures": false
57+
}
58+
}

docs/docs/customization.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Customization
2+
3+
You can customize the appearance and behavior of the `TableView` by modifying its properties, templates, and styles. For example:
4+
5+
- **Column Customization**: Define custom columns based on data types.
6+
- **Is ReadOnly**: You can make any column or the TableView itself read only.
7+
- **Sorting and Filtering**: Enable sorting and filtering on specific columns or for the all columns.
8+
- **Corner Button Mode**: Use the `CornerButtonMode` property to configure the corner button's behavior. You can select from:
9+
- `None`: No corner button.
10+
- `SelectAll`: Displays a "Select All" button.
11+
- `Options`: Displays an options menu.
12+
- **Column Header and Cell Styles**: Customize the styles for column headers and cells to match your application's theme or specific design requirements.
13+
14+
```xml
15+
<tv:TableView x:Name="MyTableView"
16+
ItemsSource="{x:Bind ViewModel.Items}"
17+
AutoGenerateColumns="False"
18+
xmlns:tv="using:WinUI.TableView">
19+
<tv:TableView.Columns>
20+
<tv:TableViewTextColumn Header="Name" Binding="{Binding Name}" />
21+
<tv:TableViewNumberColumn Header="Price" Binding="{Binding Price}" />
22+
<tv:TableViewTemplateColumn Header="Quantity">
23+
<tv:TableViewTemplateColumn.CellTemplate>
24+
<DataTemplate>
25+
<TextBlock Text="{Binding Quantity}" />
26+
</DataTemplate>
27+
</tv:TableViewTemplateColumn.CellTemplate>
28+
<tv:TableViewTemplateColumn.EditingTemplate>
29+
<DataTemplate>
30+
<NumberBox Value="{Binding Quantity, Mode=TwoWay}" />
31+
</DataTemplate>
32+
</tv:TableViewTemplateColumn.EditingTemplate>
33+
</tv:TableViewTemplateColumn>
34+
</tv:TableView.Columns>
35+
</tv:TableView>
36+
```

docs/docs/getting-started.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
## Getting Started
2+
3+
### 1. Create a New WinUI3 or Uno Project
4+
5+
If you don't already have a WinUI 3 project or Uno prject, create one in Visual Studio.
6+
7+
### 2: Install NuGet Package
8+
Inatall `WinUI.TableView` NuGet package to your app with your preferred method. Here is the one using NuGet Package Manager:
9+
10+
```bash
11+
Install-Package WinUI.TableView
12+
```
13+
### 3. Add `WinUI.TableView` to Your XAML
14+
15+
In your `MainWindow.xaml`, add the `WinUI.TableView` control:
16+
17+
```xaml
18+
<Window
19+
x:Class="App1.MainWindow"
20+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
21+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
22+
xmlns:local="using:App1"
23+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
24+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
25+
mc:Ignorable="d"
26+
xmlns:tv="using:WinUI.TableView">
27+
28+
<Grid>
29+
<tv:TableView x:Name="MyTableView"
30+
ItemsSource="{x:Bind ViewModel.Items}" />
31+
</Grid>
32+
</Window>
33+
```
34+
35+
### 4. Bind Data to `TableView`
36+
37+
In your `MainPage.xaml.cs`, set up the data context and bind data to the `TableView`:
38+
39+
```csharp
40+
public sealed partial class MainWindow : Window
41+
{
42+
public MainViewModel ViewModel { get; } = new MainViewModel();
43+
44+
public MainWindow()
45+
{
46+
this.InitializeComponent();
47+
}
48+
}
49+
```
50+
51+
Create a simple `MainViewModel` with a collection of items to display:
52+
53+
```csharp
54+
public class MainViewModel
55+
{
56+
public ObservableCollection<Item> Items { get; set; }
57+
58+
public MainViewModel()
59+
{
60+
Items = new ObservableCollection<Item>
61+
{
62+
new Item { Name = "Item 1", Price = 10.0, Quantity = 1 },
63+
new Item { Name = "Item 2", Price = 15.0, Quantity = 2 },
64+
new Item { Name = "Item 3", Price = 20.0, Quantity = 3 },
65+
// Add more items here
66+
};
67+
}
68+
}
69+
70+
public class Item : INotifyPropertyChanged
71+
{
72+
private string _name;
73+
private double _price;
74+
private int _quantity;
75+
76+
public string Name
77+
{
78+
get => _name;
79+
set
80+
{
81+
_name = value;
82+
OnPropertyChanged(nameof(Name));
83+
}
84+
}
85+
public double Price
86+
{
87+
get => _price;
88+
set
89+
{
90+
_price = value;
91+
OnPropertyChanged(nameof(Price));
92+
}
93+
}
94+
public int Quantity
95+
{
96+
get => _quantity;
97+
set
98+
{
99+
_quantity = value;
100+
OnPropertyChanged(nameof(Quantity));
101+
}
102+
}
103+
104+
private void OnPropertyChanged(string propertyName)
105+
{
106+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
107+
}
108+
109+
public event PropertyChangedEventHandler PropertyChanged;
110+
}
111+
```
112+
113+
### 5. Run Your Application
114+
115+
Build and run your application. You should see the `TableView` populated with the rows and cells from your `ViewModel`.

docs/docs/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: Getting Started
2+
href: getting-started.md
3+
- name: Customization
4+
href: customization.md

docs/filterConfig.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### YamlMime:ManagedReference
2+
3+
apiRules:
4+
- exclude:
5+
uidRegex: ^System
6+
- exclude:
7+
uidRegex: ^Microsoft

docs/index.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
_layout: landing
3+
---
4+
5+
<div style="max-width: 1000px; margin: auto; text-align: left">
6+
7+
# WinUI.TableView
8+
**WinUI.TableView** is a lightweight and fast data grid control made for [WinUI](https://learn.microsoft.com/en-us/windows/apps/winui/winui3) apps and now supports the [Uno Platform](https://platform.uno/). It is easy to use, and capable of handling large numbers of items with a focus on performance. It's derived from `ListView` so you will experience fluent look and feel in your project. It comes with all the essential features you need, plus extras like an Excel like column filter, options buttons (for columns and the TableView) and easy data export.
9+
10+
### [SampleApp](https://github.com/w-ahmad/WinUI.TableView.SampleApp)
11+
![WinUI TableView SampleApp](https://raw.githubusercontent.com/w-ahmad/WinUI.TableView.SampleApp/main/WinUI.TableView%20SampleApp.gif)
12+
13+
## Features
14+
- **Auto-generating Columns**: Automatically generate columns based on the data source.
15+
- **Individual cell selection**: You can select any cell for the ease of access and better editing experience.
16+
- **Copy row or cell content**: TableView allows you to copy rows or cells content, with the option to include or exclude column headers.
17+
- **Editing**: Modify cell content directly within the TableView by double tapping on a cell.
18+
- **Sorting**: Offers built in column sorting.
19+
- **Excel-like Column Filter**: TableView allows you to filter data within columns with an excel like flyout to enhance data exploration and analysis.
20+
- **Export functionality**: Built-in export functionality to export data to CSV format. This feature can be enabled by setting the `ShowExportOptions = true`.
21+
- **Grid Lines**: Display grid lines to improve data visibility and organization.
22+
- **Localization**: Support for multiple languages to enhance usability for global audiences.
23+
- **Alternate Row Colors**: Apply alternate row coloring for better readability and aesthetics.
24+
- **Cell & Row Context Flyout**: Provides context flyouts for cells and rows to allow quick actions. *(not available on uno)*
25+
26+
## Uno Platform Support
27+
`WinUI.TableView` is compatible with the [Uno Platform](https://platform.uno/), enabling you to use the control across multiple platforms.
28+
29+
</div>

docs/toc.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
- name: Docs
2+
href: docs/
3+
- name: API Reference
4+
href: api/
5+
- name: Sponsor this Project
6+
href: https://patreon.com/wahmad
7+
- name: GitHub
8+
href: https://github.com/w-ahmad/WinUI.TableView
9+
- name: NuGet Package
10+
href: https://www.nuget.org/packages/WinUI.TableView/

0 commit comments

Comments
 (0)