Skip to content

Commit 9eb3de7

Browse files
authored
Merge branch 'master' into removeObsolete7
2 parents ba60fb8 + 609430a commit 9eb3de7

File tree

86 files changed

+2959
-515
lines changed

Some content is hidden

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

86 files changed

+2959
-515
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,9 +509,15 @@
509509
<Content Include="SamplePages\ViewportBehavior\ViewportBehaviorCode.bind" />
510510
<Content Include="SamplePages\Weibo Service\WeiboCode.bind" />
511511
<Compile Include="Common\TextBlockHyperlinkBehavior.cs" />
512+
<Compile Include="SamplePages\AutoFocusBehavior\AutoFocusBehaviorPage.xaml.cs">
513+
<DependentUpon>AutoFocusBehaviorPage.xaml</DependentUpon>
514+
</Compile>
512515
<Compile Include="SamplePages\EnumValuesExtension\EnumValuesExtensionPage.xaml.cs">
513516
<DependentUpon>EnumValuesExtensionPage.xaml</DependentUpon>
514517
</Compile>
518+
<Compile Include="SamplePages\FocusBehavior\FocusBehaviorPage.xaml.cs">
519+
<DependentUpon>FocusBehaviorPage.xaml</DependentUpon>
520+
</Compile>
515521
<Compile Include="SamplePages\TilesBrush\TilesBrushPage.xaml.cs">
516522
<DependentUpon>TilesBrushPage.xaml</DependentUpon>
517523
</Compile>
@@ -615,6 +621,8 @@
615621
<Content Include="SamplePages\StaggeredLayout\StaggeredLayout.bind" />
616622
<Content Include="SamplePages\EnumValuesExtension\EnumValuesExtensionXaml.bind" />
617623
<Content Include="SamplePages\EnumValuesExtension\EnumValuesExtensionCode.bind" />
624+
<Content Include="SamplePages\FocusBehavior\FocusBehaviorXaml.bind" />
625+
<Content Include="SamplePages\AutoFocusBehavior\AutoFocusBehaviorXaml.bind" />
618626
</ItemGroup>
619627
<ItemGroup>
620628
<Compile Include="App.xaml.cs">
@@ -984,10 +992,18 @@
984992
<SubType>Designer</SubType>
985993
<Generator>MSBuild:Compile</Generator>
986994
</Page>
995+
<Page Include="SamplePages\AutoFocusBehavior\AutoFocusBehaviorPage.xaml">
996+
<SubType>Designer</SubType>
997+
<Generator>MSBuild:Compile</Generator>
998+
</Page>
987999
<Page Include="SamplePages\EnumValuesExtension\EnumValuesExtensionPage.xaml">
9881000
<Generator>MSBuild:Compile</Generator>
9891001
<SubType>Designer</SubType>
9901002
</Page>
1003+
<Page Include="SamplePages\FocusBehavior\FocusBehaviorPage.xaml">
1004+
<Generator>MSBuild:Compile</Generator>
1005+
<SubType>Designer</SubType>
1006+
</Page>
9911007
<Page Include="SamplePages\TilesBrush\TilesBrushPage.xaml">
9921008
<Generator>MSBuild:Compile</Generator>
9931009
<SubType>Designer</SubType>
@@ -1512,6 +1528,10 @@
15121528
<Project>{cb444381-18ba-4a51-bb32-3a498bcc1e99}</Project>
15131529
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Layout</Name>
15141530
</ProjectReference>
1531+
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls.Markdown\Microsoft.Toolkit.Uwp.UI.Controls.Markdown.csproj">
1532+
<Project>{6fedf199-b052-49dd-8f3e-2a9224998e0f}</Project>
1533+
<Name>Microsoft.Toolkit.Uwp.UI.Controls.Markdown</Name>
1534+
</ProjectReference>
15151535
<ProjectReference Include="..\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.csproj">
15161536
<Project>{e9faabfb-d726-42c1-83c1-cb46a29fea81}</Project>
15171537
<Name>Microsoft.Toolkit.Uwp.UI.Controls</Name>
@@ -1545,6 +1565,7 @@
15451565
<Name>Visual C++ 2015 Runtime for Universal Windows Platform Apps</Name>
15461566
</SDKReference>
15471567
</ItemGroup>
1568+
<ItemGroup />
15481569
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
15491570
<VisualStudioVersion>14.0</VisualStudioVersion>
15501571
</PropertyGroup>

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,18 @@ private static Type LookForTypeByName(string typeName)
727727
}
728728
}
729729

730+
// Search in Microsoft.Toolkit.Uwp.UI.Controls.Markdown
731+
var markdownTextBlockType = typeof(MarkdownTextBlock);
732+
assembly = markdownTextBlockType.GetTypeInfo().Assembly;
733+
734+
foreach (var typeInfo in assembly.ExportedTypes)
735+
{
736+
if (typeInfo.Name == typeName)
737+
{
738+
return typeInfo;
739+
}
740+
}
741+
730742
return null;
731743
}
732744

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.AutoFocusBehaviorPage"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
mc:Ignorable="d">
9+
10+
<Grid>
11+
<StackPanel HorizontalAlignment="Center"
12+
VerticalAlignment="Center">
13+
<Button Content="I receive the focus when loaded">
14+
<interactivity:Interaction.Behaviors>
15+
<behaviors:AutoFocusBehavior />
16+
</interactivity:Interaction.Behaviors>
17+
</Button>
18+
<Button Content="I do not receive the focus when loaded" />
19+
</StackPanel>
20+
</Grid>
21+
</Page>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 Windows.UI.Xaml.Controls;
6+
7+
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
8+
{
9+
/// <summary>
10+
/// A page that shows how to use the AutoFocusBehavior
11+
/// </summary>
12+
public sealed partial class AutoFocusBehaviorPage : Page
13+
{
14+
public AutoFocusBehaviorPage() => InitializeComponent();
15+
}
16+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
mc:Ignorable="d">
8+
9+
<Grid>
10+
<StackPanel HorizontalAlignment="Center"
11+
VerticalAlignment="Center">
12+
<Button Content="I receive the focus when loaded">
13+
<interactivity:Interaction.Behaviors>
14+
<behaviors:AutoFocusBehavior />
15+
</interactivity:Interaction.Behaviors>
16+
</Button>
17+
<Button Content="I do not receive the focus when loaded" />
18+
</StackPanel>
19+
</Grid>
20+
</Page>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/EnumValuesExtension/EnumValuesExtensionPage.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
// See the LICENSE file in the project root for more information.
44

55
using System;
6-
using Windows.UI;
6+
using Microsoft.Toolkit.Uwp.SampleApp.Enums;
77
using Microsoft.Toolkit.Uwp.UI.Extensions;
8+
using Windows.UI;
89
using Windows.UI.Xaml;
910
using Windows.UI.Xaml.Data;
10-
using Microsoft.Toolkit.Uwp.SampleApp.Enums;
1111

1212
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
1313
{
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.FocusBehaviorPage"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
mc:Ignorable="d">
9+
10+
<interactivity:Interaction.Behaviors>
11+
<behaviors:FocusBehavior>
12+
<behaviors:FocusTarget Control="{x:Bind disabledItem}" />
13+
<behaviors:FocusTarget Control="{x:Bind emptyList}" />
14+
<behaviors:FocusTarget Control="{x:Bind enabledItem}" />
15+
</behaviors:FocusBehavior>
16+
</interactivity:Interaction.Behaviors>
17+
18+
<StackPanel>
19+
<Button x:Name="disabledItem"
20+
Content="I'm disabled and cannot get the focus"
21+
IsEnabled="False" />
22+
<ListView x:Name="emptyList">
23+
<!--<ListView.Items>
24+
<x:String>Item 1</x:String>
25+
<x:String>Item 2</x:String>
26+
</ListView.Items>-->
27+
</ListView>
28+
<Button x:Name="enabledItem"
29+
Content="I can get the focus" />
30+
</StackPanel>
31+
</Page>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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 Windows.UI.Xaml.Controls;
6+
7+
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
8+
{
9+
/// <summary>
10+
/// A page that shows how to use the FocusBehavior
11+
/// </summary>
12+
public sealed partial class FocusBehaviorPage : Page
13+
{
14+
public FocusBehaviorPage() => InitializeComponent();
15+
}
16+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
mc:Ignorable="d">
8+
9+
<interactivity:Interaction.Behaviors>
10+
<behaviors:FocusBehavior>
11+
<behaviors:FocusTarget Control="{x:Bind disabledItem}" />
12+
<behaviors:FocusTarget Control="{x:Bind emptyList}" />
13+
<behaviors:FocusTarget Control="{x:Bind enabledItem}" />
14+
</behaviors:FocusBehavior>
15+
</interactivity:Interaction.Behaviors>
16+
17+
<StackPanel>
18+
<Button x:Name="disabledItem"
19+
Content="I'm disabled and cannot get the focus"
20+
IsEnabled="False" />
21+
<ListView x:Name="emptyList">
22+
<!-- Uncomment this to fill the list and have it receiving the focus
23+
<ListView.Items>
24+
<x:String>Item 1</x:String>
25+
<x:String>Item 2</x:String>
26+
</ListView.Items>-->
27+
</ListView>
28+
<Button x:Name="enabledItem"
29+
Content="I can get the focus" />
30+
</StackPanel>
31+
</Page>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/InAppNotification/InAppNotificationPage.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
using Microsoft.Toolkit.Uwp.UI.Controls;
6-
using Microsoft.Toolkit.Uwp.UI.Extensions;
75
using System;
86
using System.Collections.Generic;
97
using System.Windows.Input;
8+
using Microsoft.Toolkit.Uwp.UI.Controls;
9+
using Microsoft.Toolkit.Uwp.UI.Extensions;
1010
using Windows.UI.Xaml;
1111
using Windows.UI.Xaml.Controls;
1212

0 commit comments

Comments
 (0)