-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding the Surface Dial Textbox Helper class. #704
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f5efa7b
Adding the Surface Dial Textbox Helper class.
petriw 8040a19
Adding headers to sample page.
petriw 2ea0a9a
Adding feedback from previous commit. Ran XAML through XAML styler an…
petriw 4afd9db
Adding API check and fixing the bind file.
petriw 8b093f4
Moving properties to the top of the file.
petriw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+6.8 KB
...Uwp.SampleApp/SamplePages/SurfaceDialTextboxHelper/SurfaceDialTextboxHelper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
...lkit.Uwp.SampleApp/SamplePages/SurfaceDialTextboxHelper/SurfaceDialTextboxHelperCode.bind
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<Page | ||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.SurfaceDialTextboxHelperPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages" | ||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<TextBox HorizontalAlignment="Left" VerticalAlignment="Top" Text="0" Width="106" | ||
controls:SurfaceDialTextboxHelper.StepValue="@[StepValue:DoubleSlider:1:0.1-10]" | ||
controls:SurfaceDialTextboxHelper.ForceMenuItem="@[ForceMenuItem:Bool:true]" | ||
controls:SurfaceDialTextboxHelper.EnableHapticFeedback="@[EnableHapticFeedback:Bool:true]" | ||
controls:SurfaceDialTextboxHelper.EnableMinMaxValue="@[EnableMinMaxValue:Bool:true]" | ||
controls:SurfaceDialTextboxHelper.MinValue="@[MinValue:DoubleSlider:0:0-100]" | ||
controls:SurfaceDialTextboxHelper.MaxValue="@[MaxValue:DoubleSlider:100:0-100]" | ||
controls:SurfaceDialTextboxHelper.Icon="@[Icon:Enum:RadialControllerMenuKnownIcon.Ruler]" | ||
controls:SurfaceDialTextboxHelper.EnableTapToNextControl="@[EnableTapToNextControl:Bool:true]"/> | ||
</StackPanel> | ||
</Grid> | ||
</Page> |
45 changes: 45 additions & 0 deletions
45
...lkit.Uwp.SampleApp/SamplePages/SurfaceDialTextboxHelper/SurfaceDialTextboxHelperPage.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<Page | ||
x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.SurfaceDialTextboxHelperPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages" | ||
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d"> | ||
|
||
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" x:Name="Root"> | ||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
|
||
<TextBox HorizontalAlignment="Left" VerticalAlignment="Top" Text="0" Width="106" | ||
controls:SurfaceDialTextboxHelper.StepValue="{Binding DataContext.StepValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.ForceMenuItem="{Binding DataContext.ForceMenuItem.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.EnableHapticFeedback="{Binding DataContext.EnableHapticFeedback.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.EnableMinMaxValue="{Binding DataContext.EnableMinMaxValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.MinValue="{Binding DataContext.MinValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.MaxValue="{Binding DataContext.MaxValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.Icon="{Binding DataContext.Icon.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.EnableTapToNextControl="{Binding DataContext.EnableTapToNextControl.Value, ElementName=Root, Mode=OneWay}"/> | ||
|
||
<TextBox HorizontalAlignment="Left" VerticalAlignment="Top" Text="0" Width="106" | ||
controls:SurfaceDialTextboxHelper.StepValue="{Binding DataContext.StepValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.ForceMenuItem="{Binding DataContext.ForceMenuItem.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.EnableHapticFeedback="{Binding DataContext.EnableHapticFeedback.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.EnableMinMaxValue="{Binding DataContext.EnableMinMaxValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.MinValue="{Binding DataContext.MinValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.MaxValue="{Binding DataContext.MaxValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.Icon="{Binding DataContext.Icon.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.EnableTapToNextControl="{Binding DataContext.EnableTapToNextControl.Value, ElementName=Root, Mode=OneWay}"/> | ||
|
||
<TextBox HorizontalAlignment="Left" VerticalAlignment="Top" Text="0" Width="106" | ||
controls:SurfaceDialTextboxHelper.StepValue="{Binding DataContext.StepValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.ForceMenuItem="{Binding DataContext.ForceMenuItem.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.EnableHapticFeedback="{Binding DataContext.EnableHapticFeedback.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.EnableMinMaxValue="{Binding DataContext.EnableMinMaxValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.MinValue="{Binding DataContext.MinValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.MaxValue="{Binding DataContext.MaxValue.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.Icon="{Binding DataContext.Icon.Value, ElementName=Root, Mode=OneWay}" | ||
controls:SurfaceDialTextboxHelper.EnableTapToNextControl="{Binding DataContext.EnableTapToNextControl.Value, ElementName=Root, Mode=OneWay}"/> | ||
</StackPanel> | ||
</Grid> | ||
</Page> |
41 changes: 41 additions & 0 deletions
41
...t.Uwp.SampleApp/SamplePages/SurfaceDialTextboxHelper/SurfaceDialTextboxHelperPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// ****************************************************************** | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// This code is licensed under the MIT License (MIT). | ||
// THE CODE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, | ||
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH | ||
// THE CODE OR THE USE OR OTHER DEALINGS IN THE CODE. | ||
// ****************************************************************** | ||
|
||
using Microsoft.Toolkit.Uwp.SampleApp.Models; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages | ||
{ | ||
/// <summary> | ||
/// An empty page that can be used on its own or navigated to within a Frame. | ||
/// </summary> | ||
public sealed partial class SurfaceDialTextboxHelperPage : Page | ||
{ | ||
public SurfaceDialTextboxHelperPage() | ||
{ | ||
this.InitializeComponent(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove usages of "this." |
||
} | ||
|
||
protected override void OnNavigatedTo(NavigationEventArgs e) | ||
{ | ||
base.OnNavigatedTo(e); | ||
|
||
var propertyDesc = e.Parameter as PropertyDescriptor; | ||
|
||
if (propertyDesc != null) | ||
{ | ||
DataContext = propertyDesc.Expando; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please run xaml styler over this file please (https://visualstudiogallery.msdn.microsoft.com/3de2a3c6-def5-42c4-924d-cc13a29ff5b7)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Means you'll need to update the xaml in the bind file too.