Skip to content

Commit 75f25e2

Browse files
committed
Fixed linter errors
1 parent c4042bb commit 75f25e2

File tree

2 files changed

+109
-108
lines changed

2 files changed

+109
-108
lines changed

docs/animations/AnimationSet.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The [`AnimationSet`](https://docs.microsoft.com/dotnet/api/microsoft.toolkit.uwp
1616
## How it works
1717

1818
Each set can contain any number of animation scopes and individual nodes, which can be either animations or "activities":
19+
1920
- **Animation types** are a mapping in XAML for the various APIs exposed by the `AnimationBuilder` class. They are available as both "default" animations that are ready to use and "custom" animations that can be fully configured. Each animation type also supports using keyframes in addition to just defining the starting and final values.
2021
- **Activites** on the other hand are a way to interleave an animation schedule with all sorts of custom logic, such as triggering other animations or running arbitrary code (eg. to update a visual state while an animation is running).
2122

docs/controls/datagrid_guidance/group_sort_filter.md

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ The following walk-through shows how to implement and customize grouping in the
2121

2222
1. Add the DataGrid control to your XAML page
2323

24-
```xaml
25-
<controls:DataGrid
26-
x:Name="dg"
27-
Height="600" Margin="12"
28-
AutoGenerateColumns="True">
24+
```xaml
25+
<controls:DataGrid
26+
x:Name="dg"
27+
Height="600" Margin="12"
28+
AutoGenerateColumns="True">
2929

30-
</controls:DataGrid>
31-
```
30+
</controls:DataGrid>
31+
```
3232

3333
2. Create the grouped collection using LINQ
3434

@@ -44,13 +44,13 @@ The following walk-through shows how to implement and customize grouping in the
4444
//Populate Mountains grouped collection with results of the query
4545
foreach (var g in query)
4646
{
47-
GroupInfoCollection<Mountain> info = new GroupInfoCollection<Mountain>();
48-
info.Key = g.GroupName;
49-
foreach (var item in g.Items)
50-
{
51-
info.Add(item);
52-
}
53-
mountains.Add(info);
47+
GroupInfoCollection<Mountain> info = new GroupInfoCollection<Mountain>();
48+
info.Key = g.GroupName;
49+
foreach (var item in g.Items)
50+
{
51+
info.Add(item);
52+
}
53+
mountains.Add(info);
5454
}
5555
```
5656

@@ -72,31 +72,31 @@ The following walk-through shows how to implement and customize grouping in the
7272

7373
5. Customize the Group header values through **RowGroupHeaderStyles**, **RowGroupHeaderPropertyNameAlternative** properties and by handling the **LoadingRowGroup** event to alter the auto-generated values in code.
7474

75-
```xaml
76-
<controls:DataGrid
77-
x:Name="dg"
78-
Height="600" Margin="12"
79-
AutoGenerateColumns="True"
80-
LoadingRowGroup="dg_loadingRowGroup"
81-
RowGroupHeaderPropertyNameAlternative="Range">
82-
<controls:DataGrid.RowGroupHeaderStyles>
83-
<!-- Override the default Style for groups headers -->
84-
<Style TargetType="controls:DataGridRowGroupHeader">
85-
<Setter Property="Background" Value="LightGray" />
86-
</Style>
87-
</controls:DataGrid.RowGroupHeaderStyles>
88-
</controls:DataGrid>
89-
```
90-
91-
```csharp
92-
//Handle the LoadingRowGroup event to alter the grouped header property value to be displayed
93-
private void dg_loadingRowGroup(object sender, DataGridRowGroupHeaderEventArgs e)
94-
{
95-
ICollectionViewGroup group = e.RowGroupHeader.CollectionViewGroup;
96-
Mountain item = group.GroupItems[0] as Mountain;
97-
e.RowGroupHeader.PropertyValue = item.Range;
98-
}
99-
```
75+
```xaml
76+
<controls:DataGrid
77+
x:Name="dg"
78+
Height="600" Margin="12"
79+
AutoGenerateColumns="True"
80+
LoadingRowGroup="dg_loadingRowGroup"
81+
RowGroupHeaderPropertyNameAlternative="Range">
82+
<controls:DataGrid.RowGroupHeaderStyles>
83+
<!-- Override the default Style for groups headers -->
84+
<Style TargetType="controls:DataGridRowGroupHeader">
85+
<Setter Property="Background" Value="LightGray" />
86+
</Style>
87+
</controls:DataGrid.RowGroupHeaderStyles>
88+
</controls:DataGrid>
89+
```
90+
91+
```csharp
92+
//Handle the LoadingRowGroup event to alter the grouped header property value to be displayed
93+
private void dg_loadingRowGroup(object sender, DataGridRowGroupHeaderEventArgs e)
94+
{
95+
ICollectionViewGroup group = e.RowGroupHeader.CollectionViewGroup;
96+
Mountain item = group.GroupItems[0] as Mountain;
97+
e.RowGroupHeader.PropertyValue = item.Range;
98+
}
99+
```
100100

101101
![Group](../../resources/images/Controls/DataGrid/grouping.png)
102102

@@ -115,55 +115,56 @@ The following walk-through shows how to implement sorting in the DataGrid contro
115115

116116
1. Add the DataGrid control to your XAML page. Set the appropriate sort properties and add a handler for Sorting event.
117117

118-
```xaml
119-
<controls:DataGrid
120-
x:Name="dg"
121-
Height="600" Margin="12"
122-
AutoGenerateColumns="False"
123-
CanUserSortColumns="True"
124-
Sorting="dg_Sorting">
125-
<controls:DataGrid.Columns>
126-
<controls:DataGridTextColumn Header="Range" Binding="{Binding Range}" Tag="Range"/>
127-
<!-- Add more columns -->
128-
</controls:DataGrid.Columns>
129-
</controls:DataGrid>
130-
```
118+
```xaml
119+
<controls:DataGrid
120+
x:Name="dg"
121+
Height="600" Margin="12"
122+
AutoGenerateColumns="False"
123+
CanUserSortColumns="True"
124+
Sorting="dg_Sorting">
125+
<controls:DataGrid.Columns>
126+
<controls:DataGridTextColumn Header="Range" Binding="{Binding Range}" Tag="Range"/>
127+
<!-- Add more columns -->
128+
</controls:DataGrid.Columns>
129+
</controls:DataGrid>
130+
```
131131

132132
2. Handle the Sorting event to implement logic for sorting
133133

134-
```csharp
135-
private void dg_Sorting(object sender, DataGridColumnEventArgs e)
136-
{
137-
//Use the Tag property to pass the bound column name for the sorting implementation
138-
if (e.Column.Tag.ToString() == "Range")
134+
```csharp
135+
private void dg_Sorting(object sender, DataGridColumnEventArgs e)
139136
{
140-
//Use the Tag property to pass the bound column name for the sorting implementation
137+
//Use the Tag property to pass the bound column name for the sorting implementation
141138
if (e.Column.Tag.ToString() == "Range")
142139
{
143-
//Implement sort on the column "Range" using LINQ
144-
if (e.Column.SortDirection == null || e.Column.SortDirection == DataGridSortDirection.Descending)
140+
//Use the Tag property to pass the bound column name for the sorting implementation
141+
if (e.Column.Tag.ToString() == "Range")
145142
{
146-
dg.ItemsSource = new ObservableCollection<Mountain>(from item in _items
147-
orderby item.Range ascending
148-
select item);
149-
e.Column.SortDirection = DataGridSortDirection.Ascending;
143+
//Implement sort on the column "Range" using LINQ
144+
if (e.Column.SortDirection == null || e.Column.SortDirection == DataGridSortDirection.Descending)
145+
{
146+
dg.ItemsSource = new ObservableCollection<Mountain>(from item in _items
147+
orderby item.Range ascending
148+
select item);
149+
e.Column.SortDirection = DataGridSortDirection.Ascending;
150+
}
151+
else
152+
{
153+
dg.ItemsSource = new ObservableCollection<Mountain>(from item in _items
154+
orderby item.Range descending
155+
select item);
156+
e.Column.SortDirection = DataGridSortDirection.Descending;
157+
}
150158
}
151-
else
152-
{
153-
dg.ItemsSource = new ObservableCollection<Mountain>(from item in _items
154-
orderby item.Range descending
155-
select item);
156-
e.Column.SortDirection = DataGridSortDirection.Descending;
157-
}
158-
}
159-
// add code to handle sorting by other columns as required
159+
// add code to handle sorting by other columns as required
160160

161-
// Remove sorting indicators from other columns
162-
foreach (var dgColumn in dg.Columns)
163-
{
164-
if (dgColumn.Tag.ToString() != e.Column.Tag.ToString())
161+
// Remove sorting indicators from other columns
162+
foreach (var dgColumn in dg.Columns)
165163
{
166-
dgColumn.SortDirection = null;
164+
if (dgColumn.Tag.ToString() != e.Column.Tag.ToString())
165+
{
166+
dgColumn.SortDirection = null;
167+
}
167168
}
168169
}
169170
}
@@ -180,51 +181,50 @@ private void dg_Sorting(object sender, DataGridColumnEventArgs e)
180181

181182
//Clear the SortDirection in a previously sorted column when a different column is sorted
182183
previousSortedColumn.SortDirection = null;
183-
184184
```
185185

186-
![Sort](../../resources/images/Controls/DataGrid/sorting.png)
186+
![Sort](../../resources/images/Controls/DataGrid/sorting.png)
187187

188188
## 3. Filtering
189189

190190
The DataGrid control does not support any built-in filtering capabilities. The following walk-through shows how you can implement your own filtering visuals and apply it to the DataGrid's content.
191191

192192
1. Add the DataGrid control to your XAML page.
193193

194-
```xaml
195-
<controls:DataGrid
196-
x:Name="dg"
197-
Height="600" Margin="12"
198-
AutoGenerateColumns="True"/>
199-
```
194+
```xaml
195+
<controls:DataGrid
196+
x:Name="dg"
197+
Height="600" Margin="12"
198+
AutoGenerateColumns="True"/>
199+
```
200200

201201
2. Add buttons for filtering the DataGrid's content. It is recommended to use the **CommandBar** control with **AppBarButtons** to add filtering visuals at the top of your page. The following example shows a CommandBar with the title for the table and one filter button.
202202

203-
```xaml
204-
<CommandBar
205-
Background="White"
206-
Margin="12"
207-
IsOpen="True"
208-
IsSticky="True"
209-
DefaultLabelPosition="Right"
210-
Content="Mountains table">
211-
<AppBarButton
212-
Icon="Filter"
213-
Label="Filter by Rank &lt; 50"
214-
Click="rankLowFilter_Click">
215-
</CommandBar>
216-
```
203+
```xaml
204+
<CommandBar
205+
Background="White"
206+
Margin="12"
207+
IsOpen="True"
208+
IsSticky="True"
209+
DefaultLabelPosition="Right"
210+
Content="Mountains table">
211+
<AppBarButton
212+
Icon="Filter"
213+
Label="Filter by Rank &lt; 50"
214+
Click="rankLowFilter_Click">
215+
</CommandBar>
216+
```
217217

218218
3. Handle the AppBarButton's Click event to implement the filtering logic.
219219

220-
```csharp
221-
private void rankLowFilter_Click(object sender, RoutedEventArgs e)
222-
{
223-
dg.ItemsSource = new ObservableCollection<Mountain>(from item in _items
224-
where item.Rank < 50
225-
select item);
226-
}
227-
```
220+
```csharp
221+
private void rankLowFilter_Click(object sender, RoutedEventArgs e)
222+
{
223+
dg.ItemsSource = new ObservableCollection<Mountain>(from item in _items
224+
where item.Rank < 50
225+
select item);
226+
}
227+
```
228228

229229
## Example app
230230

0 commit comments

Comments
 (0)