From 2d38b5dad1545d4a1ac844181eb651a222d224bf Mon Sep 17 00:00:00 2001 From: Raymond Chen Date: Wed, 18 Nov 2015 16:16:48 -0800 Subject: [PATCH] Windows 10 RTM Release - November 2015 Update 1 --- README.md | 10 +- Samples/Accelerometer/README.md | 2 +- Samples/ActivitySensor/README.md | 2 +- Samples/AdaptiveStreaming/README.md | 2 +- Samples/AdvancedCasting/README.md | 2 +- Samples/AllJoyn/ConsumerExperiences/README.md | 2 +- Samples/AllJoyn/ProducerExperiences/README.md | 2 +- Samples/Altimeter/README.md | 2 +- Samples/AnimationLibrary/README.md | 2 +- .../AnimationLibrary/js/html/samplePage.html | 1 - Samples/AnimationLibrary/js/js/samplePage.js | 13 +- Samples/AnimationMetrics/README.md | 2 +- Samples/AppServices/README.md | 2 +- Samples/ApplicationData/README.md | 2 +- Samples/ApplicationResources/README.md | 2 +- Samples/Appointments/README.md | 2 +- Samples/AssociationLaunching/README.md | 2 +- Samples/AudioCategory/README.md | 2 +- Samples/AudioCreation/README.md | 2 +- Samples/BackButton/README.md | 2 +- Samples/BackgroundAudio/README.md | 2 +- .../cs/BackgroundAudio/Scenario1.xaml.cs | 57 ++-- Samples/BackgroundSensors/README.md | 2 +- Samples/BackgroundTask/README.md | 2 +- Samples/BackgroundTransfer/README.md | 2 +- Samples/BarcodeScanner/README.md | 2 +- Samples/Barometer/README.md | 2 +- Samples/BasicFaceDetection/README.md | 2 +- Samples/BasicFaceTracking/README.md | 2 +- Samples/BasicInput/README.md | 2 +- Samples/BasicMediaCasting/README.md | 2 +- Samples/BluetoothAdvertisement/README.md | 2 +- Samples/BluetoothRfcommChat/README.md | 2 +- Samples/Calendar/README.md | 2 +- Samples/CameraFaceDetection/README.md | 2 +- Samples/CameraGetPreviewFrame/README.md | 2 +- Samples/CameraHdr/README.md | 2 +- Samples/CameraManualControls/README.md | 2 +- .../CameraManualControls/cs/MainPage.xaml.cs | 54 ++-- Samples/CameraProfile/README.md | 2 +- Samples/CameraResolution/README.md | 2 +- .../cpp/StreamResolutionHelper.cpp | 5 +- .../CameraResolution/cs/StreamResolution.cs | 5 +- .../js/js/StreamResolutionHelper.js | 4 +- Samples/CameraStarterKit/README.md | 2 +- Samples/CameraVideoStabilization/README.md | 2 +- Samples/CashDrawer/README.md | 2 +- Samples/Clipboard/README.md | 2 +- Samples/CommunicationBlockAndFilter/README.md | 2 +- Samples/Compass/README.md | 2 +- Samples/ComplexInk/README.md | 2 +- Samples/CompositionVisual/README.md | 2 +- Samples/Compression/README.md | 2 +- Samples/ContactCardIntegration/README.md | 1 + Samples/ContactCards/README.md | 2 +- Samples/ContactPicker/README.md | 2 +- Samples/ContentIndexer/README.md | 2 +- Samples/ContextMenu/README.md | 2 +- Samples/CortanaVoiceCommand/README.md | 2 +- .../cpp/AdventureWorks/App.xaml.cpp | 40 +++ .../cpp/AdventureWorks/App.xaml.h | 3 + .../cpp/AdventureWorks/View/TripDetails.xaml | 18 +- .../cpp/AdventureWorks/View/TripListView.xaml | 13 +- .../AdventureWorks/View/TripListView.xaml.cpp | 8 +- .../AdventureWorks/View/TripListView.xaml.h | 1 + .../ViewModel/TripViewModel.cpp | 11 - .../AdventureWorks/ViewModel/TripViewModel.h | 6 - .../AdventureWorks/Common/NavigationHelper.cs | 69 ++--- .../cs/AdventureWorks/View/TripDetails.xaml | 18 +- .../cs/AdventureWorks/View/TripListView.xaml | 17 +- .../js/AdventureWorks/html/tripDetails.html | 1 - .../js/AdventureWorks/js/default.js | 33 ++- Samples/CredentialPicker/README.md | 2 +- Samples/CustomHidDeviceAccess/README.md | 2 +- Samples/CustomSensors/README.md | 2 +- Samples/CustomSerialDeviceAccess/README.md | 2 +- Samples/CustomUsbDeviceAccess/README.md | 2 +- Samples/D2DCustomEffects/README.md | 2 +- Samples/D2DGradientMesh/README.md | 2 +- Samples/D2DPhotoAdjustment/README.md | 2 +- Samples/DWriteLineSpacingModes/README.md | 2 +- Samples/DWriteTextLayoutCloudFont/README.md | 2 +- Samples/DataReaderWriter/README.md | 2 +- Samples/DatagramSocket/README.md | 2 +- Samples/DateTimeFormatting/README.md | 4 +- Samples/DeviceEnumeration/README.md | 2 +- Samples/DeviceLockdownAzureLogin/README.md | 122 +++++++++ .../cs/DeviceLockdownAzureLogin.csproj | 177 +++++++++++++ .../cs/DeviceLockdownAzureLogin.sln | 40 +++ .../cs/Package.appxmanifest | 51 ++++ .../cs/SampleConfiguration.cs | 33 +++ .../cs/Scenario1_SignIn.xaml | 41 +++ .../cs/Scenario1_SignIn.xaml.cs | 246 ++++++++++++++++++ .../DeviceLockdownAzureLogin/cs/project.json | 17 ++ Samples/DisablingScreenCapture/README.md | 2 +- Samples/DisplayOrientation/README.md | 2 +- Samples/DpiScaling/README.md | 2 +- Samples/EasProtocol/README.md | 2 +- Samples/EfficientAnimations/README.md | 2 +- Samples/EnterpriseDataProtection/README.md | 2 +- Samples/FeedReader/README.md | 2 +- Samples/FeedReader/js/css/default.css | 5 - Samples/FeedReader/js/default.html | 3 +- Samples/FeedReader/js/js/navigator.js | 24 +- .../FeedReader/js/pages/article/article.css | 5 - .../FeedReader/js/pages/article/article.html | 1 - Samples/FeedReader/js/pages/feed/feed.html | 1 - .../js/pages/subscriptions/subscriptions.html | 1 - Samples/FileAccess/README.md | 2 +- Samples/FilePicker/README.md | 2 +- Samples/FilePickerContracts/README.md | 2 +- Samples/FileSearch/README.md | 2 +- Samples/FileThumbnails/README.md | 2 +- Samples/FolderEnumeration/README.md | 2 +- Samples/FullScreenMode/README.md | 2 +- Samples/Geolocation/README.md | 2 +- Samples/Geotag/README.md | 2 +- Samples/GlobalizationPreferences/README.md | 2 +- Samples/Gyrometer/README.md | 2 +- Samples/HomeGroup/README.md | 2 +- Samples/HtmlFormValidation/README.md | 2 +- Samples/HttpClient/README.md | 2 +- Samples/Inclinometer/README.md | 2 +- Samples/IndexedDB/README.md | 2 +- Samples/Ink/README.md | 2 +- Samples/IoT-GPIO/README.md | 2 +- Samples/IoT-I2C/README.md | 2 +- Samples/IoT-SPI/README.md | 2 +- Samples/JapanesePhoneticAnalysis/README.md | 2 +- Samples/Json/README.md | 2 +- Samples/KeyCredentialManager/README.md | 2 +- Samples/LampDevice/README.md | 2 +- Samples/LanguageFont/README.md | 2 +- Samples/LibraryManagement/README.md | 2 +- Samples/LightSensor/README.md | 2 +- Samples/LinguisticServices/README.md | 2 +- Samples/LiveDash/README.md | 2 +- Samples/LockScreenApps/README.md | 2 +- Samples/Logging/README.md | 2 +- Samples/LowLatencyInput/README.md | 2 +- Samples/MIDI/README.md | 2 +- Samples/MagneticStripeReader/README.md | 2 +- Samples/MapControl/README.md | 2 +- Samples/MediaEditing/README.md | 2 +- Samples/MediaImport/README.md | 2 +- Samples/MediaTranscoding/README.md | 2 +- Samples/MessageDialog/README.md | 2 +- Samples/MobileBroadband/README.md | 2 +- Samples/MsBlobBuilder/README.md | 2 +- Samples/MultipleViews/README.md | 2 +- Samples/MultipleViews/cs/Scenario3.xaml | 5 +- Samples/MultipleViews/cs/Scenario3.xaml.cs | 20 +- .../cs/SecondaryViewPage.xaml.cs | 135 +++++----- Samples/Nfc/README.md | 2 +- Samples/NfcProvisioner/README.md | 2 +- Samples/Notifications/README.md | 2 +- Samples/NumberFormatting/README.md | 2 +- Samples/OCR/README.md | 2 +- Samples/OrientationSensor/README.md | 2 +- Samples/Package/README.md | 2 +- Samples/PackagedContent/README.md | 2 +- Samples/PasswordVault/README.md | 2 +- Samples/PdfDocument/README.md | 59 +++++ Samples/PdfDocument/cpp/Package.appxmanifest | 49 ++++ Samples/PdfDocument/cpp/PdfDocument.sln | 40 +++ Samples/PdfDocument/cpp/PdfDocument.vcxproj | 215 +++++++++++++++ .../cpp/PdfDocument.vcxproj.filters | 65 +++++ .../PdfDocument/cpp/SampleConfiguration.cpp | 21 ++ Samples/PdfDocument/cpp/SampleConfiguration.h | 47 ++++ .../PdfDocument/cpp/Scenario1_Render.xaml.cpp | 166 ++++++++++++ .../PdfDocument/cpp/Scenario1_Render.xaml.h | 32 +++ Samples/PdfDocument/cpp/pch.cpp | 5 + Samples/PdfDocument/cpp/pch.h | 10 + Samples/PdfDocument/cs/Package.appxmanifest | 50 ++++ Samples/PdfDocument/cs/PdfDocument.csproj | 173 ++++++++++++ Samples/PdfDocument/cs/PdfDocument.sln | 40 +++ Samples/PdfDocument/cs/SampleConfiguration.cs | 33 +++ .../PdfDocument/cs/Scenario1_Render.xaml.cs | 145 +++++++++++ Samples/PdfDocument/cs/project.json | 16 ++ .../Microsoft.WinJS.4.0/css/placeholder.txt | 0 .../js/Microsoft.WinJS.4.0/fonts/placeholder | 0 .../js/en-US/placeholder.txt | 0 Samples/PdfDocument/js/Package.appxmanifest | 48 ++++ Samples/PdfDocument/js/PdfDocument.jsproj | 139 ++++++++++ Samples/PdfDocument/js/PdfDocument.sln | 48 ++++ Samples/PdfDocument/js/css/placeholder.txt | 0 .../PdfDocument/js/html/scenario1-render.html | 47 ++++ Samples/PdfDocument/js/images/placeholder.txt | 0 .../PdfDocument/js/js/sample-configuration.js | 16 ++ Samples/PdfDocument/js/js/scenario1-render.js | 136 ++++++++++ .../js/sample-utils/placeholder.txt | 0 .../PdfDocument/shared/Scenario1_Render.xaml | 54 ++++ Samples/Pedometer/README.md | 2 +- Samples/Personalization/README.md | 2 +- Samples/PhoneCall/README.md | 2 +- Samples/PhoneCall/cs/App.xaml.cs | 15 +- Samples/Playlists/README.md | 2 +- Samples/PosPrinter/README.md | 2 +- Samples/Printing/README.md | 2 +- Samples/Printing/js/html/pagetoprint.html | 1 + Samples/Printing/js/js/scenario1basic.js | 55 ++-- .../js/js/scenario2standardoptions.js | 45 ++-- Samples/Projection/README.md | 2 +- Samples/ProximitySensor/README.md | 2 +- .../ProxyStubsForWinRTComponents/README.md | 2 +- Samples/RadioManager/README.md | 2 +- Samples/RelativeInclinometer/README.md | 2 +- Samples/RelativeOrientationSensor/README.md | 2 +- Samples/ResizeAppView/README.md | 2 +- Samples/SecondaryTiles/README.md | 2 +- Samples/SecondaryTiles/cs/MainPage.xaml.cs | 19 +- Samples/SemanticTextQuery/README.md | 2 +- Samples/SerialArduino/README.md | 2 +- Samples/ShareSource/README.md | 2 +- Samples/ShareTarget/README.md | 2 +- Samples/Simple3DGameDX/README.md | 2 +- Samples/Simple3DGameXaml/README.md | 2 +- Samples/SimpleCommunication/README.md | 2 +- Samples/SimpleImaging/README.md | 2 +- Samples/SimpleInk/README.md | 2 +- Samples/SimpleOrientationSensor/README.md | 2 +- Samples/SmartCard/README.md | 2 +- Samples/SmsSendAndReceive/README.md | 2 +- Samples/SocketActivityStreamSocket/README.md | 4 +- Samples/SpatialSound/README.md | 2 +- .../SpeechRecognitionAndSynthesis/README.md | 2 +- Samples/SplashScreen/README.md | 2 +- .../SplashScreen/cs/ExtendedSplash.xaml.cs | 12 +- Samples/SplashScreen/cs/MainPage.xaml.cs | 19 +- Samples/Store/README.md | 2 +- Samples/StreamSocket/README.md | 2 +- Samples/Syndication/README.md | 2 +- .../SystemMediaTransportControls/README.md | 2 +- Samples/TextSegmentation/README.md | 2 +- Samples/TextSuggestion/README.md | 2 +- Samples/TitleBar/README.md | 2 +- Samples/TouchKeyboard/README.md | 2 +- Samples/Unicode/README.md | 2 +- Samples/UserConsentVerifier/README.md | 2 +- Samples/UserDataAccountManager/README.md | 2 +- Samples/UserInfo/README.md | 2 +- Samples/UserInteractionMode/README.md | 2 +- Samples/UserSelection/README.md | 2 +- Samples/UssdProtcol/README.md | 2 +- Samples/VideoPlayback/README.md | 2 +- Samples/VoIP/README.md | 2 +- Samples/WRLInProcessWinRTComponent/README.md | 2 +- .../WRLOutOfProcessWinRTComponent/README.md | 2 +- Samples/WebAccountManagement/README.md | 2 +- ...enario5_ManyProvidersManyAccounts.xaml.cpp | 24 +- .../cpp/Scenario6_CustomProvider.xaml.cpp | 21 +- Samples/WebAuthenticationBroker/README.md | 2 +- Samples/WebSocket/README.md | 2 +- Samples/WebView/README.md | 2 +- Samples/WebWorkers/README.md | 2 +- Samples/WiFiDirect/README.md | 2 +- Samples/WiFiDirectServices/README.md | 2 +- Samples/WiFiScan/README.md | 2 +- Samples/WindowsAudioSession/README.md | 2 +- Samples/XamlAnimatedGif/README.md | 2 +- Samples/XamlAnimatedGif/cs/GifView.xaml.cs | 30 ++- Samples/XamlAutoSuggestBox/README.md | 2 +- Samples/XamlBind/README.md | 2 +- Samples/XamlCloudFontIntegration/README.md | 2 +- Samples/XamlCommanding/README.md | 2 +- Samples/XamlContextMenu/README.md | 2 +- .../README.md | 2 +- Samples/XamlDataVirtualization/README.md | 1 + Samples/XamlDeferLoadStrategy/README.md | 2 +- Samples/XamlDragAndDrop/README.md | 2 +- Samples/XamlFocusVisuals/README.md | 2 +- Samples/XamlListView/README.md | 2 +- .../MasterDetailSelection/DetailsPage.xaml | 13 +- .../MasterDetailSelection/DetailsPage.xaml.cs | 19 +- .../RestoreScrollPositionSample/Page2.xaml | 16 +- .../RestoreScrollPositionSample/Page2.xaml.cs | 24 +- .../TapOnTheEdge/TapOnTheEdgeSample.xaml.cs | 23 +- Samples/XamlMasterDetail/README.md | 2 +- Samples/XamlMasterDetail/cpp/DetailPage.xaml | 21 +- .../XamlMasterDetail/cpp/DetailPage.xaml.cpp | 8 +- .../XamlMasterDetail/cpp/Package.appxmanifest | 8 +- Samples/XamlMasterDetail/cs/DetailPage.xaml | 23 +- .../XamlMasterDetail/cs/DetailPage.xaml.cs | 13 +- Samples/XamlNavigation/README.md | 2 +- Samples/XamlNavigation/cpp/AppShell.xaml | 15 +- Samples/XamlNavigation/cpp/AppShell.xaml.cpp | 36 +-- Samples/XamlNavigation/cpp/AppShell.xaml.h | 2 - Samples/XamlNavigation/cpp/Styles.xaml | 21 -- Samples/XamlNavigation/cs/AppShell.xaml | 15 +- Samples/XamlNavigation/cs/AppShell.xaml.cs | 36 +-- Samples/XamlNavigation/cs/Styles/Styles.xaml | 21 -- Samples/XamlPivot/README.md | 2 +- Samples/XamlPullToRefresh/README.md | 2 +- Samples/XamlResponsiveTechniques/README.md | 2 +- Samples/XamlStateTriggers/README.md | 2 +- Samples/XamlTailoredMultipleViews/README.md | 2 +- Samples/XamlTransform3DAnimations/README.md | 2 +- .../cs/ArticlePage.xaml | 5 +- .../cs/ArticlePage.xaml.cs | 8 +- Samples/XamlTransform3DParallax/README.md | 2 +- Samples/XamlUIBasics/README.md | 2 +- Samples/XamlUIBasics/cs/AppUIBasics/App.xaml | 43 --- .../cs/AppUIBasics/AppUIBasics.csproj | 6 - .../cs/AppUIBasics/Common/NavigationHelper.cs | 46 ++-- .../cs/AppUIBasics/PageHeader.xaml | 13 +- .../cs/AppUIBasics/PageHeader.xaml.cs | 26 -- Samples/XmlDocument/README.md | 2 +- Samples/XmlLite/README.md | 2 +- 308 files changed, 3123 insertions(+), 959 deletions(-) create mode 100644 Samples/DeviceLockdownAzureLogin/README.md create mode 100644 Samples/DeviceLockdownAzureLogin/cs/DeviceLockdownAzureLogin.csproj create mode 100644 Samples/DeviceLockdownAzureLogin/cs/DeviceLockdownAzureLogin.sln create mode 100644 Samples/DeviceLockdownAzureLogin/cs/Package.appxmanifest create mode 100644 Samples/DeviceLockdownAzureLogin/cs/SampleConfiguration.cs create mode 100644 Samples/DeviceLockdownAzureLogin/cs/Scenario1_SignIn.xaml create mode 100644 Samples/DeviceLockdownAzureLogin/cs/Scenario1_SignIn.xaml.cs create mode 100644 Samples/DeviceLockdownAzureLogin/cs/project.json create mode 100644 Samples/PdfDocument/README.md create mode 100644 Samples/PdfDocument/cpp/Package.appxmanifest create mode 100644 Samples/PdfDocument/cpp/PdfDocument.sln create mode 100644 Samples/PdfDocument/cpp/PdfDocument.vcxproj create mode 100644 Samples/PdfDocument/cpp/PdfDocument.vcxproj.filters create mode 100644 Samples/PdfDocument/cpp/SampleConfiguration.cpp create mode 100644 Samples/PdfDocument/cpp/SampleConfiguration.h create mode 100644 Samples/PdfDocument/cpp/Scenario1_Render.xaml.cpp create mode 100644 Samples/PdfDocument/cpp/Scenario1_Render.xaml.h create mode 100644 Samples/PdfDocument/cpp/pch.cpp create mode 100644 Samples/PdfDocument/cpp/pch.h create mode 100644 Samples/PdfDocument/cs/Package.appxmanifest create mode 100644 Samples/PdfDocument/cs/PdfDocument.csproj create mode 100644 Samples/PdfDocument/cs/PdfDocument.sln create mode 100644 Samples/PdfDocument/cs/SampleConfiguration.cs create mode 100644 Samples/PdfDocument/cs/Scenario1_Render.xaml.cs create mode 100644 Samples/PdfDocument/cs/project.json create mode 100644 Samples/PdfDocument/js/Microsoft.WinJS.4.0/css/placeholder.txt create mode 100644 Samples/PdfDocument/js/Microsoft.WinJS.4.0/fonts/placeholder create mode 100644 Samples/PdfDocument/js/Microsoft.WinJS.4.0/js/en-US/placeholder.txt create mode 100644 Samples/PdfDocument/js/Package.appxmanifest create mode 100644 Samples/PdfDocument/js/PdfDocument.jsproj create mode 100644 Samples/PdfDocument/js/PdfDocument.sln create mode 100644 Samples/PdfDocument/js/css/placeholder.txt create mode 100644 Samples/PdfDocument/js/html/scenario1-render.html create mode 100644 Samples/PdfDocument/js/images/placeholder.txt create mode 100644 Samples/PdfDocument/js/js/sample-configuration.js create mode 100644 Samples/PdfDocument/js/js/scenario1-render.js create mode 100644 Samples/PdfDocument/js/sample-utils/placeholder.txt create mode 100644 Samples/PdfDocument/shared/Scenario1_Render.xaml diff --git a/README.md b/README.md index 25803a3503..99b97ccba9 100644 --- a/README.md +++ b/README.md @@ -225,11 +225,12 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github. Logging + PDF document Serializing and deserializing data x:Bind - x:DeferLoadStrategy + x:DeferLoadStrategy XML DOM XmlLite @@ -387,19 +388,20 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github. Credential locker Credential picker - Disabling screen capture + Device lockdown with Azure login + Disabling screen capture Enterprise data protection KeyCredentialManager - Lock screen personalization + Lock screen personalization Smart cards User information - UserConsentVerifier + UserConsentVerifier Web account management WebAuthenticationBroker diff --git a/Samples/Accelerometer/README.md b/Samples/Accelerometer/README.md index 6cbb881e5f..a42a7dbeb5 100644 --- a/Samples/Accelerometer/README.md +++ b/Samples/Accelerometer/README.md @@ -1,6 +1,6 @@  # Accelerometer sample diff --git a/Samples/ActivitySensor/README.md b/Samples/ActivitySensor/README.md index 181035ea44..b21974df4d 100644 --- a/Samples/ActivitySensor/README.md +++ b/Samples/ActivitySensor/README.md @@ -1,6 +1,6 @@ # Activity detection sensor sample diff --git a/Samples/AdaptiveStreaming/README.md b/Samples/AdaptiveStreaming/README.md index 34c11ad411..3b17944a0c 100644 --- a/Samples/AdaptiveStreaming/README.md +++ b/Samples/AdaptiveStreaming/README.md @@ -1,6 +1,6 @@ # Adaptive streaming sample diff --git a/Samples/AdvancedCasting/README.md b/Samples/AdvancedCasting/README.md index ea798f7e26..b0a43c2f35 100644 --- a/Samples/AdvancedCasting/README.md +++ b/Samples/AdvancedCasting/README.md @@ -1,6 +1,6 @@ # Advanced casting sample diff --git a/Samples/AllJoyn/ConsumerExperiences/README.md b/Samples/AllJoyn/ConsumerExperiences/README.md index e8770b317e..cff5247643 100644 --- a/Samples/AllJoyn/ConsumerExperiences/README.md +++ b/Samples/AllJoyn/ConsumerExperiences/README.md @@ -1,6 +1,6 @@ # AllJoyn consumer experiences sample diff --git a/Samples/AllJoyn/ProducerExperiences/README.md b/Samples/AllJoyn/ProducerExperiences/README.md index 6682d866a4..14ba77ef05 100644 --- a/Samples/AllJoyn/ProducerExperiences/README.md +++ b/Samples/AllJoyn/ProducerExperiences/README.md @@ -1,6 +1,6 @@ # AllJoyn producer experiences sample diff --git a/Samples/Altimeter/README.md b/Samples/Altimeter/README.md index dcd6d32bbd..13393d0c70 100644 --- a/Samples/Altimeter/README.md +++ b/Samples/Altimeter/README.md @@ -1,6 +1,6 @@ # Altimeter sample diff --git a/Samples/AnimationLibrary/README.md b/Samples/AnimationLibrary/README.md index 3a06870a10..32846bdd84 100644 --- a/Samples/AnimationLibrary/README.md +++ b/Samples/AnimationLibrary/README.md @@ -1,6 +1,6 @@ # Animation library (HTML) sample diff --git a/Samples/AnimationLibrary/js/html/samplePage.html b/Samples/AnimationLibrary/js/html/samplePage.html index b9cc4031c3..1809880904 100644 --- a/Samples/AnimationLibrary/js/html/samplePage.html +++ b/Samples/AnimationLibrary/js/html/samplePage.html @@ -24,7 +24,6 @@

Sample Page Header

ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem.

- diff --git a/Samples/AnimationLibrary/js/js/samplePage.js b/Samples/AnimationLibrary/js/js/samplePage.js index 2ac2e5c55d..14c327fe5c 100644 --- a/Samples/AnimationLibrary/js/js/samplePage.js +++ b/Samples/AnimationLibrary/js/js/samplePage.js @@ -3,22 +3,23 @@ (function () { "use strict"; + var systemNavigationManager = Windows.UI.Core.SystemNavigationManager.getForCurrentView(); + WinJS.UI.Pages.define("/html/samplePage.html", { ready: function (element, options) { - returnButton.addEventListener("click", transitionBetweenPages, false); -// rootGrid.style.overflow= "auto"; -// content.style.overflow = "visible"; + systemNavigationManager.addEventListener("backrequested", backRequested); + systemNavigationManager.appViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.visible; // Run enter page animation to animate in the page that has just been loaded WinJS.UI.Animation.enterPage([samplePageHeader, samplePageSection1, samplePageSection2], null); }, unload: function () { -// rootGrid.style.overflow = "visible"; -// content.style.overflow = "auto"; + systemNavigationManager.removeEventListener("backrequested", backRequested); + systemNavigationManager.appViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility.collapsed; } }); - function transitionBetweenPages() { + function backRequested() { // When navigating away from this page, run exit page animation on current page, then navigate to new page WinJS.UI.Animation.exitPage([samplePageHeader, samplePageSection1, samplePageSection2], null).done( function () { diff --git a/Samples/AnimationMetrics/README.md b/Samples/AnimationMetrics/README.md index 7a2a40fb4f..45f9c24568 100644 --- a/Samples/AnimationMetrics/README.md +++ b/Samples/AnimationMetrics/README.md @@ -1,6 +1,6 @@ # Animation metrics sample diff --git a/Samples/AppServices/README.md b/Samples/AppServices/README.md index 932df93ccb..007003b88e 100644 --- a/Samples/AppServices/README.md +++ b/Samples/AppServices/README.md @@ -1,6 +1,6 @@ # App services sample diff --git a/Samples/ApplicationData/README.md b/Samples/ApplicationData/README.md index 1a8874d6cb..3ac3800dd6 100644 --- a/Samples/ApplicationData/README.md +++ b/Samples/ApplicationData/README.md @@ -1,6 +1,6 @@ # Application data sample diff --git a/Samples/ApplicationResources/README.md b/Samples/ApplicationResources/README.md index 4b09c6d298..5065a3d6ad 100644 --- a/Samples/ApplicationResources/README.md +++ b/Samples/ApplicationResources/README.md @@ -1,6 +1,6 @@ # Application resources and localization sample diff --git a/Samples/Appointments/README.md b/Samples/Appointments/README.md index 808b205d57..5429149713 100644 --- a/Samples/Appointments/README.md +++ b/Samples/Appointments/README.md @@ -1,6 +1,6 @@ # Appointment calendar sample diff --git a/Samples/AssociationLaunching/README.md b/Samples/AssociationLaunching/README.md index 3334bb63e1..7062b4572c 100644 --- a/Samples/AssociationLaunching/README.md +++ b/Samples/AssociationLaunching/README.md @@ -1,6 +1,6 @@ # Association launching sample diff --git a/Samples/AudioCategory/README.md b/Samples/AudioCategory/README.md index 22ef40a5ca..b6c509a3af 100644 --- a/Samples/AudioCategory/README.md +++ b/Samples/AudioCategory/README.md @@ -1,6 +1,6 @@ # Audio categories sample diff --git a/Samples/AudioCreation/README.md b/Samples/AudioCreation/README.md index 760ba7ccd0..a557497401 100644 --- a/Samples/AudioCreation/README.md +++ b/Samples/AudioCreation/README.md @@ -1,6 +1,6 @@ # AudioGraph sample diff --git a/Samples/BackButton/README.md b/Samples/BackButton/README.md index fb4b777c8c..b96602844f 100644 --- a/Samples/BackButton/README.md +++ b/Samples/BackButton/README.md @@ -1,6 +1,6 @@ # Back Button Sample diff --git a/Samples/BackgroundAudio/README.md b/Samples/BackgroundAudio/README.md index aeedbb3dd1..e381d25987 100644 --- a/Samples/BackgroundAudio/README.md +++ b/Samples/BackgroundAudio/README.md @@ -1,6 +1,6 @@ # Background audio sample diff --git a/Samples/BackgroundAudio/cs/BackgroundAudio/Scenario1.xaml.cs b/Samples/BackgroundAudio/cs/BackgroundAudio/Scenario1.xaml.cs index 1288991246..7d205116e1 100644 --- a/Samples/BackgroundAudio/cs/BackgroundAudio/Scenario1.xaml.cs +++ b/Samples/BackgroundAudio/cs/BackgroundAudio/Scenario1.xaml.cs @@ -39,7 +39,7 @@ public sealed partial class Scenario1 : Page #region Private Fields and Properties private MainPage rootPage; private AutoResetEvent backgroundAudioTaskStarted; - private bool isMyBackgroundTaskRunning = false; + private bool _isMyBackgroundTaskRunning = false; private Dictionary albumArtCache = new Dictionary(); const int RPC_S_SERVER_UNAVAILABLE = -2147023174; // 0x800706BA @@ -52,7 +52,7 @@ private bool IsMyBackgroundTaskRunning { get { - if (isMyBackgroundTaskRunning) + if (_isMyBackgroundTaskRunning) return true; string value = ApplicationSettingsHelper.ReadResetSettingsValue(ApplicationSettingsConstants.BackgroundTaskState) as string; @@ -64,13 +64,13 @@ private bool IsMyBackgroundTaskRunning { try { - isMyBackgroundTaskRunning = EnumHelper.Parse(value) == BackgroundTaskState.Running; + _isMyBackgroundTaskRunning = EnumHelper.Parse(value) == BackgroundTaskState.Running; } catch(ArgumentException) { - isMyBackgroundTaskRunning = false; + _isMyBackgroundTaskRunning = false; } - return isMyBackgroundTaskRunning; + return _isMyBackgroundTaskRunning; } } } @@ -87,20 +87,28 @@ private MediaPlayer CurrentPlayer get { MediaPlayer mp = null; + int retryCount = 2; - try + while (mp == null && --retryCount >= 0) { - mp = BackgroundMediaPlayer.Current; - } - catch (Exception ex) - { - if (ex.HResult == RPC_S_SERVER_UNAVAILABLE) + try { - // The foreground app uses RPC to communicate with the background process. - // If the background process crashes or is killed for any reason RPC_S_SERVER_UNAVAILABLE - // is returned when calling Current. - ResetAfterLostBackground(); - StartBackgroundAudioTask(); + mp = BackgroundMediaPlayer.Current; + } + catch (Exception ex) + { + if (ex.HResult == RPC_S_SERVER_UNAVAILABLE) + { + // The foreground app uses RPC to communicate with the background process. + // If the background process crashes or is killed for any reason RPC_S_SERVER_UNAVAILABLE + // is returned when calling Current. We must restart the task, the while loop will retry to set mp. + ResetAfterLostBackground(); + StartBackgroundAudioTask(); + } + else + { + throw; + } } } @@ -114,12 +122,13 @@ private MediaPlayer CurrentPlayer } /// - /// The background task did exist, but it has disappeared. Put the foreground back into an initial state. + /// The background task did exist, but it has disappeared. Put the foreground back into an initial state. Unfortunately, + /// any attempts to unregister things on BackgroundMediaPlayer.Current will fail with the RPC error once the background task has been lost. /// private void ResetAfterLostBackground() { BackgroundMediaPlayer.Shutdown(); - isMyBackgroundTaskRunning = false; + _isMyBackgroundTaskRunning = false; backgroundAudioTaskStarted.Reset(); prevButton.IsEnabled = true; nextButton.IsEnabled = true; @@ -136,6 +145,10 @@ private void ResetAfterLostBackground() { throw new Exception("Failed to get a MediaPlayer instance."); } + else + { + throw; + } } } @@ -220,7 +233,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e) protected override void OnNavigatedFrom(NavigationEventArgs e) { - if(isMyBackgroundTaskRunning) + if(_isMyBackgroundTaskRunning) { RemoveMediaPlayerEventHandlers(); ApplicationSettingsHelper.SaveSettingsValue(ApplicationSettingsConstants.BackgroundTaskState, BackgroundTaskState.Running.ToString()); @@ -500,9 +513,9 @@ private void UpdateTransportControls(MediaPlayerState state) /// private void RemoveMediaPlayerEventHandlers() { - CurrentPlayer.CurrentStateChanged -= this.MediaPlayer_CurrentStateChanged; try { + BackgroundMediaPlayer.Current.CurrentStateChanged -= this.MediaPlayer_CurrentStateChanged; BackgroundMediaPlayer.MessageReceivedFromBackground -= BackgroundMediaPlayer_MessageReceivedFromBackground; } catch (Exception ex) @@ -536,6 +549,10 @@ private void AddMediaPlayerEventHandlers() // Internally MessageReceivedFromBackground calls Current which can throw RPC_S_SERVER_UNAVAILABLE ResetAfterLostBackground(); } + else + { + throw; + } } } diff --git a/Samples/BackgroundSensors/README.md b/Samples/BackgroundSensors/README.md index 9a650d1038..4984948d1f 100644 --- a/Samples/BackgroundSensors/README.md +++ b/Samples/BackgroundSensors/README.md @@ -1,6 +1,6 @@ # Background sensors sample diff --git a/Samples/BackgroundTask/README.md b/Samples/BackgroundTask/README.md index 242ee585f7..00d222ec93 100644 --- a/Samples/BackgroundTask/README.md +++ b/Samples/BackgroundTask/README.md @@ -1,6 +1,6 @@ # Background task sample diff --git a/Samples/BackgroundTransfer/README.md b/Samples/BackgroundTransfer/README.md index d208927b96..abedbadbaa 100644 --- a/Samples/BackgroundTransfer/README.md +++ b/Samples/BackgroundTransfer/README.md @@ -1,6 +1,6 @@ # Background transfer sample diff --git a/Samples/BarcodeScanner/README.md b/Samples/BarcodeScanner/README.md index b058f123ae..a29e2d597d 100644 --- a/Samples/BarcodeScanner/README.md +++ b/Samples/BarcodeScanner/README.md @@ -1,6 +1,6 @@ # Barcode scanner sample diff --git a/Samples/Barometer/README.md b/Samples/Barometer/README.md index 144815c606..b389da32de 100644 --- a/Samples/Barometer/README.md +++ b/Samples/Barometer/README.md @@ -1,6 +1,6 @@ # Barometer sample diff --git a/Samples/BasicFaceDetection/README.md b/Samples/BasicFaceDetection/README.md index 1bbe97b9f1..501506e7ef 100644 --- a/Samples/BasicFaceDetection/README.md +++ b/Samples/BasicFaceDetection/README.md @@ -1,6 +1,6 @@ # Basic face detection sample diff --git a/Samples/BasicFaceTracking/README.md b/Samples/BasicFaceTracking/README.md index 0f2e028e6f..0f23f3fbd0 100644 --- a/Samples/BasicFaceTracking/README.md +++ b/Samples/BasicFaceTracking/README.md @@ -1,6 +1,6 @@ # Basic face tracking sample diff --git a/Samples/BasicInput/README.md b/Samples/BasicInput/README.md index acf5f437b6..0ac9eaadd4 100644 --- a/Samples/BasicInput/README.md +++ b/Samples/BasicInput/README.md @@ -1,6 +1,6 @@ # Basic input sample diff --git a/Samples/BasicMediaCasting/README.md b/Samples/BasicMediaCasting/README.md index 3deefcd96e..425d59faf3 100644 --- a/Samples/BasicMediaCasting/README.md +++ b/Samples/BasicMediaCasting/README.md @@ -1,6 +1,6 @@ # Basic media casting sample diff --git a/Samples/BluetoothAdvertisement/README.md b/Samples/BluetoothAdvertisement/README.md index 5b79bfa7be..3d5fea1948 100644 --- a/Samples/BluetoothAdvertisement/README.md +++ b/Samples/BluetoothAdvertisement/README.md @@ -1,6 +1,6 @@ # Bluetooth advertisement sample diff --git a/Samples/BluetoothRfcommChat/README.md b/Samples/BluetoothRfcommChat/README.md index e30571c7e3..c2594a3a7e 100644 --- a/Samples/BluetoothRfcommChat/README.md +++ b/Samples/BluetoothRfcommChat/README.md @@ -1,6 +1,6 @@ # Bluetooth RFCOMM chat sample diff --git a/Samples/Calendar/README.md b/Samples/Calendar/README.md index 6e71bb0d22..a117e83cb9 100644 --- a/Samples/Calendar/README.md +++ b/Samples/Calendar/README.md @@ -1,6 +1,6 @@ # Calendar sample diff --git a/Samples/CameraFaceDetection/README.md b/Samples/CameraFaceDetection/README.md index c64a85e1f2..b4d6ee8bd2 100644 --- a/Samples/CameraFaceDetection/README.md +++ b/Samples/CameraFaceDetection/README.md @@ -1,6 +1,6 @@ # Camera face detection sample diff --git a/Samples/CameraGetPreviewFrame/README.md b/Samples/CameraGetPreviewFrame/README.md index a5ded7c7b1..148838539b 100644 --- a/Samples/CameraGetPreviewFrame/README.md +++ b/Samples/CameraGetPreviewFrame/README.md @@ -1,6 +1,6 @@ # Camera preview frame sample diff --git a/Samples/CameraHdr/README.md b/Samples/CameraHdr/README.md index 3220749099..89342954b1 100644 --- a/Samples/CameraHdr/README.md +++ b/Samples/CameraHdr/README.md @@ -1,6 +1,6 @@ # High dynamic range sample diff --git a/Samples/CameraManualControls/README.md b/Samples/CameraManualControls/README.md index febc74b7a2..c07f23ff47 100644 --- a/Samples/CameraManualControls/README.md +++ b/Samples/CameraManualControls/README.md @@ -1,6 +1,6 @@ # Manual camera controls sample diff --git a/Samples/CameraManualControls/cs/MainPage.xaml.cs b/Samples/CameraManualControls/cs/MainPage.xaml.cs index 8a40b9c21e..5f69d2c861 100644 --- a/Samples/CameraManualControls/cs/MainPage.xaml.cs +++ b/Samples/CameraManualControls/cs/MainPage.xaml.cs @@ -60,6 +60,9 @@ public sealed partial class MainPage : Page // For listening to media property changes private readonly SystemMediaTransportControls _systemMediaControls = SystemMediaTransportControls.GetForCurrentView(); + // Access to the Back button + private readonly SystemNavigationManager _systemNavigationManager = SystemNavigationManager.GetForCurrentView(); + // MediaCapture and its state variables private MediaCapture _mediaCapture; private bool _isInitialized; @@ -608,7 +611,6 @@ private void RegisterEventHandlers() if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) { HardwareButtons.CameraPressed += HardwareButtons_CameraPressed; - HardwareButtons.BackPressed += HardwareButtons_BackPressed; } // If there is an orientation sensor present on the device, register for notifications @@ -622,32 +624,21 @@ private void RegisterEventHandlers() _displayInformation.OrientationChanged += DisplayInformation_OrientationChanged; _systemMediaControls.PropertyChanged += SystemMediaControls_PropertyChanged; + _systemNavigationManager.BackRequested += SystemNavigationManager_BackRequested; } - private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e) + private void SystemNavigationManager_BackRequested(object sender, BackRequestedEventArgs e) { - // Back button exits single control mode if (_singleControlMode) { // Exit single control mode - _singleControlMode = false; - - // If in single control mode, hide all child buttons (except for the sender). Otherwise show all buttons. - foreach (var button in ScenarioControlStackPanel.Children) - { - if (button is Button && button != sender) - { - button.Visibility = Visibility.Visible; - } - } - - // Hide the container control for manual input - ManualControlsGrid.Visibility = Visibility.Collapsed; + SetSingleControl(null); e.Handled = true; } } + /// /// Unregisters event handlers for hardware buttons and orientation sensors /// @@ -656,7 +647,6 @@ private void UnregisterEventHandlers() if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) { HardwareButtons.CameraPressed -= HardwareButtons_CameraPressed; - HardwareButtons.BackPressed -= HardwareButtons_BackPressed; } if (_orientationSensor != null) @@ -666,6 +656,7 @@ private void UnregisterEventHandlers() _displayInformation.OrientationChanged -= DisplayInformation_OrientationChanged; _systemMediaControls.PropertyChanged -= SystemMediaControls_PropertyChanged; + _systemNavigationManager.BackRequested -= SystemNavigationManager_BackRequested; } /// @@ -912,24 +903,35 @@ private void UpdateButtonOrientation() #region Manual controls setup - private void ManualControlButton_Tapped(object sender, TappedRoutedEventArgs e) + // If activeButton = null, then exit single control mode. + private void SetSingleControl(object activeButton) { - // Toggle single control mode - _singleControlMode = !_singleControlMode; + _singleControlMode = (activeButton != null); - // If in single control mode, hide all manual control buttons (except for the sender, which was tapped), otherwise show all buttons - foreach (var button in ScenarioControlStackPanel.Children) + // If in single control mode, hide all manual control buttons (except for the active button). + // if not in single control mode, then show all the buttons which are supported. + foreach (var button in ScenarioControlStackPanel.Children.OfType

AdventureWorks

diff --git a/Samples/CortanaVoiceCommand/js/AdventureWorks/js/default.js b/Samples/CortanaVoiceCommand/js/AdventureWorks/js/default.js index d5603a7299..8311964773 100644 --- a/Samples/CortanaVoiceCommand/js/AdventureWorks/js/default.js +++ b/Samples/CortanaVoiceCommand/js/AdventureWorks/js/default.js @@ -18,6 +18,8 @@ var voiceCommandManager = Windows.ApplicationModel.VoiceCommands.VoiceCommandDef var app = WinJS.Application; var nav = WinJS.Navigation; var activationKinds = Windows.ApplicationModel.Activation.ActivationKind; + var AppViewBackButtonVisibility = Windows.UI.Core.AppViewBackButtonVisibility; + var systemNavigationManager = Windows.UI.Core.SystemNavigationManager.getForCurrentView(); var splitView; WinJS.Namespace.define("SdkSample", { @@ -124,14 +126,10 @@ var voiceCommandManager = Windows.ApplicationModel.VoiceCommands.VoiceCommandDef } } - initialState.activationKind = activationKind; initialState.activatedEventArgs = activatedEventArgs; nav.history.current.initialPlaceholder = true; return nav.navigate(url, initialState); - - - }, function (e) { WinJS.log && WinJS.log("Failed to load VCD", e.message, "error"); }); @@ -146,9 +144,6 @@ var voiceCommandManager = Windows.ApplicationModel.VoiceCommands.VoiceCommandDef eventObject.setPromise(p); } - - - function navigating(eventObject) { /// Handle swapping out the content block for the new page, and setting up /// the backstack. @@ -178,6 +173,30 @@ var voiceCommandManager = Windows.ApplicationModel.VoiceCommands.VoiceCommandDef eventObject.detail.setPromise(p); } + function navigated(eventObject) { + // If we returned to the root page, then empty the backstack. + if (nav.history.backStack.length > 0 && eventObject.detail.location == nav.history.backStack[0].location) { + nav.history.backStack.length = 0; + } + + // Set the Back button state appropriately. + systemNavigationManager.appViewBackButtonVisibility = nav.canGoBack ? + AppViewBackButtonVisibility.visible : AppViewBackButtonVisibility.collapsed; + } + + function backRequested(eventObject) { + if (!eventObject.handled && nav.canGoBack) { + eventObject.handled = true; + nav.back(); + } + } + + // Register for Back button events. + systemNavigationManager.addEventListener("backrequested", backRequested); + + // Register for the navigated event so we can update the Back button. + nav.addEventListener("navigated", navigated); + nav.addEventListener("navigating", navigating); app.addEventListener("activated", activated, false); app.start(); diff --git a/Samples/CredentialPicker/README.md b/Samples/CredentialPicker/README.md index d41cff5f07..644732700c 100644 --- a/Samples/CredentialPicker/README.md +++ b/Samples/CredentialPicker/README.md @@ -1,6 +1,6 @@ # Credential picker sample diff --git a/Samples/CustomHidDeviceAccess/README.md b/Samples/CustomHidDeviceAccess/README.md index 735a473474..f58337db3a 100644 --- a/Samples/CustomHidDeviceAccess/README.md +++ b/Samples/CustomHidDeviceAccess/README.md @@ -1,6 +1,6 @@ # Custom HID device sample diff --git a/Samples/CustomSensors/README.md b/Samples/CustomSensors/README.md index b37cef3d06..32b7aa4857 100644 --- a/Samples/CustomSensors/README.md +++ b/Samples/CustomSensors/README.md @@ -1,6 +1,6 @@ # Custom sensors sample diff --git a/Samples/CustomSerialDeviceAccess/README.md b/Samples/CustomSerialDeviceAccess/README.md index 876254518b..f08e2132f5 100644 --- a/Samples/CustomSerialDeviceAccess/README.md +++ b/Samples/CustomSerialDeviceAccess/README.md @@ -1,6 +1,6 @@ # Custom serial device sample diff --git a/Samples/CustomUsbDeviceAccess/README.md b/Samples/CustomUsbDeviceAccess/README.md index aabbe8ac00..8ca4765397 100644 --- a/Samples/CustomUsbDeviceAccess/README.md +++ b/Samples/CustomUsbDeviceAccess/README.md @@ -1,6 +1,6 @@ # Custom USB device sample diff --git a/Samples/D2DCustomEffects/README.md b/Samples/D2DCustomEffects/README.md index d4379b4848..14ea6a554d 100644 --- a/Samples/D2DCustomEffects/README.md +++ b/Samples/D2DCustomEffects/README.md @@ -1,6 +1,6 @@ # Direct2D custom image effects sample diff --git a/Samples/D2DGradientMesh/README.md b/Samples/D2DGradientMesh/README.md index b8ec6693d7..f270c20ec8 100644 --- a/Samples/D2DGradientMesh/README.md +++ b/Samples/D2DGradientMesh/README.md @@ -1,6 +1,6 @@ # Direct2D gradient mesh sample diff --git a/Samples/D2DPhotoAdjustment/README.md b/Samples/D2DPhotoAdjustment/README.md index c193bd4c77..561d7aec93 100644 --- a/Samples/D2DPhotoAdjustment/README.md +++ b/Samples/D2DPhotoAdjustment/README.md @@ -1,6 +1,6 @@ # Direct2D photo adjustment sample diff --git a/Samples/DWriteLineSpacingModes/README.md b/Samples/DWriteLineSpacingModes/README.md index 1c2d8f4f35..7c709c9ec2 100644 --- a/Samples/DWriteLineSpacingModes/README.md +++ b/Samples/DWriteLineSpacingModes/README.md @@ -1,6 +1,6 @@ # Line spacing (DirectWrite) sample diff --git a/Samples/DWriteTextLayoutCloudFont/README.md b/Samples/DWriteTextLayoutCloudFont/README.md index caf0f65ba3..20b6375c68 100644 --- a/Samples/DWriteTextLayoutCloudFont/README.md +++ b/Samples/DWriteTextLayoutCloudFont/README.md @@ -1,6 +1,6 @@ # Downloadable fonts (DirectWrite) sample diff --git a/Samples/DataReaderWriter/README.md b/Samples/DataReaderWriter/README.md index fc611b18d9..3633dc9741 100644 --- a/Samples/DataReaderWriter/README.md +++ b/Samples/DataReaderWriter/README.md @@ -1,6 +1,6 @@ # Serializing and deserializing data sample diff --git a/Samples/DatagramSocket/README.md b/Samples/DatagramSocket/README.md index 3c75f68ac4..2406045141 100644 --- a/Samples/DatagramSocket/README.md +++ b/Samples/DatagramSocket/README.md @@ -1,6 +1,6 @@ # DatagramSocket sample diff --git a/Samples/DateTimeFormatting/README.md b/Samples/DateTimeFormatting/README.md index 49a60f27f2..ee33314545 100644 --- a/Samples/DateTimeFormatting/README.md +++ b/Samples/DateTimeFormatting/README.md @@ -1,6 +1,6 @@ # Date and time formatting sample @@ -39,7 +39,7 @@ This sample contains scenarios that demonstrate: * [**Calendar** sample](../Calendar) * [**GlobalizationPreferences** sample](../GlobalizationPreferences) -* [**NumberFormatting** sample](http://go.microsoft.com/fwlink/p/?LinkId=620578&clcid=0x409) +* [**NumberFormatting** sample](../NumberFormatting) ### Reference diff --git a/Samples/DeviceEnumeration/README.md b/Samples/DeviceEnumeration/README.md index 6cf03a00ac..2eb36edc9b 100644 --- a/Samples/DeviceEnumeration/README.md +++ b/Samples/DeviceEnumeration/README.md @@ -1,6 +1,6 @@ # Device enumeration sample diff --git a/Samples/DeviceLockdownAzureLogin/README.md b/Samples/DeviceLockdownAzureLogin/README.md new file mode 100644 index 0000000000..b687bc3963 --- /dev/null +++ b/Samples/DeviceLockdownAzureLogin/README.md @@ -0,0 +1,122 @@ + +# Device lockdown with Azure login sample + +This sample shows how to create a sample login application +for Windows Mobile which utilizes the Enterprise Device Lockdown APIs +and optionally authenticates with Azure Active Directory. +The app displays the list of Assigned Access roles on the device, +and clicking on a role will prompt the user to sign in +with credentials from an Azure Active Directory tenant. + +Specifically, this sample shows how to: + +- Call Enterprise Device Lockdown APIs to implement a login application +- Authenticate user credentials with Azure Active Directory + +### Setup instructions on the device + +This step is needed regardless of whether you intend to use Azure Authentication. + +**Warning**: Once Enterprise Assigned Access is deployed to the device, +it cannot be removed. +To get rid of it, you must reflash the device. + +1) The Windows Mobile device should be configured with +[Enterprise Assigned Access CSP](https://msdn.microsoft.com/library/windows/hardware/mt157024(v=vs.85).aspx). +The `wehlockdown.xml` file should contain roles with role GUIDs +that will be registered in the Azure Active Directory. +(If you are not using Azure Active Directory, +then you can make up your own role GUIDs.) +For more information, see the references below. + +**Remember**: Once Enterprise Assigned Access is deployed to the device, +it cannot be removed. +To get rid of it, you must reflash the device. + +### Setup instructions on Azure Active Directory + +This step is needed if you intend to use Azure Authentication. + +Sign up for an Azure subscription and configure the account at +[Windows Azure Management Portal](https://manage.windowsazure.com). +Your account should come with a `Default` directory which will be configured in this sample. + +1. Add one or more groups to the domain: + * *Active Directory > Default Directory > Groups > Add Group* + * Each group contains an Object ID on the Properties page. + This is the GUID to use for each role in `wehlockdown.xml`. +2. Add one of more users to the domain: + * *Active Directory > Default Directory > Users > Add user* +3. Add the users to the groups above as appropriate. +4. Create a native application + * *Active Directory > Default Directory > Applications > New* +5. Determine your native app's Client ID + * *Active Directory > Default Directory > Applications > (name of Native Client App) > Configure* + * In `Scenario1_SignIn.cs`, set the `clientId` variable to the Client ID from this page. +6. Get the app's Redirect URI + * Set a breakpoint on the `Scenario1_SignIn` constructor method in `Scenario1_SignIn.cs` + and inspect the value of the `RedirectURI` member. + This will be unique for your app. +7. Set the Redirect URI in Azure Active Directory. + * *Active Directory > Default Directory > Applications > (name of Native Client App) > Configure* + * Enter your unique RedirectURI here. + +### Setup instructions for the app + +This step is needed if you intend to use Azure Authentication. + +1. You will need to change the following variables in `Scenario1_SignIn.cs` to match the values in your Azure Active directory tenant created above. + * Replace the provided value of "tenant" with your actual tenant address for your Azure account. + * Replace the provided value of "clientId" with the actual value of your native application created in Azure Active Directory. + (See step 5 above.) + +**Note** The Windows universal samples require Visual Studio 2015 to build and Windows 10 to execute. + +To obtain information about Windows 10, go to [Windows 10](http://go.microsoft.com/fwlink/?LinkID=532421) + +To obtain information about Microsoft Visual Studio 2015 and the tools for developing Windows apps, go to [Visual Studio 2015](http://go.microsoft.com/fwlink/?LinkID=532422) + +## Related topics + +### Reference + +[Windows.Embedded.DeviceLockdown](https://msdn.microsoft.com/library/windows/apps/windows.embedded.devicelockdown) + +[Windows Azure Management Portal](https://manage.windowsazure.com) + +[Windows app samples](http://go.microsoft.com/fwlink/p/?LinkID=227694) + +[Enterprise Assigned Access CSP](https://msdn.microsoft.com/library/windows/hardware/mt157024(v=vs.85).aspx) + +[Lockdown XML](https://msdn.microsoft.com/library/dn798305.aspx) + +[Locking down a device](https://msdn.microsoft.com/library/dn798313.aspx) + +## System requirements + +Client: Not supported + +Server: Not supported + +**Phone:** Windows 10 + +## Build the sample + +1. Start Microsoft Visual Studio 2015 and select **File** > **Open** > **Project/Solution**. +2. Go to the directory to which you unzipped the sample. Then go to the subdirectory containing the sample in the language you desire - either C++, C#, or JavaScript. Double-click the Visual Studio 2015 Solution (.sln) file. +3. Press Ctrl+Shift+B, or select **Build** > **Build Solution**. + +## Run the sample + +The next steps depend on whether you just want to deploy the sample or you want to both deploy and run it. + +### Deploying the sample + +- Select **Build** > **Deploy Solution**. + +### Deploying and running the sample + +- To debug the sample and then run it, press F5 or select **Debug** > **Start Debugging**. To run the sample without debugging, press Ctrl+F5 or select **Debug** > **Start Without Debugging**. diff --git a/Samples/DeviceLockdownAzureLogin/cs/DeviceLockdownAzureLogin.csproj b/Samples/DeviceLockdownAzureLogin/cs/DeviceLockdownAzureLogin.csproj new file mode 100644 index 0000000000..793099c283 --- /dev/null +++ b/Samples/DeviceLockdownAzureLogin/cs/DeviceLockdownAzureLogin.csproj @@ -0,0 +1,177 @@ + + + + + Debug + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F} + AppContainerExe + Properties + SDKTemplate + DeviceLockdownAzureLogin + en-US + UAP + 10.0.10240.0 + 10.0.10240.0 + 14 + true + 512 + {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP + ;2008 + full + ARM + false + prompt + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE;WINDOWS_UAP + true + ;2008 + pdbonly + ARM + false + prompt + true + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP + ;2008 + full + x64 + false + prompt + true + + + bin\x64\Release\ + TRACE;NETFX_CORE;WINDOWS_UAP + true + ;2008 + pdbonly + x64 + false + prompt + true + true + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UAP + ;2008 + full + x86 + false + prompt + true + + + bin\x86\Release\ + TRACE;NETFX_CORE;WINDOWS_UAP + true + ;2008 + pdbonly + x86 + false + prompt + true + true + + + + + + + App.xaml.cs + App.xaml + + + MainPage.xaml.cs + MainPage.xaml + + + Properties\AssemblyInfo.cs + + + + Scenario1_SignIn.xaml + + + + + Designer + + + + + App.xaml + MSBuild:Compile + Designer + + + MainPage.xaml + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + Styles\Styles.xaml + MSBuild:Compile + Designer + + + + + Properties\Default.rd.xml + + + Assets\microsoft-sdk.png + + + Assets\smallTile-sdk.png + + + Assets\splash-sdk.png + + + Assets\squareTile-sdk.png + + + Assets\storeLogo-sdk.png + + + Assets\tile-sdk.png + + + Assets\windows-sdk.png + + + + + Windows Mobile Extensions for the UWP + + + + 14.0 + + + + \ No newline at end of file diff --git a/Samples/DeviceLockdownAzureLogin/cs/DeviceLockdownAzureLogin.sln b/Samples/DeviceLockdownAzureLogin/cs/DeviceLockdownAzureLogin.sln new file mode 100644 index 0000000000..8b53b9ea75 --- /dev/null +++ b/Samples/DeviceLockdownAzureLogin/cs/DeviceLockdownAzureLogin.sln @@ -0,0 +1,40 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.22823.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeviceLockdownAzureLogin", "DeviceLockdownAzureLogin.csproj", "{DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|ARM.ActiveCfg = Debug|ARM + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|ARM.Build.0 = Debug|ARM + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|ARM.Deploy.0 = Debug|ARM + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x64.ActiveCfg = Debug|x64 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x64.Build.0 = Debug|x64 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x64.Deploy.0 = Debug|x64 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x86.ActiveCfg = Debug|x86 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x86.Build.0 = Debug|x86 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Debug|x86.Deploy.0 = Debug|x86 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|ARM.ActiveCfg = Release|ARM + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|ARM.Build.0 = Release|ARM + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|ARM.Deploy.0 = Release|ARM + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x64.ActiveCfg = Release|x64 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x64.Build.0 = Release|x64 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x64.Deploy.0 = Release|x64 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x86.ActiveCfg = Release|x86 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x86.Build.0 = Release|x86 + {DC30CE66-DAEE-4CCF-BD02-8837FE918B6F}.Release|x86.Deploy.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Samples/DeviceLockdownAzureLogin/cs/Package.appxmanifest b/Samples/DeviceLockdownAzureLogin/cs/Package.appxmanifest new file mode 100644 index 0000000000..b66b53aa6f --- /dev/null +++ b/Samples/DeviceLockdownAzureLogin/cs/Package.appxmanifest @@ -0,0 +1,51 @@ + + + + + + + + + Device Lockdown with Azure Login C# Sample + Microsoft Corporation + Assets\StoreLogo-sdk.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/DeviceLockdownAzureLogin/cs/SampleConfiguration.cs b/Samples/DeviceLockdownAzureLogin/cs/SampleConfiguration.cs new file mode 100644 index 0000000000..d6ab0f7e2a --- /dev/null +++ b/Samples/DeviceLockdownAzureLogin/cs/SampleConfiguration.cs @@ -0,0 +1,33 @@ +//********************************************************* +// +// Copyright (c) Microsoft. All rights reserved. +// This code is licensed under the MIT License (MIT). +// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF +// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY +// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR +// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. +// +//********************************************************* + +using System; +using System.Collections.Generic; +using Windows.UI.Xaml.Controls; + +namespace SDKTemplate +{ + public partial class MainPage : Page + { + public const string FEATURE_NAME = "Device Lockdown with Azure Login C# Sample"; + + List scenarios = new List + { + new Scenario() { Title="Sign in and out", ClassType=typeof(Scenario1_SignIn)}, + }; + } + + public class Scenario + { + public string Title { get; set; } + public Type ClassType { get; set; } + } +} diff --git a/Samples/DeviceLockdownAzureLogin/cs/Scenario1_SignIn.xaml b/Samples/DeviceLockdownAzureLogin/cs/Scenario1_SignIn.xaml new file mode 100644 index 0000000000..aa0911cdf4 --- /dev/null +++ b/Samples/DeviceLockdownAzureLogin/cs/Scenario1_SignIn.xaml @@ -0,0 +1,41 @@ + + + + + + + + + Sign In and Out + + + + + + + + +

diff --git a/Samples/FeedReader/js/pages/feed/feed.html b/Samples/FeedReader/js/pages/feed/feed.html index 4d893829b4..09e20fb348 100644 --- a/Samples/FeedReader/js/pages/feed/feed.html +++ b/Samples/FeedReader/js/pages/feed/feed.html @@ -59,7 +59,6 @@

-

diff --git a/Samples/FeedReader/js/pages/subscriptions/subscriptions.html b/Samples/FeedReader/js/pages/subscriptions/subscriptions.html index 381bd47940..1ad90573a6 100644 --- a/Samples/FeedReader/js/pages/subscriptions/subscriptions.html +++ b/Samples/FeedReader/js/pages/subscriptions/subscriptions.html @@ -51,7 +51,6 @@

-

Subscriptions

diff --git a/Samples/FileAccess/README.md b/Samples/FileAccess/README.md index cccf1c6374..07ff53055b 100644 --- a/Samples/FileAccess/README.md +++ b/Samples/FileAccess/README.md @@ -1,6 +1,6 @@ # File access sample diff --git a/Samples/FilePicker/README.md b/Samples/FilePicker/README.md index fc8e4f061a..78d167512f 100644 --- a/Samples/FilePicker/README.md +++ b/Samples/FilePicker/README.md @@ -1,6 +1,6 @@ # File picker sample diff --git a/Samples/FilePickerContracts/README.md b/Samples/FilePickerContracts/README.md index dcb94e8129..3728fdc3f4 100644 --- a/Samples/FilePickerContracts/README.md +++ b/Samples/FilePickerContracts/README.md @@ -1,6 +1,6 @@ # File picker provider sample diff --git a/Samples/FileSearch/README.md b/Samples/FileSearch/README.md index 9a2b524e67..2e82770c2c 100644 --- a/Samples/FileSearch/README.md +++ b/Samples/FileSearch/README.md @@ -1,6 +1,6 @@ # File search sample diff --git a/Samples/FileThumbnails/README.md b/Samples/FileThumbnails/README.md index 5f68412ce9..4e12a691e2 100644 --- a/Samples/FileThumbnails/README.md +++ b/Samples/FileThumbnails/README.md @@ -1,6 +1,6 @@ # File and folder thumbnail sample diff --git a/Samples/FolderEnumeration/README.md b/Samples/FolderEnumeration/README.md index ef82f84d6a..3360487b46 100644 --- a/Samples/FolderEnumeration/README.md +++ b/Samples/FolderEnumeration/README.md @@ -1,6 +1,6 @@ # Folder enumeration sample diff --git a/Samples/FullScreenMode/README.md b/Samples/FullScreenMode/README.md index bb0a4e1b82..652d9657b0 100644 --- a/Samples/FullScreenMode/README.md +++ b/Samples/FullScreenMode/README.md @@ -1,6 +1,6 @@ # Full screen mode sample diff --git a/Samples/Geolocation/README.md b/Samples/Geolocation/README.md index 3443c1ea25..8dcdf0e7f8 100644 --- a/Samples/Geolocation/README.md +++ b/Samples/Geolocation/README.md @@ -1,6 +1,6 @@ # Geolocation sample diff --git a/Samples/Geotag/README.md b/Samples/Geotag/README.md index e0c27208b7..9f12446f65 100644 --- a/Samples/Geotag/README.md +++ b/Samples/Geotag/README.md @@ -1,6 +1,6 @@  # Geotag sample diff --git a/Samples/GlobalizationPreferences/README.md b/Samples/GlobalizationPreferences/README.md index b8de095223..e3662da4cc 100644 --- a/Samples/GlobalizationPreferences/README.md +++ b/Samples/GlobalizationPreferences/README.md @@ -1,6 +1,6 @@ # Globalization preferences sample diff --git a/Samples/Gyrometer/README.md b/Samples/Gyrometer/README.md index f4dafc8ec7..a1d2c577fe 100644 --- a/Samples/Gyrometer/README.md +++ b/Samples/Gyrometer/README.md @@ -1,6 +1,6 @@ # Gyrometer sample diff --git a/Samples/HomeGroup/README.md b/Samples/HomeGroup/README.md index f36168f737..db7424a1f5 100644 --- a/Samples/HomeGroup/README.md +++ b/Samples/HomeGroup/README.md @@ -1,6 +1,6 @@ # HomeGroup sample diff --git a/Samples/HtmlFormValidation/README.md b/Samples/HtmlFormValidation/README.md index d57b8171c9..da9bb00606 100644 --- a/Samples/HtmlFormValidation/README.md +++ b/Samples/HtmlFormValidation/README.md @@ -1,6 +1,6 @@ # Form validation (HTML) sample diff --git a/Samples/HttpClient/README.md b/Samples/HttpClient/README.md index 2d56842ad2..343c9355d9 100644 --- a/Samples/HttpClient/README.md +++ b/Samples/HttpClient/README.md @@ -1,6 +1,6 @@ # HttpClient sample diff --git a/Samples/Inclinometer/README.md b/Samples/Inclinometer/README.md index 67fe70bee8..abf1b99633 100644 --- a/Samples/Inclinometer/README.md +++ b/Samples/Inclinometer/README.md @@ -1,6 +1,6 @@ # Inclinometer sample diff --git a/Samples/IndexedDB/README.md b/Samples/IndexedDB/README.md index 1bbde0b95b..58ac5b0bc5 100644 --- a/Samples/IndexedDB/README.md +++ b/Samples/IndexedDB/README.md @@ -1,6 +1,6 @@ # IndexedDB sample diff --git a/Samples/Ink/README.md b/Samples/Ink/README.md index 4080676be9..388fc96dc0 100644 --- a/Samples/Ink/README.md +++ b/Samples/Ink/README.md @@ -1,6 +1,6 @@  # Inking sample diff --git a/Samples/IoT-GPIO/README.md b/Samples/IoT-GPIO/README.md index 5ef21605d9..04a97d2c14 100644 --- a/Samples/IoT-GPIO/README.md +++ b/Samples/IoT-GPIO/README.md @@ -1,6 +1,6 @@ # General Purpose Input/Output (GPIO) sample diff --git a/Samples/IoT-I2C/README.md b/Samples/IoT-I2C/README.md index 293fff550d..541a93c312 100644 --- a/Samples/IoT-I2C/README.md +++ b/Samples/IoT-I2C/README.md @@ -1,6 +1,6 @@ # Inter-Integrated Circuit (I2C) sample diff --git a/Samples/IoT-SPI/README.md b/Samples/IoT-SPI/README.md index 66f577d454..2c4ac33e02 100644 --- a/Samples/IoT-SPI/README.md +++ b/Samples/IoT-SPI/README.md @@ -1,6 +1,6 @@ # Serial Peripheral Interface (SPI) sample diff --git a/Samples/JapanesePhoneticAnalysis/README.md b/Samples/JapanesePhoneticAnalysis/README.md index d61c11f055..ff5f9e8d1e 100644 --- a/Samples/JapanesePhoneticAnalysis/README.md +++ b/Samples/JapanesePhoneticAnalysis/README.md @@ -1,6 +1,6 @@ # Japanese phonetic analysis sample diff --git a/Samples/Json/README.md b/Samples/Json/README.md index 1415f18ae3..52631d6f54 100644 --- a/Samples/Json/README.md +++ b/Samples/Json/README.md @@ -1,6 +1,6 @@ # JSON sample diff --git a/Samples/KeyCredentialManager/README.md b/Samples/KeyCredentialManager/README.md index d7ab4a8d9a..bb220d2c27 100644 --- a/Samples/KeyCredentialManager/README.md +++ b/Samples/KeyCredentialManager/README.md @@ -1,6 +1,6 @@ # KeyCredentialManager sample diff --git a/Samples/LampDevice/README.md b/Samples/LampDevice/README.md index ff0579545b..2ca2b9def2 100644 --- a/Samples/LampDevice/README.md +++ b/Samples/LampDevice/README.md @@ -1,6 +1,6 @@ # Lamp device sample diff --git a/Samples/LanguageFont/README.md b/Samples/LanguageFont/README.md index aebfb31027..beb36f5cfb 100644 --- a/Samples/LanguageFont/README.md +++ b/Samples/LanguageFont/README.md @@ -1,6 +1,6 @@ # Language font mapping sample diff --git a/Samples/LibraryManagement/README.md b/Samples/LibraryManagement/README.md index 0f663fc5ec..be248cb3da 100644 --- a/Samples/LibraryManagement/README.md +++ b/Samples/LibraryManagement/README.md @@ -1,6 +1,6 @@ # Library management sample diff --git a/Samples/LightSensor/README.md b/Samples/LightSensor/README.md index 2af595b14b..965e63f5a7 100644 --- a/Samples/LightSensor/README.md +++ b/Samples/LightSensor/README.md @@ -1,6 +1,6 @@ # Light sensor sample diff --git a/Samples/LinguisticServices/README.md b/Samples/LinguisticServices/README.md index 429193c204..af3705a874 100644 --- a/Samples/LinguisticServices/README.md +++ b/Samples/LinguisticServices/README.md @@ -1,6 +1,6 @@ # Linguistic services sample diff --git a/Samples/LiveDash/README.md b/Samples/LiveDash/README.md index 21b7c32737..74732b7fc3 100644 --- a/Samples/LiveDash/README.md +++ b/Samples/LiveDash/README.md @@ -1,6 +1,6 @@ # DASH streaming sample diff --git a/Samples/LockScreenApps/README.md b/Samples/LockScreenApps/README.md index 3b11324bc6..5689a96512 100644 --- a/Samples/LockScreenApps/README.md +++ b/Samples/LockScreenApps/README.md @@ -1,6 +1,6 @@ # Lock screen apps sample diff --git a/Samples/Logging/README.md b/Samples/Logging/README.md index 63977c8287..11ccfc343f 100644 --- a/Samples/Logging/README.md +++ b/Samples/Logging/README.md @@ -1,6 +1,6 @@ # Logging sample diff --git a/Samples/LowLatencyInput/README.md b/Samples/LowLatencyInput/README.md index 4b274381ba..f7ecd8ed29 100644 --- a/Samples/LowLatencyInput/README.md +++ b/Samples/LowLatencyInput/README.md @@ -1,6 +1,6 @@ # Low latency input sample diff --git a/Samples/MIDI/README.md b/Samples/MIDI/README.md index 75ed6edd3f..c5f8965ef4 100644 --- a/Samples/MIDI/README.md +++ b/Samples/MIDI/README.md @@ -1,6 +1,6 @@ # MIDI sample diff --git a/Samples/MagneticStripeReader/README.md b/Samples/MagneticStripeReader/README.md index 78201156b2..eb398e7b8a 100644 --- a/Samples/MagneticStripeReader/README.md +++ b/Samples/MagneticStripeReader/README.md @@ -1,6 +1,6 @@ # Magnetic stripe reader sample diff --git a/Samples/MapControl/README.md b/Samples/MapControl/README.md index 79f591c806..fb137bb0b0 100644 --- a/Samples/MapControl/README.md +++ b/Samples/MapControl/README.md @@ -1,6 +1,6 @@ # MapControl sample diff --git a/Samples/MediaEditing/README.md b/Samples/MediaEditing/README.md index 2b0ad35cbe..fabf5cdaa4 100644 --- a/Samples/MediaEditing/README.md +++ b/Samples/MediaEditing/README.md @@ -1,6 +1,6 @@ # Media editing sample diff --git a/Samples/MediaImport/README.md b/Samples/MediaImport/README.md index a946d6c532..55df0d3809 100644 --- a/Samples/MediaImport/README.md +++ b/Samples/MediaImport/README.md @@ -1,6 +1,6 @@ # Windows media import sample diff --git a/Samples/MediaTranscoding/README.md b/Samples/MediaTranscoding/README.md index 68a786f7e8..0c96e429a7 100644 --- a/Samples/MediaTranscoding/README.md +++ b/Samples/MediaTranscoding/README.md @@ -1,6 +1,6 @@ # Transcoding media sample diff --git a/Samples/MessageDialog/README.md b/Samples/MessageDialog/README.md index 9cf49b41fc..26f9ca0e03 100644 --- a/Samples/MessageDialog/README.md +++ b/Samples/MessageDialog/README.md @@ -1,6 +1,6 @@ # Message dialog sample diff --git a/Samples/MobileBroadband/README.md b/Samples/MobileBroadband/README.md index 6027d62e3f..4bc379669b 100644 --- a/Samples/MobileBroadband/README.md +++ b/Samples/MobileBroadband/README.md @@ -1,6 +1,6 @@ # Mobile broadband sample diff --git a/Samples/MsBlobBuilder/README.md b/Samples/MsBlobBuilder/README.md index 68b4bc5a25..afbe1f8360 100644 --- a/Samples/MsBlobBuilder/README.md +++ b/Samples/MsBlobBuilder/README.md @@ -1,6 +1,6 @@ # Blobs sample diff --git a/Samples/MultipleViews/README.md b/Samples/MultipleViews/README.md index 8ca3289728..af30e2cf25 100644 --- a/Samples/MultipleViews/README.md +++ b/Samples/MultipleViews/README.md @@ -1,6 +1,6 @@ # Multiple views sample diff --git a/Samples/MultipleViews/cs/Scenario3.xaml b/Samples/MultipleViews/cs/Scenario3.xaml index a2199a3c99..7bdc313899 100644 --- a/Samples/MultipleViews/cs/Scenario3.xaml +++ b/Samples/MultipleViews/cs/Scenario3.xaml @@ -35,10 +35,11 @@ - The system normally provides a subtle animation when views are switched in place, as can be seen in SecondaryPage.xaml. You may provide, though, custom animations when switching between views. + The system provides a default animation when views are switched in place, as can be seen in SecondaryPage.xaml. + Some device families allow you to provide a custom animation when switching between views. You should run this scenario by launching the app from Start instead of from Visual Studio since Visual Studio disables system animations while debugging. - Create a window in Scenario 1, then switch to it here to see a custom animation. + Create a window in Scenario 1, then switch to it here to see a custom animation, if supported. + +

+
+ + +
+ + + \ No newline at end of file diff --git a/Samples/PdfDocument/js/images/placeholder.txt b/Samples/PdfDocument/js/images/placeholder.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Samples/PdfDocument/js/js/sample-configuration.js b/Samples/PdfDocument/js/js/sample-configuration.js new file mode 100644 index 0000000000..144c17002c --- /dev/null +++ b/Samples/PdfDocument/js/js/sample-configuration.js @@ -0,0 +1,16 @@ +//// Copyright (c) Microsoft Corporation. All rights reserved + +(function () { + "use strict"; + + var sampleTitle = "Resize app view"; + + var scenarios = [ + { url: "/html/scenario1-render.html", title: "Render document" }, + ]; + + WinJS.Namespace.define("SdkSample", { + sampleTitle: sampleTitle, + scenarios: new WinJS.Binding.List(scenarios) + }); +})(); \ No newline at end of file diff --git a/Samples/PdfDocument/js/js/scenario1-render.js b/Samples/PdfDocument/js/js/scenario1-render.js new file mode 100644 index 0000000000..cdd69975f9 --- /dev/null +++ b/Samples/PdfDocument/js/js/scenario1-render.js @@ -0,0 +1,136 @@ +//// Copyright (c) Microsoft Corporation. All rights reserved + +(function () { + "use strict"; + + var PdfDocument = Windows.Data.Pdf.PdfDocument; + var PdfPage = Windows.Data.Pdf.PdfPage; + var PdfPageRenderOptions = Windows.Data.Pdf.PdfPageRenderOptions; + + var pdfDocument; + var loadButton; + var passwordBox; + var renderingPanel; + var pageNumberBox; + var pageCountText; + var output; + var progressControl; + + // Use "| 0" to coerce to a 32-bit signed integer. + var WrongPassword = 0x8007052b | 0; // HRESULT_FROM_WIN32(ERROR_WRONG_PASSWORD) + var GenericFail = 0x80004005 | 0; // E_FAIL + + var page = WinJS.UI.Pages.define("/html/scenario1-render.html", { + ready: function (element, options) { + loadButton = document.getElementById("loadButton"); + passwordBox = document.getElementById("passwordBox"); + renderingPanel = document.getElementById("renderingPanel"); + pageNumberBox = document.getElementById("pageNumberBox"); + pageCountText = document.getElementById("pageCountText"); + output = document.getElementById("output"); + progressControl = document.getElementById("progressControl"); + + loadButton.addEventListener("click", loadPdfDocument); + document.getElementById("viewPageButton").addEventListener("click", viewPage); + } + }); + + function loadPdfDocument() { + loadButton.disabled = true; + pdfDocument = null; + output.src = ""; + pageNumberBox.value = 1; + renderingPanel.style.display = "none"; + WinJS.log && WinJS.log("", "sample", "status"); + + var picker = new Windows.Storage.Pickers.FileOpenPicker(); + picker.fileTypeFilter.append(".pdf"); + picker.pickSingleFileAsync().then(function (file) { + if (file) { + progressControl.style.display = "block"; + return PdfDocument.loadFromFileAsync(file, passwordBox.value); + } + }).then(function (doc) { + pdfDocument = doc; + if (pdfDocument) { + renderingPanel.style.display = "block"; + if (pdfDocument.isPasswordProtected) { + WinJS.log && WinJS.log("Document is password protected.", "sample", "status"); + } else { + WinJS.log && WinJS.log("Document is not password protected.", "sample", "status"); + } + pageCountText.innerText = pdfDocument.pageCount; + } + }, function (error) { + switch (error.number) { + case WrongPassword: + WinJS.log && WinJS.log("Document is password-protected and password is incorrect.", "sample", "error"); + break; + case GenericFail: + WinJS.log && WinJS.log("Document is not a valid PDF.", "sample", "error"); + break; + default: + // File I/O errors are reported as exceptions. + WinJS.log && WinJS.log(error.message, "sample", "error"); + break; + } + }).done(function () { + progressControl.style.display = "none"; + loadButton.disabled = false; + }); + } + + function viewPage() { + WinJS.log && WinJS.log("", "sample", "status"); + + var pageNumber = parseInt(pageNumberBox.value, 10); + if (isNaN(pageNumber) || (pageNumber < 1) || (pageNumber > pdfDocument.pageCount)) { + WinJS.log && WinJS.log("Invalid page number.", "sample", "error"); + return; + } + + output.src = ""; + progressControl.style.display = "block"; + + // Convert from 1-based page number to 0-based page index. + var pageIndex = pageNumber - 1; + + var page = pdfDocument.getPage(pageIndex); + + var stream = new Windows.Storage.Streams.InMemoryRandomAccessStream(); + + var renderPromise; + + switch (options.selectedIndex) { + // View actual size. + case 0: + renderPromise = page.renderToStreamAsync(stream); + break; + + // View half size on beige background. + case 1: + var options1 = new PdfPageRenderOptions(); + options1.backgroundColor = Windows.UI.Colors.beige; + options1.destinationHeight = page.size.height / 2; + options1.destinationWidth = page.size.width / 2; + renderPromise = page.renderToStreamAsync(stream, options1); + break; + + // Crop to center. + case 2: + var options2 = new PdfPageRenderOptions(); + var rect = page.dimensions.trimBox; + options2.sourceRect = { x: rect.x + rect.width / 4, y: rect.y + rect.height / 4, width: rect.width / 2, height: rect.height / 2 }; + renderPromise = page.renderToStreamAsync(stream, options2); + break; + } + + renderPromise.done(function () { + // Put the stream in the image. + var blob = MSApp.createBlobFromRandomAccessStream("image/png", stream); + output.src = URL.createObjectURL(blob, { oneTimeOnly: true }); + + progressControl.style.display = "none"; + }); + } +})(); \ No newline at end of file diff --git a/Samples/PdfDocument/js/sample-utils/placeholder.txt b/Samples/PdfDocument/js/sample-utils/placeholder.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Samples/PdfDocument/shared/Scenario1_Render.xaml b/Samples/PdfDocument/shared/Scenario1_Render.xaml new file mode 100644 index 0000000000..170aeab35a --- /dev/null +++ b/Samples/PdfDocument/shared/Scenario1_Render.xaml @@ -0,0 +1,54 @@ + + + + + + + + + Loading and rendering a PDF document + + + + VerticalAlignment="Top" + RelativePanel.RightOf="splitViewToggle" /> - { - NavigationRootPage.RootFrame.GoBack(); - }, () => - { - return NavigationRootPage.RootFrame != null && - NavigationRootPage.RootFrame.CanGoBack; - }); - } - return _goBackCommand; - } - } - public PageHeader() { this.InitializeComponent(); - - if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) - { - //Remove the backbutton because physical buttons are present - backButton.Visibility = Visibility.Collapsed; - } } private async void controlsSearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args) diff --git a/Samples/XmlDocument/README.md b/Samples/XmlDocument/README.md index af36ef93f6..b386b974d7 100644 --- a/Samples/XmlDocument/README.md +++ b/Samples/XmlDocument/README.md @@ -1,6 +1,6 @@ # XML DOM sample diff --git a/Samples/XmlLite/README.md b/Samples/XmlLite/README.md index b2627fad80..dd30e2cc4f 100644 --- a/Samples/XmlLite/README.md +++ b/Samples/XmlLite/README.md @@ -1,6 +1,6 @@ # XmlLite sample