From bc141e152abb8c4513c80c52b6bf3d2c16827b0b Mon Sep 17 00:00:00 2001 From: Alexandre Zollinger Chohfi Date: Wed, 16 Sep 2020 17:29:14 -0700 Subject: [PATCH] Updated min and target SDKs and removed redundant conditional execution paths. Removed any WinJS reference. --- Directory.Build.props | 4 +- Directory.Build.targets | 5 +- GazeInputTest/GazeInputTest.csproj | 2 +- .../Microsoft.Toolkit.Services.csproj | 8 +- .../BluetoothLEHelper/BluetoothLEHelper.cs | 12 - .../Microsoft.Toolkit.Uwp.Connectivity.csproj | 2 +- ...icrosoft.Toolkit.Uwp.DeveloperTools.csproj | 2 +- ....Toolkit.UWP.Input.GazeInteraction.vcxproj | 2 +- ...oolkit.Uwp.Notifications.JavaScript.csproj | 24 -- ...olkit.Uwp.Notifications.JavaScript.targets | 11 - ...Microsoft.Toolkit.Uwp.Notifications.csproj | 4 +- Microsoft.Toolkit.Uwp.Notifications/readme.md | 14 +- .../Microsoft.Toolkit.Uwp.SampleApp.csproj | 7 +- .../Models/Sample.cs | 15 - .../Pages/SampleController.xaml | 6 - .../Pages/SampleController.xaml.cs | 16 -- .../BluetoothLEHelperCode.bind | 26 +- .../BluetoothLEHelperPage.xaml | 147 +++++----- .../BluetoothLEHelperPage.xaml.cs | 18 -- .../DropShadowPanel/DropShadowPanelPage.xaml | 17 +- .../DropShadowPanelPage.xaml.cs | 13 - .../SamplePages/ImageEx/ImageExPage.xaml.cs | 25 +- .../SamplePages/Light/LightBehaviorPage.xaml | 8 - .../Light/LightBehaviorPage.xaml.cs | 5 - .../LiveTile/LiveTileCodeJavaScript.bind | 138 --------- .../SamplePages/TextToolbar/TextToolbar.bind | 3 +- .../Toast/ToastCodeJavaScript.bind | 53 ---- .../ViewExtensions/ViewExtensionsCode.bind | 6 +- .../ViewExtensions/ViewExtensionsPage.xaml | 4 - .../ViewExtensions/ViewExtensionsPage.xaml.cs | 3 - .../WeatherLiveTileAndToastCode.bind | 3 +- ...WeatherLiveTileAndToastCodeJavaScript.bind | 271 ------------------ .../WeatherLiveTileAndToastPage.xaml.cs | 6 +- .../SamplePages/samples.json | 5 +- .../Shell.SamplePicker.cs | 7 +- Microsoft.Toolkit.Uwp.SampleApp/Shell.xaml | 1 - .../Styles/ThemeInjector.cs | 70 +++-- Microsoft.Toolkit.Uwp.SampleApp/readme.md | 2 +- ...Toolkit.Uwp.Samples.BackgroundTasks.csproj | 4 +- .../ApiInformationHelper.cs | 13 - .../Behaviors/Blur.cs | 13 +- .../Behaviors/FadeHeaderBehavior.cs | 8 - .../Behaviors/Light.cs | 18 +- .../Behaviors/QuickReturnHeaderBehavior.cs | 8 - .../Behaviors/Saturation.cs | 15 +- .../Behaviors/StickyHeaderBehavior.cs | 8 - .../Animations/TranslationAnimation.cs | 13 - .../Animations/TypedAnimationBase.cs | 6 +- .../ConnectedAnimations/Connected.cs | 22 +- .../ConnectedAnimationHelper.cs | 15 +- .../Effects/AnimationEffect.cs | 13 - .../Effects/Blur.cs | 10 - .../Effects/Saturation.cs | 10 - .../Extensions/AnimationExtensions.Blur.cs | 14 - .../Extensions/AnimationExtensions.Light.cs | 32 --- .../Implicit.cs | 24 +- ...Microsoft.Toolkit.Uwp.UI.Animations.csproj | 2 +- .../ReorderGridAnimation.cs | 13 +- ...kit.Uwp.UI.Controls.DataGrid.Design.csproj | 8 +- .../DataGrid/DataGrid.cs | 2 +- .../DataGrid/DataGrid.xaml | 14 +- ...ft.Toolkit.Uwp.UI.Controls.DataGrid.csproj | 2 +- .../Utilities/TypeHelper.cs | 15 - ...soft.Toolkit.Uwp.UI.Controls.Design.csproj | 8 +- ...soft.Toolkit.Uwp.UI.Controls.Layout.csproj | 4 +- ...kit.Uwp.UI.Controls.Markdown.Design.csproj | 8 +- .../MarkdownTextBlock.Methods.cs | 7 +- .../MarkdownTextBlock.Properties.cs | 5 - ...ft.Toolkit.Uwp.UI.Controls.Markdown.csproj | 2 +- .../Render/MarkdownRenderer.Inlines.cs | 25 +- .../Render/MarkdownRenderer.Properties.cs | 6 - .../CameraPreview/CameraPreview.cs | 11 +- .../DropShadowPanel.Properties.cs | 25 +- .../DropShadowPanel/DropShadowPanel.cs | 16 +- .../ImageEx/ImageExBase.Members.cs | 6 - .../ImageEx/ImageExBase.Source.cs | 15 +- .../ImageEx/ImageExBase.cs | 20 +- .../InAppNotification/InAppNotification.xaml | 11 +- .../Menu/Menu.xaml | 7 +- .../Menu/MenuItem.cs | 15 +- .../Microsoft.Toolkit.Uwp.UI.Controls.csproj | 2 +- .../TileControl/TileControl.cs | 2 - .../TokenizingTextBoxItem.AutoSuggestBox.xaml | 2 +- .../UniformGrid/UniformGrid.cs | 13 +- .../Microsoft.Toolkit.Uwp.UI.Media.csproj | 2 +- .../StatusBar/StatusBarExtensions.cs | 165 ----------- .../SurfaceDialTextbox/SurfaceDialTextbox.cs | 6 - .../Extensions/TitleBar/TitleBarExtensions.cs | 7 +- .../Helpers/DesignTimeHelpers.cs | 20 +- .../Microsoft.Toolkit.Uwp.UI.csproj | 6 +- .../Helpers/CameraHelper/CameraHelper.cs | 5 +- .../Helpers/CameraHelper/FrameEventArgs.cs | 3 - .../RemoteDeviceHelper/RemoteDeviceHelper.cs | 15 +- .../Microsoft.Toolkit.Uwp.csproj | 2 +- .../UnitTests.HighPerformance.UWP.csproj | 4 +- .../UnitTests.Notifications.UWP.csproj | 4 +- .../UnitTests.Notifications.WinRT.csproj | 4 +- UnitTests/UnitTests.UWP/UnitTests.UWP.csproj | 4 +- .../Package.appxmanifest | 2 +- .../UnitTests.XamlIslands.Package.wapproj | 2 +- .../UnitTests.XamlIslands.UWPApp.csproj | 2 +- .../UnitTests.XamlIslands.csproj | 4 +- UnitTests/UnitTests.XamlIslands/app.manifest | 2 +- Windows Community Toolkit.sln | 30 -- azure-pipelines.yml | 2 +- readme.md | 6 +- 106 files changed, 258 insertions(+), 1516 deletions(-) delete mode 100644 Microsoft.Toolkit.Uwp.Notifications.JavaScript/Microsoft.Toolkit.Uwp.Notifications.JavaScript.csproj delete mode 100644 Microsoft.Toolkit.Uwp.Notifications.JavaScript/Microsoft.Toolkit.Uwp.Notifications.JavaScript.targets delete mode 100644 Microsoft.Toolkit.Uwp.SampleApp/SamplePages/LiveTile/LiveTileCodeJavaScript.bind delete mode 100644 Microsoft.Toolkit.Uwp.SampleApp/SamplePages/Toast/ToastCodeJavaScript.bind delete mode 100644 Microsoft.Toolkit.Uwp.SampleApp/SamplePages/WeatherLiveTileAndToast/WeatherLiveTileAndToastCodeJavaScript.bind delete mode 100644 Microsoft.Toolkit.Uwp.UI/Extensions/StatusBar/StatusBarExtensions.cs diff --git a/Directory.Build.props b/Directory.Build.props index fe9cbb14b56..d43a2ceffc3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -14,8 +14,8 @@ $(MSBuildProjectName.Contains('Test')) $(MSBuildProjectName.Contains('Uwp')) $(MSBuildProjectName.Contains('Sample')) - 18362 - 16299 + 19041 + 17763 $(MSBuildThisFileDirectory)bin\nupkg diff --git a/Directory.Build.targets b/Directory.Build.targets index 9898f028145..111afac2e44 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,6 +1,6 @@ - + 10.0.$(DefaultTargetPlatformVersion).0 @@ -15,9 +15,6 @@ Windows Desktop Extensions for the UWP - - Windows Mobile Extensions for the UWP - diff --git a/GazeInputTest/GazeInputTest.csproj b/GazeInputTest/GazeInputTest.csproj index 7735a9bb1a5..9c699a3f5bf 100644 --- a/GazeInputTest/GazeInputTest.csproj +++ b/GazeInputTest/GazeInputTest.csproj @@ -11,7 +11,7 @@ GazeInputTest en-US UAP - 10.0.18362.0 + 10.0.19041.0 10.0.17134.0 14 512 diff --git a/Microsoft.Toolkit.Services/Microsoft.Toolkit.Services.csproj b/Microsoft.Toolkit.Services/Microsoft.Toolkit.Services.csproj index 446db56c7a3..e1f1a13d6fb 100644 --- a/Microsoft.Toolkit.Services/Microsoft.Toolkit.Services.csproj +++ b/Microsoft.Toolkit.Services/Microsoft.Toolkit.Services.csproj @@ -1,7 +1,7 @@  - uap10.0.16299;netstandard2.0;NET462 + uap10.0.17763;netstandard2.0;NET462 Windows Community Toolkit .NET Standard Services This .NET standard library enables access to different data sources such as Microsoft Graph, OneDrive, Twitter, Microsoft Translator, and LinkedIn. It is part of the Windows Community Toolkit. @@ -12,7 +12,7 @@ false - + $(DefineConstants);WINRT @@ -31,7 +31,7 @@ - + @@ -47,7 +47,7 @@ - + diff --git a/Microsoft.Toolkit.Uwp.Connectivity/BluetoothLEHelper/BluetoothLEHelper.cs b/Microsoft.Toolkit.Uwp.Connectivity/BluetoothLEHelper/BluetoothLEHelper.cs index 97e20f13aec..c83718ec2ac 100644 --- a/Microsoft.Toolkit.Uwp.Connectivity/BluetoothLEHelper/BluetoothLEHelper.cs +++ b/Microsoft.Toolkit.Uwp.Connectivity/BluetoothLEHelper/BluetoothLEHelper.cs @@ -12,7 +12,6 @@ using Windows.Devices.Bluetooth; using Windows.Devices.Bluetooth.Advertisement; using Windows.Devices.Enumeration; -using Windows.Foundation.Metadata; using Windows.System; namespace Microsoft.Toolkit.Uwp.Connectivity @@ -27,11 +26,6 @@ public class BluetoothLEHelper /// private const string BluetoothLeDeviceWatcherAqs = "(System.Devices.Aep.ProtocolId:=\"{bb7bb05e-5972-42b5-94fc-76eaa7084d49}\")"; - /// - /// Gets a value indicating whether the Bluetooth LE Helper is supported - /// - private static bool? _isBluetoothLESupported = null; - /// /// We need to cache all DeviceInformation objects we get as they may /// get updated in the future. The update may make them eligible to be put on @@ -82,12 +76,6 @@ private BluetoothLEHelper(DispatcherQueue dispatcherQueue = null) /// public static BluetoothLEHelper Context { get; } = new BluetoothLEHelper(); - /// - /// Gets a value indicating whether the Bluetooth LE Helper is supported. - /// - public static bool IsBluetoothLESupported => (bool)(_isBluetoothLESupported ?? - (_isBluetoothLESupported = ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 4))); - /// /// Gets the list of available bluetooth devices /// diff --git a/Microsoft.Toolkit.Uwp.Connectivity/Microsoft.Toolkit.Uwp.Connectivity.csproj b/Microsoft.Toolkit.Uwp.Connectivity/Microsoft.Toolkit.Uwp.Connectivity.csproj index e1a7784b70c..f1b211c251d 100644 --- a/Microsoft.Toolkit.Uwp.Connectivity/Microsoft.Toolkit.Uwp.Connectivity.csproj +++ b/Microsoft.Toolkit.Uwp.Connectivity/Microsoft.Toolkit.Uwp.Connectivity.csproj @@ -1,7 +1,7 @@  - uap10.0.16299 + uap10.0.17763 Windows Community Toolkit Devices This library enables easier consumption of connectivity Devices/Peripherals and handle its connection to Windows devices. It contains BluetoothLE and Network connectivity helpers. UWP Toolkit Windows Devices Bluetooth BluetoothLE BLE Networking diff --git a/Microsoft.Toolkit.Uwp.DeveloperTools/Microsoft.Toolkit.Uwp.DeveloperTools.csproj b/Microsoft.Toolkit.Uwp.DeveloperTools/Microsoft.Toolkit.Uwp.DeveloperTools.csproj index ff464b80dc1..930d09f5abf 100644 --- a/Microsoft.Toolkit.Uwp.DeveloperTools/Microsoft.Toolkit.Uwp.DeveloperTools.csproj +++ b/Microsoft.Toolkit.Uwp.DeveloperTools/Microsoft.Toolkit.Uwp.DeveloperTools.csproj @@ -1,7 +1,7 @@  - uap10.0.16299 + uap10.0.17763 Windows Community Toolkit Developer Tools This library provides XAML user controls and services to help developers build their app. It is part of the Windows Community Toolkit. diff --git a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/Microsoft.Toolkit.UWP.Input.GazeInteraction.vcxproj b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/Microsoft.Toolkit.UWP.Input.GazeInteraction.vcxproj index 74113867050..0c2b42caf47 100644 --- a/Microsoft.Toolkit.Uwp.Input.GazeInteraction/Microsoft.Toolkit.UWP.Input.GazeInteraction.vcxproj +++ b/Microsoft.Toolkit.Uwp.Input.GazeInteraction/Microsoft.Toolkit.UWP.Input.GazeInteraction.vcxproj @@ -42,7 +42,7 @@ 14.0 true Windows Store - 10.0.17763.0 + 10.0.19041.0 10.0.17134.0 10.0 Microsoft.Toolkit.Uwp.Input.GazeInteraction diff --git a/Microsoft.Toolkit.Uwp.Notifications.JavaScript/Microsoft.Toolkit.Uwp.Notifications.JavaScript.csproj b/Microsoft.Toolkit.Uwp.Notifications.JavaScript/Microsoft.Toolkit.Uwp.Notifications.JavaScript.csproj deleted file mode 100644 index fcfe464a666..00000000000 --- a/Microsoft.Toolkit.Uwp.Notifications.JavaScript/Microsoft.Toolkit.Uwp.Notifications.JavaScript.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - uap10.0 - false - Windows Community Toolkit Notifications for JavaScript - - This project is used for packaging the WinMD to work for WinJS projects. - - Generate tile, toast, and badge notifications for Windows 10 via code, with the help of IntelliSense, instead of directly using XML. - Supports adaptive tiles and adaptive/interactive toasts for Windows 10. It is part of the Windows Community Toolkit. - Supports C# and C++ UWP project types (see Microsoft.Toolkit.Uwp.Notifications). - Also works with C# portable class libraries and non-UWP C# projects like server projects. - - notifications win10 windows-10 tile tiles toast toasts badge xml uwp javascript - true - - - - - - - - diff --git a/Microsoft.Toolkit.Uwp.Notifications.JavaScript/Microsoft.Toolkit.Uwp.Notifications.JavaScript.targets b/Microsoft.Toolkit.Uwp.Notifications.JavaScript/Microsoft.Toolkit.Uwp.Notifications.JavaScript.targets deleted file mode 100644 index 8a78f301f95..00000000000 --- a/Microsoft.Toolkit.Uwp.Notifications.JavaScript/Microsoft.Toolkit.Uwp.Notifications.JavaScript.targets +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - $(MSBuildThisFileDirectory)..\..\lib\Windows\Microsoft.Toolkit.Uwp.Notifications.winmd - true - - - - diff --git a/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj b/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj index 1c08ba0f600..5d5f1a63808 100644 --- a/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj +++ b/Microsoft.Toolkit.Uwp.Notifications/Microsoft.Toolkit.Uwp.Notifications.csproj @@ -7,7 +7,7 @@ Generate tile, toast, and badge notifications for Windows 10 via code, with the help of IntelliSense. Adds Support for adaptive tiles and adaptive/interactive toasts for Windows 10. It is part of the Windows Community Toolkit. - Supports C# and C++ UWP project types (see Microsoft.Toolkit.Uwp.Notifications.JavaScript for the JS version). + Supports C# and C++ UWP project types. Also works with C# portable class libraries and non-UWP C# projects like server projects. This project contains outputs for netstandard1.4, uap10.0 and native for WinRT. @@ -65,7 +65,7 @@ native UAP,Version=v10.0 uap10.0 - 10.0.18362.0 + 10.0.19041.0 10.0.10240.0 $(DefineConstants);NETFX_CORE;WINDOWS_UWP;WINRT false diff --git a/Microsoft.Toolkit.Uwp.Notifications/readme.md b/Microsoft.Toolkit.Uwp.Notifications/readme.md index c7ee380f522..bfc7d22d1ca 100644 --- a/Microsoft.Toolkit.Uwp.Notifications/readme.md +++ b/Microsoft.Toolkit.Uwp.Notifications/readme.md @@ -6,22 +6,16 @@ Any code for generating notifications should be written in the Microsoft.Toolkit If there's UWP-specific code, use the appropriate `#ifdef`, `WINDOWS_UWP` or `WINRT`. ## What are all the projects for? -There's two notification projects... - - Microsoft.Toolkit.Uwp.Notifications - - Microsoft.Toolkit.Uwp.Notifications.JavaScript +All the code is contained on the Microsoft.Toolkit.Uwp.Notifications project. -The first project is where all the code is contained. +It outputs `netstandard1.4`, `uap10.0`, `native` for WinRT, and netcoreapp for .Net Core projects. The UWP library is only for C#, while the WinRT library is a Windows Runtime Component for C++. -The JavaScript project is just for packaging the `WinMD` to work for WinJS projects. - -The first project contains outputs for `netstandard1.4`, `uap10.0` and a `native` for WinRT. The UWP library is only for C#, while the WinRT library is a Windows Runtime Component for JavaScript and C++. - - -| C# | JavaScript/C++ | +| C# | C++ | | ---------------- | ------------------- | | NET Standard 1.4 | UWP WinRT Component | | UWP C# DLL | | +| .Net Core DLL | | diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj index 2933c1f2137..07dde256e28 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj +++ b/Microsoft.Toolkit.Uwp.SampleApp/Microsoft.Toolkit.Uwp.SampleApp.csproj @@ -11,8 +11,8 @@ Microsoft.Toolkit.Uwp.SampleApp en-US UAP - 10.0.18362.0 - 10.0.17134.0 + 10.0.19041.0 + 10.0.17763.0 14 512 {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -412,10 +412,7 @@ - - - diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs b/Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs index d3cffd7038f..30a4f70d56c 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs +++ b/Microsoft.Toolkit.Uwp.SampleApp/Models/Sample.cs @@ -141,8 +141,6 @@ public string CodeUrl public string CodeFile { get; set; } - public string JavaScriptCodeFile { get; set; } - public string XamlCodeFile { get; set; } public bool DisableXamlEditorRendering { get; set; } @@ -163,8 +161,6 @@ public string CodeUrl public bool HasCSharpCode => !string.IsNullOrEmpty(CodeFile); - public bool HasJavaScriptCode => !string.IsNullOrEmpty(JavaScriptCodeFile); - public bool HasDocumentation => !string.IsNullOrEmpty(DocumentationUrl); public bool IsSupported @@ -191,17 +187,6 @@ public async Task GetCSharpSourceAsync() } } - public async Task GetJavaScriptSourceAsync() - { - using (var codeStream = await StreamHelper.GetPackagedFileStreamAsync(JavaScriptCodeFile.StartsWith('/') ? JavaScriptCodeFile : $"SamplePages/{Name}/{JavaScriptCodeFile}")) - { - using (var streamReader = new StreamReader(codeStream.AsStream())) - { - return await streamReader.ReadToEndAsync(); - } - } - } - #pragma warning disable SA1009 // Doesn't like ValueTuples. public async Task<(string contents, string path)> GetDocumentationAsync() #pragma warning restore SA1009 // Doesn't like ValueTuples. diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml b/Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml index 99d1f479794..299c4787542 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml +++ b/Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml @@ -195,12 +195,6 @@ IsFocusEngagementEnabled="False" /> - - - - diff --git a/Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml.cs b/Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml.cs index 289912e9b7d..29e0f2540d0 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml.cs +++ b/Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml.cs @@ -271,14 +271,6 @@ protected override async void OnNavigatedTo(NavigationEventArgs e) InfoAreaPivot.Items.Add(CSharpPivotItem); } - if (CurrentSample.HasJavaScriptCode) - { - var code = await CurrentSample.GetJavaScriptSourceAsync(); - - JavaScriptCodeRenderer.SetCode(code, "js"); - InfoAreaPivot.Items.Add(JavaScriptPivotItem); - } - if (CurrentSample.HasDocumentation) { #pragma warning disable SA1008 // Opening parenthesis must be spaced correctly @@ -421,14 +413,6 @@ private async void InfoAreaPivot_OnSelectionChanged(object sender, SelectionChan return; } - - if (CurrentSample.HasJavaScriptCode && InfoAreaPivot.SelectedItem == JavaScriptPivotItem) - { - var code = await CurrentSample.GetJavaScriptSourceAsync(); - JavaScriptCodeRenderer.SetCode(code, "js"); - - return; - } } private async void XamlCodeEditor_UpdateRequested(object sender, EventArgs e) diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BluetoothLEHelper/BluetoothLEHelperCode.bind b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BluetoothLEHelper/BluetoothLEHelperCode.bind index 37824232426..4cab3096b26 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BluetoothLEHelper/BluetoothLEHelperCode.bind +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BluetoothLEHelper/BluetoothLEHelperCode.bind @@ -1,22 +1,18 @@ // Get a local copy of the context for easier reading BluetoothLEHelper bluetoothLEHelper = BluetoothLEHelper.Context; -// check if BluetoothLE APIs are available -if (BluetoothLEHelper.IsBluetoothLESupported) -{ - // Start the Enumeration - bluetoothLEHelper.StartEnumeration(); +// Start the Enumeration +bluetoothLEHelper.StartEnumeration(); - // At this point the user needs to select a device they want to connect to. This can be done by - // creating a ListView and binding the bluetoothLEHelper collection to it. Once a device is found, - // the Connect() method can be called to connect to the device and start interacting with its services +// At this point the user needs to select a device they want to connect to. This can be done by +// creating a ListView and binding the bluetoothLEHelper collection to it. Once a device is found, +// the Connect() method can be called to connect to the device and start interacting with its services - // Connect to a device if your choice - ObservableBluetoothLEDevice device = bluetoothLEHelper.BluetoothLeDevices[]; - await device.ConnectAsync(); +// Connect to a device if your choice +ObservableBluetoothLEDevice device = bluetoothLEHelper.BluetoothLeDevices[]; +await device.ConnectAsync(); - // At this point the device is connected and the Services property is populated. +// At this point the device is connected and the Services property is populated. - // See all the services - var services = device.Services; -} +// See all the services +var services = device.Services; diff --git a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BluetoothLEHelper/BluetoothLEHelperPage.xaml b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BluetoothLEHelper/BluetoothLEHelperPage.xaml index 4337bbf0c83..c2e0aedcf42 100644 --- a/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BluetoothLEHelper/BluetoothLEHelperPage.xaml +++ b/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/BluetoothLEHelper/BluetoothLEHelperPage.xaml @@ -6,89 +6,76 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> - - -