Skip to content

Commit 17f5078

Browse files
michael-hawkerSergio0694
authored andcommitted
Fix Sample Loading though there's a missing code-path for registration still
FYI @Sergio0694
1 parent ec188d8 commit 17f5078

File tree

7 files changed

+29
-72
lines changed

7 files changed

+29
-72
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -868,9 +868,6 @@
868868
<Compile Include="SamplePages\Object Storage\ObjectStoragePage.xaml.cs">
869869
<DependentUpon>ObjectStoragePage.xaml</DependentUpon>
870870
</Compile>
871-
<Compile Include="SamplePages\SurfaceDialTextbox\SurfaceDialTextboxPage.xaml.cs">
872-
<DependentUpon>SurfaceDialTextboxPage.xaml</DependentUpon>
873-
</Compile>
874871
<Compile Include="SamplePages\SystemInformation\SystemInformationPage.xaml.cs">
875872
<DependentUpon>SystemInformationPage.xaml</DependentUpon>
876873
</Compile>
@@ -1308,10 +1305,6 @@
13081305
<SubType>Designer</SubType>
13091306
<Generator>MSBuild:Compile</Generator>
13101307
</Page>
1311-
<Page Include="SamplePages\SurfaceDialTextbox\SurfaceDialTextboxPage.xaml">
1312-
<SubType>Designer</SubType>
1313-
<Generator>MSBuild:Compile</Generator>
1314-
</Page>
13151308
<Page Include="SamplePages\SystemInformation\SystemInformationPage.xaml">
13161309
<Generator>MSBuild:Compile</Generator>
13171310
<SubType>Designer</SubType>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/SurfaceDialTextbox/SurfaceDialTextboxCode.bind

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
77
mc:Ignorable="d">
88

9-
<Grid>
10-
<StackPanel HorizontalAlignment="Center"
11-
VerticalAlignment="Center">
9+
<StackPanel HorizontalAlignment="Center"
10+
VerticalAlignment="Center">
1211

13-
<TextBox HorizontalAlignment="Left"
14-
VerticalAlignment="Top"
15-
Margin="0,0,0,10"
16-
Text="0"
17-
Width="250"/>
18-
<ui:TextBoxExtensions.SurfaceDialOptions>
19-
<ui:SurfaceDialOptions
20-
StepValue="@[StepValue:DoubleSlider:1:0.1-10]"
21-
ForceMenuItem="@[ForceMenuItem:Bool:true]"
22-
EnableHapticFeedback="@[EnableHapticFeedback:Bool:true]"
23-
EnableMinMaxValue="@[EnableMinMaxValue:Bool:true]"
24-
MinValue="@[MinValue:DoubleSlider:0:0-100]"
25-
MaxValue="@[MaxValue:DoubleSlider:100:0-100]"
26-
Icon="@[Icon:Enum:RadialControllerMenuKnownIcon.Ruler]"
27-
EnableTapToNextControl="@[EnableTapToNextControl:Bool:true]"/>
28-
</ui:TextBoxExtensions.SurfaceDialOptions>
29-
</StackPanel>
30-
</Grid>
12+
<TextBox HorizontalAlignment="Left"
13+
VerticalAlignment="Top"
14+
Margin="0,0,0,10"
15+
Text="0"
16+
Width="250">
17+
<ui:TextBoxExtensions.SurfaceDialOptions>
18+
<ui:SurfaceDialOptions
19+
StepValue="@[StepValue:DoubleSlider:1:0.1-10]"
20+
ForceMenuItem="@[ForceMenuItem:Bool:true]"
21+
EnableHapticFeedback="@[EnableHapticFeedback:Bool:true]"
22+
EnableMinMaxValue="@[EnableMinMaxValue:Bool:true]"
23+
MinValue="@[MinValue:DoubleSlider:0:0-100]"
24+
MaxValue="@[MaxValue:DoubleSlider:100:0-100]"
25+
Icon="@[Icon:Enum:RadialControllerMenuKnownIcon.Ruler]"
26+
EnableTapToNextControl="@[EnableTapToNextControl:Bool:true]"/>
27+
</ui:TextBoxExtensions.SurfaceDialOptions>
28+
</TextBox>
29+
</StackPanel>
3130
</Page>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/SurfaceDialTextbox/SurfaceDialTextboxPage.xaml

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

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/SurfaceDialTextbox/SurfaceDialTextboxPage.xaml.cs

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

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/XamlOnlyPage.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
xmlns:media="using:Microsoft.Toolkit.Uwp.UI.Media"
1212
xmlns:mediaactions="using:Microsoft.Xaml.Interactions.Media"
1313
xmlns:triggers="using:Microsoft.Toolkit.Uwp.UI.Triggers"
14+
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
1415
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
1516
mc:Ignorable="d">
1617

@@ -28,6 +29,11 @@
2829
<triggers:UserHandPreferenceStateTrigger x:Key="UserHandPreferenceStateTrigger" />
2930
<triggers:UserInteractionModeStateTrigger x:Key="UserInteractionModeStateTrigger" />
3031
<behaviors:StartAnimationAction x:Key="StartAnimationAction" />
32+
<TextBox x:Key="TextBoxExtensions">
33+
<ui:TextBoxExtensions.SurfaceDialOptions>
34+
<ui:SurfaceDialOptions />
35+
</ui:TextBoxExtensions.SurfaceDialOptions>
36+
</TextBox>
3137
</Page.Resources>
3238

3339
<Grid>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,10 +1163,9 @@
11631163
},
11641164
{
11651165
"Name": "SurfaceDialTextbox",
1166-
"Type": "SurfaceDialTextboxPage",
11671166
"About": "Enables support for Surface Dial on any given Textbox. Rotate the Dial to change the numeric value of the Textbox.",
11681167
"CodeUrl": "https://github.com/windows-toolkit/WindowsCommunityToolkit/tree/master/Microsoft.Toolkit.Uwp.UI/Extensions/SurfaceDialTextbox",
1169-
"XamlCodeFile": "SurfaceDialTextboxCode.bind",
1168+
"XamlCodeFile": "/SamplePages/SurfaceDialTextbox/SurfaceDialTextboxCode.bind",
11701169
"Icon": "/SamplePages/SurfaceDialTextbox/SurfaceDialTextbox.png",
11711170
"BadgeUpdateVersionRequired": "Anniversary Update required",
11721171
"DocumentationUrl": "https://raw.githubusercontent.com/MicrosoftDocs/WindowsCommunityToolkitDocs/master/docs/extensions/SurfaceDialTextboxHelper.md"

Microsoft.Toolkit.Uwp.UI/Extensions/TextBox/SurfaceDialOptions.cs

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

55
using Windows.UI.Input;
6+
using Windows.UI.Xaml;
67
using Windows.UI.Xaml.Controls;
78

89
namespace Microsoft.Toolkit.Uwp.UI
910
{
1011
/// <summary>
1112
/// A model containing options for configuring the Surface Dial support through <see cref="TextBoxExtensions"/>.
1213
/// </summary>
13-
public sealed class SurfaceDialOptions
14+
public sealed class SurfaceDialOptions : DependencyObject
1415
{
1516
/// <summary>
1617
/// Gets an internal cached instance to avoid allocations from <see cref="TextBoxExtensions"/>.

0 commit comments

Comments
 (0)