Skip to content

Commit 46761f0

Browse files
authored
Merge branch 'master' into codegen/for-loop-refactoring
2 parents 3e2cdbb + 7b41c17 commit 46761f0

File tree

81 files changed

+267
-470
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+267
-470
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ assignees: ''
1111

1212
## Describe the problem this feature would solve
1313
<!-- Please describe or link to any existing issues or discussions.
14-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
14+
A clear and concise description of what the problem is, starting with the user story.
15+
Provide examples of the restrictions in the current environment that hinders the work your users or you want to perform. What are the ways this new feature will help transform and deliver those results?
16+
For example, I am currently using the InfiniteCanvas control which lacks the ribbon control feature. I am looking to improve user experience therefore i would like to use that in my project to provide ease of accessibility and a user-friendly interface. This new feature will provide quick access to the toolbar, enhance space utilization, etc [...] -->
17+
1518

1619
## Describe the solution
17-
<!-- A clear and concise description of what you want to happen. -->
20+
<!-- A clear and concise description of what you want to happen. Define how do you think it will help the community and adds value to the toolkit? -->
21+
1822

1923
## Describe alternatives you've considered
2024
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
2125

26+
2227
## Additional context & Screenshots
2328
<!-- Add any other context or screenshots about the feature request here.-->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Please check if your PR fulfills the following requirements:
3838
- [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link -->
3939
- [ ] Sample in sample app has been added / updated (for bug fixes / features)
4040
- [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets)
41+
- [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
4142
- [ ] Tests for the changes have been added (for bug fixes / features) (if applicable)
4243
- [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*)
4344
- [ ] Contains **NO** breaking changes

Microsoft.Toolkit.Uwp.Connectivity/Microsoft.Toolkit.Uwp.Connectivity.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFramework>uap10.0.17763</TargetFramework>
4+
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
55
<Title>Windows Community Toolkit Devices</Title>
66
<Description>This library enables easier consumption of connectivity Devices/Peripherals and handle its connection to Windows devices. It contains BluetoothLE and Network connectivity helpers.</Description>
77
<PackageTags>UWP Toolkit Windows Devices Bluetooth BluetoothLE BLE Networking</PackageTags>

Microsoft.Toolkit.Uwp.DeveloperTools/AlignmentGrid/AlignmentGrid.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.Toolkit.Uwp.DeveloperTools
1212
/// <summary>
1313
/// AlignmentGrid is used to display a grid to help aligning controls
1414
/// </summary>
15-
public class AlignmentGrid : ContentControl
15+
public partial class AlignmentGrid : ContentControl
1616
{
1717
/// <summary>
1818
/// Identifies the <see cref="LineBrush"/> dependency property.

Microsoft.Toolkit.Uwp.DeveloperTools/FocusTracker/FocusTracker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace Microsoft.Toolkit.Uwp.DeveloperTools
2424
[TemplatePart(Name = "ControlType", Type = typeof(TextBlock))]
2525
[TemplatePart(Name = "ControlAutomationName", Type = typeof(TextBlock))]
2626
[TemplatePart(Name = "ControlFirstParentWithName", Type = typeof(TextBlock))]
27-
public class FocusTracker : Control
27+
public partial class FocusTracker : Control
2828
{
2929
/// <summary>
3030
/// Defines the <see cref="IsActive"/> dependency property.

Microsoft.Toolkit.Uwp.DeveloperTools/Microsoft.Toolkit.Uwp.DeveloperTools.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="MSBuild.Sdk.Extras">
22

33
<PropertyGroup>
4-
<TargetFramework>uap10.0.17763</TargetFramework>
4+
<TargetFrameworks>uap10.0.17763</TargetFrameworks>
55
<Title>Windows Community Toolkit Developer Tools</Title>
66
<Description>This library provides XAML user controls and services to help developers build their app. It is part of the Windows Community Toolkit.
77

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

Lines changed: 7 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@
124124
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed">
125125
<Version>2.0.1</Version>
126126
</PackageReference>
127-
<PackageReference Include="System.Text.Json">
128-
<Version>4.7.2</Version>
129-
</PackageReference>
130127
<PackageReference Include="NotificationsVisualizerLibrary">
131128
<Version>1.0.5</Version>
132129
</PackageReference>
@@ -565,36 +562,18 @@
565562
<Compile Include="SamplePages\TokenizingTextBox\TokenizingTextBoxPage.xaml.cs">
566563
<DependentUpon>TokenizingTextBoxPage.xaml</DependentUpon>
567564
</Compile>
568-
<Compile Include="SamplePages\Triggers\CompareStateTriggerPage.xaml.cs">
569-
<DependentUpon>CompareStateTriggerPage.xaml</DependentUpon>
570-
</Compile>
571-
<Compile Include="SamplePages\Triggers\IsEqualStateTriggerPage.xaml.cs">
572-
<DependentUpon>IsEqualStateTriggerPage.xaml</DependentUpon>
573-
</Compile>
574565
<Compile Include="SamplePages\Triggers\FullScreenModeStateTriggerPage.xaml.cs">
575566
<DependentUpon>FullScreenModeStateTriggerPage.xaml</DependentUpon>
576567
</Compile>
577568
<Compile Include="SamplePages\Triggers\IsNullOrEmptyStateTriggerPage.xaml.cs">
578569
<DependentUpon>IsNullOrEmptyStateTriggerPage.xaml</DependentUpon>
579570
</Compile>
580-
<Compile Include="SamplePages\Triggers\NetworkConnectionStateTriggerPage.xaml.cs">
581-
<DependentUpon>NetworkConnectionStateTriggerPage.xaml</DependentUpon>
582-
</Compile>
583-
<Compile Include="SamplePages\Triggers\IsNotEqualStateTriggerPage.xaml.cs">
584-
<DependentUpon>IsNotEqualStateTriggerPage.xaml</DependentUpon>
585-
</Compile>
586-
<Compile Include="SamplePages\Triggers\RegexStateTriggerPage.xaml.cs">
587-
<DependentUpon>RegexStateTriggerPage.xaml</DependentUpon>
588-
</Compile>
589-
<Compile Include="SamplePages\Triggers\UserHandPreferenceStateTriggerPage.xaml.cs">
590-
<DependentUpon>UserHandPreferenceStateTriggerPage.xaml</DependentUpon>
591-
</Compile>
592-
<Compile Include="SamplePages\Triggers\UserInteractionModeStateTriggerPage.xaml.cs">
593-
<DependentUpon>UserInteractionModeStateTriggerPage.xaml</DependentUpon>
594-
</Compile>
595571
<Compile Include="SamplePages\WrapLayout\WrapLayoutPage.xaml.cs">
596572
<DependentUpon>WrapLayoutPage.xaml</DependentUpon>
597573
</Compile>
574+
<Compile Include="SamplePages\XamlOnlyPage.xaml.cs">
575+
<DependentUpon>XamlOnlyPage.xaml</DependentUpon>
576+
</Compile>
598577
<Compile Include="Shell.Search.cs" />
599578
<Compile Include="Shell.SamplePicker.cs" />
600579
<Content Include="SamplePages\ViewportBehavior\ViewportBehaviorXaml.bind" />
@@ -1109,14 +1088,6 @@
11091088
<SubType>Designer</SubType>
11101089
<Generator>MSBuild:Compile</Generator>
11111090
</Content>
1112-
<Page Include="SamplePages\Triggers\CompareStateTriggerPage.xaml">
1113-
<Generator>MSBuild:Compile</Generator>
1114-
<SubType>Designer</SubType>
1115-
</Page>
1116-
<Page Include="SamplePages\Triggers\IsEqualStateTriggerPage.xaml">
1117-
<Generator>MSBuild:Compile</Generator>
1118-
<SubType>Designer</SubType>
1119-
</Page>
11201091
<Page Include="SamplePages\Triggers\FullScreenModeStateTriggerPage.xaml">
11211092
<Generator>MSBuild:Compile</Generator>
11221093
<SubType>Designer</SubType>
@@ -1125,26 +1096,6 @@
11251096
<Generator>MSBuild:Compile</Generator>
11261097
<SubType>Designer</SubType>
11271098
</Page>
1128-
<Page Include="SamplePages\Triggers\NetworkConnectionStateTriggerPage.xaml">
1129-
<Generator>MSBuild:Compile</Generator>
1130-
<SubType>Designer</SubType>
1131-
</Page>
1132-
<Page Include="SamplePages\Triggers\IsNotEqualStateTriggerPage.xaml">
1133-
<Generator>MSBuild:Compile</Generator>
1134-
<SubType>Designer</SubType>
1135-
</Page>
1136-
<Page Include="SamplePages\Triggers\RegexStateTriggerPage.xaml">
1137-
<Generator>MSBuild:Compile</Generator>
1138-
<SubType>Designer</SubType>
1139-
</Page>
1140-
<Page Include="SamplePages\Triggers\UserHandPreferenceStateTriggerPage.xaml">
1141-
<Generator>MSBuild:Compile</Generator>
1142-
<SubType>Designer</SubType>
1143-
</Page>
1144-
<Page Include="SamplePages\Triggers\UserInteractionModeStateTriggerPage.xaml">
1145-
<Generator>MSBuild:Compile</Generator>
1146-
<SubType>Designer</SubType>
1147-
</Page>
11481099
<Page Include="SamplePages\UniformGrid\UniformGridPage.xaml">
11491100
<Generator>MSBuild:Compile</Generator>
11501101
<SubType>Designer</SubType>
@@ -1473,6 +1424,10 @@
14731424
<Generator>MSBuild:Compile</Generator>
14741425
<SubType>Designer</SubType>
14751426
</Page>
1427+
<Page Include="SamplePages\XamlOnlyPage.xaml">
1428+
<SubType>Designer</SubType>
1429+
<Generator>MSBuild:Compile</Generator>
1430+
</Page>
14761431
<Page Include="Shell.xaml">
14771432
<Generator>MSBuild:Compile</Generator>
14781433
<SubType>Designer</SubType>

Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public string CodeUrl
157157

158158
public string ApiCheck { get; set; }
159159

160+
public bool HasType => !string.IsNullOrWhiteSpace(Type);
161+
160162
public bool HasXAMLCode => !string.IsNullOrEmpty(XamlCodeFile);
161163

162164
public bool HasCSharpCode => !string.IsNullOrEmpty(CodeFile);

Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ protected override async void OnNavigatedTo(NavigationEventArgs e)
191191

192192
if (CurrentSample != null)
193193
{
194-
if (!string.IsNullOrWhiteSpace(CurrentSample.Type))
194+
if (CurrentSample.HasType)
195195
{
196196
try
197197
{
@@ -219,7 +219,7 @@ protected override async void OnNavigatedTo(NavigationEventArgs e)
219219
SamplePage.Loaded += SamplePage_Loaded;
220220
}
221221
}
222-
else
222+
else if (!CurrentSample.HasXAMLCode)
223223
{
224224
_onlyDocumentation = true;
225225
}
@@ -327,7 +327,7 @@ protected override void OnNavigatedFrom(NavigationEventArgs e)
327327
{
328328
base.OnNavigatedFrom(e);
329329

330-
if (SamplePage != null)
330+
if (SamplePage != null && CurrentSample.HasType)
331331
{
332332
MethodInfo method = CurrentSample.PageType.GetMethod(
333333
"OnNavigatedFrom",
@@ -510,14 +510,14 @@ private void UpdateXamlRender(string text)
510510

511511
if (element != null)
512512
{
513-
// Add element to main panel
514-
if (SamplePage == null)
513+
// Add element to main panel or sub-panel
514+
FrameworkElement root = null;
515+
516+
if (CurrentSample.HasType)
515517
{
516-
return;
518+
root = SamplePage?.FindDescendantByName("XamlRoot");
517519
}
518520

519-
var root = SamplePage.FindDescendantByName("XamlRoot");
520-
521521
if (root is Panel)
522522
{
523523
// If we've defined a 'XamlRoot' element to host us as a panel, use that.
@@ -527,7 +527,7 @@ private void UpdateXamlRender(string text)
527527
else
528528
{
529529
// Otherwise, just replace the entire page's content
530-
SamplePage.Content = element;
530+
SampleContent.Content = element;
531531
}
532532

533533
// Tell the page we've finished with an update to the XAML contents, after the control has rendered.

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Triggers/CompareStateTriggerPage.xaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)