Skip to content

Commit c25f25b

Browse files
skendrotmichael-hawkerKyaa-dost
authored
Add new WrapLayout and StaggeredLayout controls (#3160)
* Update dev/7.0.0 branch version number * Add a new project for layout controls * First port of the StaggeredPanel to the new StaggeredLayout * Create a new class that will hold layout information * Early exit if we don't have any items * Early exit for no realization area to render to * Don't work with the UIElement directly within the measure method. Instead use a new StaggeredItem to track the size of the element * Stop measuring elements when we are outside the realization rect * Track the top of the element on the StaggeredItem * Track the column layout and use that to arrange the items after measure * Make sure the top of the elemet accounts for the spacing between items * Move the column width to the state * Remove horizontal alignment calculations. I don't believe this should be part of a layout. The ItemsRepeater will handle that * No need to arrange anything if there is no realization bounds * No need to keep arranging if we are outside the bounds * Return the column for the given index * Return the final size always * Get the item in the column layout, not the index * Stop measuring after we have measured all columns that fit the bounds * If the column width is different from what was previously there then clear the items because we will need to recalculate the size of the items * Manually recycle elements that fall outside of the bounds * since we are staying within one column we do not need to track the height and number of items in each column * Make sure we remove the state * Rename method to clear all the things * When the width of the panel changes we could get more columns to use. In that case clear out the cache of columns * We ALWAYS want to measure an item that will be in the bounds * Calculate the height based on the number of average number of items we have or, if we have all of the items use the total height * Remove manual recycling logic * Remove padding property to be in line with the WinUI layouts * Little code Clean up * Add some comments * Remove method not used anymore * We've already calculated the top. Use that value for placement * Remove items from the layout state when an item is removed from the layout itself * Clear the columns after the removal item * We don't need to clear any of the cache if the an item was added/removed where we haven't cached * Clear cached items when an item is added * Clear the entire cache when the collection has been reset * No need to calculate the number of columns. We have it in our layout state * First port of the WrapPanel to be a Layout * Stop measuring items when we are outside the bounds * Only arrange items within the bounds * The bottom of the items needs to be within the top bounds. * Keep track of the element measure and only get the element when we need to * break out of the arrange when we have passed the realization bounds * Always measure items that are within the bounds * Add the <inheritdoc /> tag * Clear items when the collection changes * When the Orientation changes, clear the cache * No need to clear the entire collection. We can just switch the values * Only check if we're past the bounds when we move to the next row * Remove Padding to be in line with the WinUI Layouts * Add debugger info * Store the position of items instead of calculating each time * Reset the position of items whenever a layout property changes * Clear positions whenever the available U value changes * Clear the available U whenever orientation changes * Remove property not used * Make sure to null the position when orientation changes * Remove the attached property and store the spacing in the state * Calculate the height of the items * Don't average items that haven't had their position calculated yet * Fix type in variable * Make sure elements get recycled when they are outside the scope of the bounds. Move getting the elements to the layout * Ignore row spacing for determining which column an items goes to * This array holds ints, not doubles * Add height to the debugger display * We need to recalculate the height when the RowSpacing changes * Revert the change to not account for row spacing when finding the column. Items will jump around when playing with RowSpacing but that's not a common use case and items were not placed in the right column * Use the laest version of WinUI * Make sure elements that are above the bounds are recycled * Recycle an element if it is below the bounds * Make method static * Add case handling for items being replaced * Switch to a switch statement * Add a comment as to what is happening when the height is zero * Add required space after brace * Handle moving of items * Recycle elements when they are replaced or moved to ensure the correct context * Switch to a swtich statement for the items changing * Add support for moving an item in the wrap layout * Do not clear the items from the collection. zero out their measure values so they get recalculated * Add handling for an item being replaced in the wrap layout * A move could effect the position of items after it. So just clear them out * Add header to file * Remove unused usings * Add summary comment for the class * Add a simple WrapLayout sample * Add a simple sample for the new staggered layout * Put the property on different lines * Remove trailing white space * Remove empty Item group * recycle elements that are below the bounds * Rename local method * Only measure an item if it wasn't already measured. This helps speed up items when first being measured * Increae the size of the items * Add the location for code and documentation * Track the elements that are used and make sure they recycled when they are outside of the bounds of the realization area * Change the category for the layouts * When an item changes size we need to set a new height for the item and reset everything after it * If the current measure of the item does not match then the size of the item changed. We need to recalculate layout for everything after it * Need to check changes in V also * Just use the handy Equals method! * No need to remove items that are above index * Move items to a new row if the size makes them larger than the given space Co-authored-by: Michael Hawker MSFT (XAML Llama) <[email protected]> Co-authored-by: Kyaa-dost <[email protected]>
1 parent 9e7ab5d commit c25f25b

25 files changed

+1509
-2
lines changed

Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
<Version>6.1.0-build.6</Version>
116116
</PackageReference>
117117
<PackageReference Include="Microsoft.UI.Xaml">
118-
<Version>2.2.190917002</Version>
118+
<Version>2.3.200213001</Version>
119119
</PackageReference>
120120
<PackageReference Include="Monaco.Editor">
121121
<Version>0.7.0-alpha</Version>
@@ -273,6 +273,7 @@
273273
<Content Include="SamplePages\OnDevice\OnDevice.png" />
274274
<Content Include="SamplePages\RemoteDeviceHelper\RemoteDeviceHelper.png" />
275275
<Content Include="SamplePages\ImageCropper\ImageCropper.png" />
276+
<Content Include="SamplePages\StaggeredLayout\StaggeredLayout.png" />
276277
<Content Include="SamplePages\TabView\TabView.png" />
277278
<Content Include="SamplePages\PeoplePicker\PeoplePicker.png" />
278279
<Content Include="SamplePages\PersonView\PersonView.png" />
@@ -367,6 +368,7 @@
367368
<Content Include="SamplePages\ViewportBehavior\ViewportBehavior.png" />
368369
<Content Include="SamplePages\Visual Extensions\VisualExtensions.png" />
369370
<Content Include="SamplePages\Weibo Service\WeiboLogo.png" />
371+
<Content Include="SamplePages\WrapLayout\WrapLayout.png" />
370372
<Content Include="SamplePages\WrapPanel\WrapPanel.png" />
371373
<Content Include="landingPageLinks.json" />
372374
<Content Include="Assets\mtns.csv">
@@ -531,10 +533,16 @@
531533
<Compile Include="SamplePages\ImageCropper\ImageCropperPage.xaml.cs">
532534
<DependentUpon>ImageCropperPage.xaml</DependentUpon>
533535
</Compile>
536+
<Compile Include="SamplePages\StaggeredLayout\StaggeredLayoutPage.xaml.cs">
537+
<DependentUpon>StaggeredLayoutPage.xaml</DependentUpon>
538+
</Compile>
534539
<Compile Include="SamplePages\TokenizingTextBox\SampleDataType.cs" />
535540
<Compile Include="SamplePages\TokenizingTextBox\TokenizingTextBoxPage.xaml.cs">
536541
<DependentUpon>TokenizingTextBoxPage.xaml</DependentUpon>
537542
</Compile>
543+
<Compile Include="SamplePages\WrapLayout\WrapLayoutPage.xaml.cs">
544+
<DependentUpon>WrapLayoutPage.xaml</DependentUpon>
545+
</Compile>
538546
<Compile Include="Shell.Search.cs" />
539547
<Compile Include="Shell.SamplePicker.cs" />
540548
<Content Include="SamplePages\ViewportBehavior\ViewportBehaviorXaml.bind" />
@@ -545,6 +553,8 @@
545553
<Content Include="SamplePages\Eyedropper\EyedropperXaml.bind" />
546554
<Content Include="SamplePages\Eyedropper\EyedropperCode.bind" />
547555
<Content Include="SamplePages\TokenizingTextBox\TokenizingTextBoxCode.bind" />
556+
<Content Include="SamplePages\WrapLayout\WrapLayout.bind" />
557+
<Content Include="SamplePages\StaggeredLayout\StaggeredLayout.bind" />
548558
<Content Include="SamplePages\ObservableGroup\ObservableGroup.bind" />
549559
</ItemGroup>
550560
<ItemGroup>
@@ -959,6 +969,10 @@
959969
<SubType>Designer</SubType>
960970
<Generator>MSBuild:Compile</Generator>
961971
</Page>
972+
<Page Include="SamplePages\StaggeredLayout\StaggeredLayoutPage.xaml">
973+
<SubType>Designer</SubType>
974+
<Generator>MSBuild:Compile</Generator>
975+
</Page>
962976
<Page Include="SamplePages\TabView\TabViewPage.xaml">
963977
<Generator>MSBuild:Compile</Generator>
964978
<SubType>Designer</SubType>
@@ -1335,6 +1349,10 @@
13351349
<SubType>Designer</SubType>
13361350
<Generator>MSBuild:Compile</Generator>
13371351
</Page>
1352+
<Page Include="SamplePages\WrapLayout\WrapLayoutPage.xaml">
1353+
<SubType>Designer</SubType>
1354+
<Generator>MSBuild:Compile</Generator>
1355+
</Page>
13381356
<Page Include="SamplePages\WrapPanel\WrapPanelPage.xaml">
13391357
<Generator>MSBuild:Compile</Generator>
13401358
<SubType>Designer</SubType>
@@ -1408,6 +1426,10 @@
14081426
<Project>{daeb9cec-c817-33b2-74b2-bc379380db72}</Project>
14091427
<Name>Microsoft.Toolkit.Uwp.UI.Controls.DataGrid</Name>
14101428
</ProjectReference>
1429+
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Layout\Microsoft.Toolkit.Uwp.UI.Controls.Layout.csproj">
1430+
<Project>{cb444381-18ba-4a51-bb32-3a498bcc1e99}</Project>
1431+
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Layout</Name>
1432+
</ProjectReference>
14111433
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.csproj">
14121434
<Project>{e9faabfb-d726-42c1-83c1-cb46a29fea81}</Project>
14131435
<Name>Microsoft.Toolkit.Uwp.UI.Controls</Name>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
6+
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
7+
mc:Ignorable="d">
8+
9+
<Page.Resources>
10+
<DataTemplate x:Key="StaggeredTemplate">
11+
<Grid Background="{ThemeResource Brush-Grey-04}">
12+
<Border Width="{Binding Width}" Height="{Binding Height}">
13+
<Border.Background>
14+
<SolidColorBrush Color="{Binding Color}"/>
15+
</Border.Background>
16+
<TextBlock Text="{Binding Index}" FontSize="20"/>
17+
</Border>
18+
</Grid>
19+
20+
</DataTemplate>
21+
</Page.Resources>
22+
23+
<Grid Padding="48">
24+
<ScrollViewer >
25+
<winui:ItemsRepeater x:Name="StaggeredRepeater"
26+
ItemTemplate="{StaticResource StaggeredTemplate}">
27+
<winui:ItemsRepeater.Layout>
28+
<controls:StaggeredLayout DesiredColumnWidth="@[DesiredColumnWidth:Slider:250:50-400]"
29+
ColumnSpacing="@[ColumnSpacing:Slider:5:0-50]@"
30+
RowSpacing="@[RowSpacing:Slider:5:0-50]@"/>
31+
</winui:ItemsRepeater.Layout>
32+
</winui:ItemsRepeater>
33+
</ScrollViewer>
34+
</Grid>
35+
</Page>
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Page
2+
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.StaggeredLayoutPage"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages.StaggeredLayout"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
mc:Ignorable="d"
9+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
10+
11+
<Grid>
12+
13+
</Grid>
14+
</Page>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using System.Collections.ObjectModel;
7+
using Microsoft.Toolkit.Uwp.UI.Extensions;
8+
using Microsoft.UI.Xaml.Controls;
9+
using Windows.UI;
10+
using Windows.UI.Xaml;
11+
using Windows.UI.Xaml.Controls;
12+
13+
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
14+
{
15+
/// <summary>
16+
/// An empty page that can be used on its own or navigated to within a Frame.
17+
/// </summary>
18+
public sealed partial class StaggeredLayoutPage : Page, IXamlRenderListener
19+
{
20+
private ObservableCollection<Item> _items = new ObservableCollection<Item>();
21+
private Random _random;
22+
23+
public StaggeredLayoutPage()
24+
{
25+
this.InitializeComponent();
26+
27+
_random = new Random(DateTime.Now.Millisecond);
28+
for (int i = 0; i < _random.Next(1000, 5000); i++)
29+
{
30+
var item = new Item { Index = i, Width = _random.Next(50, 250), Height = _random.Next(50, 250), Color = Color.FromArgb(255, (byte)_random.Next(0, 255), (byte)_random.Next(0, 255), (byte)_random.Next(0, 255)) };
31+
_items.Add(item);
32+
}
33+
}
34+
35+
public void OnXamlRendered(FrameworkElement control)
36+
{
37+
var repeater = control.FindChildByName("StaggeredRepeater") as ItemsRepeater;
38+
39+
if (repeater != null)
40+
{
41+
repeater.ItemsSource = _items;
42+
}
43+
}
44+
45+
private class Item
46+
{
47+
public int Index { get; internal set; }
48+
49+
public int Width { get; internal set; }
50+
51+
public int Height { get; internal set; }
52+
53+
public Color Color { get; internal set; }
54+
}
55+
}
56+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
6+
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
7+
mc:Ignorable="d">
8+
9+
<Page.Resources>
10+
<DataTemplate x:Key="WrapTemplate">
11+
<Border Width="{Binding Width}" Height="50">
12+
<Border.Background>
13+
<SolidColorBrush Color="{Binding Color}"/>
14+
</Border.Background>
15+
<TextBlock Text="{Binding Index}" FontSize="20"/>
16+
</Border>
17+
</DataTemplate>
18+
</Page.Resources>
19+
20+
<Grid Padding="48">
21+
<ScrollViewer >
22+
<winui:ItemsRepeater x:Name="WrapRepeater"
23+
Background="{ThemeResource Brush-Grey-04}"
24+
ItemTemplate="{StaticResource WrapTemplate}">
25+
<winui:ItemsRepeater.Layout>
26+
<controls:WrapLayout x:Name="Wrap"
27+
VerticalSpacing="@[VerticalSpacing:Slider:5:0-200]@"
28+
HorizontalSpacing="@[HorizontalSpacing:Slider:5:0-200]@"/>
29+
</winui:ItemsRepeater.Layout>
30+
</winui:ItemsRepeater>
31+
</ScrollViewer>
32+
</Grid>
33+
</Page>
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Page
2+
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.WrapLayoutPage"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages.WrapLayout"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
9+
mc:Ignorable="d"
10+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
11+
12+
<Grid>
13+
14+
</Grid>
15+
</Page>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System;
6+
using System.Collections.ObjectModel;
7+
using Microsoft.Toolkit.Uwp.UI.Extensions;
8+
using Microsoft.UI.Xaml.Controls;
9+
using Windows.UI;
10+
using Windows.UI.Xaml;
11+
using Windows.UI.Xaml.Controls;
12+
13+
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
14+
{
15+
/// <summary>
16+
/// An empty page that can be used on its own or navigated to within a Frame.
17+
/// </summary>
18+
public sealed partial class WrapLayoutPage : Page, IXamlRenderListener
19+
{
20+
private ObservableCollection<Item> _items = new ObservableCollection<Item>();
21+
private Random _random;
22+
23+
public WrapLayoutPage()
24+
{
25+
this.InitializeComponent();
26+
27+
_random = new Random(DateTime.Now.Millisecond);
28+
for (int i = 0; i < _random.Next(1000, 5000); i++)
29+
{
30+
var item = new Item { Index = i, Width = _random.Next(50, 250), Height = _random.Next(50, 250), Color = Color.FromArgb(255, (byte)_random.Next(0, 255), (byte)_random.Next(0, 255), (byte)_random.Next(0, 255)) };
31+
_items.Add(item);
32+
}
33+
}
34+
35+
public void OnXamlRendered(FrameworkElement control)
36+
{
37+
var repeater = control.FindChildByName("WrapRepeater") as ItemsRepeater;
38+
39+
if (repeater != null)
40+
{
41+
repeater.ItemsSource = _items;
42+
}
43+
}
44+
45+
private class Item
46+
{
47+
public int Index { get; internal set; }
48+
49+
public int Width { get; internal set; }
50+
51+
public int Height { get; internal set; }
52+
53+
public Color Color { get; internal set; }
54+
}
55+
}
56+
}

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/samples.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,16 @@
229229
"Icon": "/SamplePages/WrapPanel/WrapPanel.png",
230230
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/WrapPanel.md"
231231
},
232+
{
233+
"Name": "WrapLayout",
234+
"Type": "WrapLayoutPage",
235+
"Subcategory": "Layout - ItemsRepeater",
236+
"About": "The WrapLayout virtualizes child elements in sequential position from left to right, breaking content to the next line at the edge of the containing box.",
237+
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Layout/WrapLayout",
238+
"XamlCodeFile": "WrapLayout.bind",
239+
"Icon": "/SamplePages/WrapLayout/WrapLayout.png",
240+
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/layout/WrapLayout.md"
241+
},
232242
{
233243
"Name": "OrbitView",
234244
"Type": "OrbitViewPage",
@@ -302,6 +312,16 @@
302312
"Icon": "/SamplePages/StaggeredPanel/StaggeredPanel.png",
303313
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/StaggeredPanel.md"
304314
},
315+
{
316+
"Name": "StaggeredLayout",
317+
"Type": "StaggeredLayoutPage",
318+
"Subcategory": "Layout - ItemsRepeater",
319+
"About": "The StaggeredLayout virtualizes items in a column approach where an item will be added to whichever column has used the least amount of space.",
320+
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI.Controls.Layout/StaggeredLayout",
321+
"XamlCodeFile": "StaggeredLayout.bind",
322+
"Icon": "/SamplePages/StaggeredLayout/StaggeredLayout.png",
323+
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/controls/layout/StaggeredLayout.md"
324+
},
305325
{
306326
"Name": "LayoutTransformControl",
307327
"Type": "LayoutTransformControlPage",
@@ -424,7 +444,7 @@
424444
"XamlCodeFile": "FocusTrackerXaml.bind",
425445
"Icon": "/SamplePages/FocusTracker/FocusTracker.png",
426446
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/developer-tools/FocusTracker.md"
427-
}//,
447+
} //,
428448
//{
429449
// "Name": "TokenizingTextBox",
430450
// "Type": "TokenizingTextBoxPage",
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project Sdk="MSBuild.Sdk.Extras">
2+
3+
<PropertyGroup>
4+
<TargetFramework>uap10.0.17134</TargetFramework>
5+
<TargetPlatformVersion Condition="'$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion>
6+
<Title>Windows Community Toolkit Layout</Title>
7+
<Description>
8+
This library provides XAML layout controls. It is part of the Windows Community Toolkit.
9+
</Description>
10+
<RootNamespace>Microsoft.Toolkit.Uwp.UI.Controls</RootNamespace>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<None Include="VisualStudioToolsManifest.xml" Pack="true" PackagePath="tools" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<PackageReference Include="Microsoft.UI.Xaml" Version="2.3.200213001" />
19+
</ItemGroup>
20+
21+
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
22+
23+
<!-- https://weblogs.asp.net/rweigelt/disable-warnings-in-generated-c-files-of-uwp-app -->
24+
<Target Name="PragmaWarningDisablePrefixer" AfterTargets="MarkupCompilePass2">
25+
<ItemGroup>
26+
<GeneratedCSFiles Include="**\*.g.cs;**\*.g.i.cs" />
27+
</ItemGroup>
28+
<Message Text="CSFiles: @(GeneratedCSFiles->'&quot;%(Identity)&quot;')" />
29+
<Exec Command="for %%f in (@(GeneratedCSFiles->'&quot;%(Identity)&quot;')) do echo #pragma warning disable &gt; %%f.temp &amp;&amp; type %%f &gt;&gt; %%f.temp &amp;&amp; move /y %%f.temp %%f &gt; NUL" />
30+
</Target>
31+
</Project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
3+
</wpf:ResourceDictionary>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
// See the LICENSE file in the project root for more information.
4+
5+
using System.Resources;
6+
using System.Runtime.CompilerServices;
7+
8+
// General Information about an assembly is controlled through the following
9+
// set of attributes. Change these attribute values to modify the information
10+
// associated with an assembly.
11+
[assembly: InternalsVisibleTo("UnitTests")]
12+
[assembly: NeutralResourcesLanguage("en-US")]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
3+
<Library Name="Microsoft.Toolkit.Uwp.UI.Controls.Layout">
4+
</Library>
5+
</Directives>

0 commit comments

Comments
 (0)