Skip to content

Commit

Permalink
Windows 10 build 14295 - April 2016 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnewthing committed Apr 20, 2016
2 parents 8d87fe8 + beb665e commit 2d48b04
Show file tree
Hide file tree
Showing 1,228 changed files with 3,273 additions and 9,903 deletions.
32 changes: 15 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,58 +146,56 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
<td><a href="Samples/XamlAutoSuggestBox">AutoSuggestBox migration</a></td>
</tr>
<tr>
<td><a href="Samples/XamlBottomUpList">Bottom-up list (XAML)</a></td>
<td><a href="Samples/Clipboard">Clipboard</a></td>
<td><a href="Samples/XamlCommanding">Commanding</a></td>
<td><a href="Samples/ContextMenu">Context menu</a></td>
</tr>
<tr>
<td><a href="Samples/ContextMenu">Context menu</a></td>
<td><a href="Samples/XamlContextMenu">Context menu (XAML)</a></td>
<td><a href="Samples/XamlDataVirtualization">Data virtualization</a></td>
<td><a href="Samples/UserSelection">Disabling selection</a></td>
</tr>
<tr>
<td><a href="Samples/UserSelection">Disabling selection</a></td>
<td><a href="Samples/DisplayOrientation">Display orientation</a></td>
<td><a href="Samples/DWriteTextLayoutCloudFont">Downloadable fonts (DirectWrite)</a></td>
<td><a href="Samples/XamlCloudFontIntegration">Downloadable fonts (XAML)</a></td>
</tr>
<tr>
<td><a href="Samples/XamlCloudFontIntegration">Downloadable fonts (XAML)</a></td>
<td><a href="Samples/XamlDragAndDrop">Drag and drop</a></td>
<td><a href="Samples/XamlFocusVisuals">Focus visuals</a></td>
<td><a href="Samples/FullScreenMode">Full screen mode</a></td>
</tr>
<tr>
<td><a href="Samples/FullScreenMode">Full screen mode</a></td>
<td><a href="Samples/DWriteLineSpacingModes">Line spacing (DirectWrite)</a></td>
<td><a href="Samples/XamlListView">ListView and GridView</a></td>
<td><a href="Samples/LockScreenApps">Lock screen apps</a></td>
</tr>
<tr>
<td><a href="Samples/LockScreenApps">Lock screen apps</a></td>
<td><a href="Samples/MessageDialog">Message dialog</a></td>
<td><a href="Samples/MultipleViews">Multiple views</a></td>
<td><a href="Samples/OCR">OCR</a></td>
</tr>
<tr>
<td><a href="Samples/OCR">OCR</a></td>
<td><a href="Samples/Printing">Printing</a></td>
<td><a href="Samples/XamlPullToRefresh">Pull-to-refresh</a></td>
<td><a href="Samples/XamlResponsiveTechniques">Responsiveness techniques</a></td>
</tr>
<tr>
<td><a href="Samples/XamlResponsiveTechniques">Responsiveness techniques</a></td>
<td><a href="Samples/DpiScaling">Scaling according to DPI</a></td>
<td><a href="Samples/SplashScreen">Splash screen</a></td>
<td><a href="Samples/XamlStateTriggers">State triggers</a></td>
</tr>
<tr>
<td><a href="Samples/XamlStateTriggers">State triggers</a></td>
<td><a href="Samples/XamlTailoredMultipleViews">Tailored multiple views</a></td>
<td><a href="Samples/TitleBar">Title bar</a></td>
</tr>
<tr>
<td><a href="Samples/XamlTreeView">TreeView (XAML)</a></td>
<td><a href="Samples/XamlUIBasics">UI basics (XAML)</a></td>
<td><a href="Samples/UserInteractionMode">User interaction mode</a></td>
</tr>
<tr>
<td><a href="Samples/UserInteractionMode">User interaction mode</a></td>
<td><a href="Samples/WebView">WebView control (HTML)</a></td>
<td><a href="Samples/XamlWebView">WebView control (XAML)</a></td>
</tr>
<tr>
<td><a href="Samples/ResizeAppView">Window resizing</a></td>
</tr>
</table>
Expand Down Expand Up @@ -378,16 +376,17 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.

<table>
<tr>
<td><a href="Samples/XamlAnimatedGif">Animated GIF playback (XAML)</a></td>
<td><a href="Samples/AnimationLibrary">Animation library (HTML)</a></td>
<td><a href="Samples/AnimationMetrics">Animation metrics</a></td>
<td><a href="Samples/CompositionVisual">Composition visual without framework</a></td>
</tr>
<tr>
<td><a href="Samples/CompositionVisual">Composition visual without framework</a></td>
<td><a href="Samples/D2DCustomEffects">Direct2D custom image effects</a></td>
<td><a href="Samples/D2DGradientMesh">Direct2D gradient mesh</a></td>
<td><a href="Samples/EfficientAnimations">Efficient animations (HTML)</a></td>
</tr>
<tr>
<td><a href="Samples/EfficientAnimations">Efficient animations (HTML)</a></td>
<td><a href="Samples/XamlTransform3DAnimations">Transform3D animations</a></td>
<td><a href="Samples/XamlTransform3DParallax">Transform3D parallax</a></td>
</tr>
Expand All @@ -414,10 +413,9 @@ For additional Windows samples, see [Windows on GitHub](http://microsoft.github.
<tr>
<td><a href="Samples/SmartCard">Smart cards</a></td>
<td><a href="Samples/UserInfo">User information</a></td>
<td><a href="Samples/UserCertificateStore">UserCertificateStore</a></td>
<td><a href="Samples/UserConsentVerifier">UserConsentVerifier</a></td>
</tr>
<tr>
<td><a href="Samples/UserConsentVerifier">UserConsentVerifier</a></td>
<td><a href="Samples/WebAccountManagement">Web account management</a></td>
<td><a href="Samples/WebAuthenticationBroker">WebAuthenticationBroker</a></td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion Samples/3DPrinting/cs/3DPrinting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<AssemblyName>SDKTemplate</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.14295.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
Expand Down
2 changes: 1 addition & 1 deletion Samples/3DPrinting/cs/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<Logo>Assets\StoreLogo-sdk.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10586.0" MaxVersionTested="10.0.14295.0"/>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10586.0" MaxVersionTested="10.0.10586.0"/>
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
Expand Down
2 changes: 1 addition & 1 deletion Samples/Accelerometer/cpp/Accelerometer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion>10.0.14295.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/Accelerometer/cpp/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10240.0" MaxVersionTested="10.0.14295.0" />
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.10240.0" MaxVersionTested="10.0.10586.0" />
</Dependencies>

<Resources>
Expand Down
7 changes: 7 additions & 0 deletions Samples/Accelerometer/cpp/SampleConfiguration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ Platform::Array<Scenario>^ MainPage::scenariosInner = ref new Platform::Array<Sc
{ "OrientationChanged", "SDKTemplate.Scenario4_OrientationChanged" },
{ "Data Events Batching", "SDKTemplate.Scenario5_DataEventsBatching" }
};

void MainPage::SetReadingText(Windows::UI::Xaml::Controls::TextBlock^ textBlock, Windows::Devices::Sensors::AccelerometerReading^ reading)
{
textBlock->Text = "X: " + reading->AccelerationX.ToString() +
", Y: " + reading->AccelerationY.ToString() +
", Z: " + reading->AccelerationZ.ToString();
}
2 changes: 2 additions & 0 deletions Samples/Accelerometer/cpp/SampleConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ namespace SDKTemplate
}
}

static void SetReadingText(Windows::UI::Xaml::Controls::TextBlock^ textBlock, Windows::Devices::Sensors::AccelerometerReading^ reading);

private:
static Platform::Array<Scenario>^ scenariosInner;
};
Expand Down
85 changes: 24 additions & 61 deletions Samples/Accelerometer/cpp/Scenario1_DataEvents.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,63 +19,37 @@

using namespace SDKTemplate;

using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Navigation;
using namespace Platform;
using namespace Windows::Devices::Sensors;
using namespace Windows::Foundation;
using namespace Windows::UI::Core;
using namespace Platform;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Navigation;

Scenario1_DataEvents::Scenario1_DataEvents() : rootPage(MainPage::Current), desiredReportInterval(0)
Scenario1_DataEvents::Scenario1_DataEvents()
{
InitializeComponent();
}

void Scenario1_DataEvents::OnNavigatedTo(NavigationEventArgs^ e)
{
accelerometer = Accelerometer::GetDefault();
if (accelerometer != nullptr)
{
// Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
// This value will be used later to activate the sensor.
uint32 minReportInterval = accelerometer->MinimumReportInterval;
desiredReportInterval = minReportInterval > 16 ? minReportInterval : 16;
ScenarioEnableButton->IsEnabled = true;
}
else
{
rootPage->NotifyUser("No accelerometer found", NotifyType::ErrorMessage);
rootPage->NotifyUser("No accelerometer not found", NotifyType::ErrorMessage);
}
}

/// <summary>
/// Invoked when this page is about to be displayed in a Frame.
/// </summary>
/// <param name="e">Event data that describes how this page was reached. The Parameter
/// property is typically used to configure the page.</param>
void Scenario1_DataEvents::OnNavigatedTo(NavigationEventArgs^ e)
{
ScenarioEnableButton->IsEnabled = true;
ScenarioDisableButton->IsEnabled = false;
}

/// <summary>
/// Invoked when this page is no longer displayed.
/// </summary>
/// <param name="e"></param>
void Scenario1_DataEvents::OnNavigatedFrom(NavigationEventArgs^ e)
{
// If the navigation is external to the app do not clean up.
// This can occur on Phone when suspending the app.
if (e->NavigationMode == NavigationMode::Forward && e->Uri == nullptr)
{
return;
}

if (ScenarioDisableButton->IsEnabled)
{
Window::Current->VisibilityChanged::remove(visibilityToken);
accelerometer->ReadingChanged::remove(readingToken);

// Restore the default report interval to release resources while the sensor is not in use
accelerometer->ReportInterval = 0;
ScenarioDisable();
}
}

Expand All @@ -95,12 +69,12 @@ void Scenario1_DataEvents::VisibilityChanged(Object^ sender, VisibilityChangedEv
if (e->Visible)
{
// Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
readingToken = accelerometer->ReadingChanged::add(ref new TypedEventHandler<Accelerometer^, AccelerometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged));
readingToken = accelerometer->ReadingChanged += ref new TypedEventHandler<Accelerometer^, AccelerometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged);
}
else
{
// Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
accelerometer->ReadingChanged::remove(readingToken);
accelerometer->ReadingChanged -= readingToken;
}
}
}
Expand All @@ -113,40 +87,29 @@ void Scenario1_DataEvents::ReadingChanged(Accelerometer^ sender, AccelerometerRe
ref new DispatchedHandler(
[this, e]()
{
AccelerometerReading^ reading = e->Reading;

ScenarioOutput_X->Text = reading->AccelerationX.ToString();
ScenarioOutput_Y->Text = reading->AccelerationY.ToString();
ScenarioOutput_Z->Text = reading->AccelerationZ.ToString();
MainPage::SetReadingText(ScenarioOutput, e->Reading);
},
CallbackContext::Any
)
);
}

void Scenario1_DataEvents::ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
void Scenario1_DataEvents::ScenarioEnable()
{
if (accelerometer != nullptr)
{
// Establish the report interval
accelerometer->ReportInterval = desiredReportInterval;
// Select a report interval that is both suitable for the purposes of the app and supported by the sensor.
accelerometer->ReportInterval = (std::max)(accelerometer->MinimumReportInterval, 16U);

visibilityToken = Window::Current->VisibilityChanged::add(ref new WindowVisibilityChangedEventHandler(this, &Scenario1_DataEvents::VisibilityChanged));
readingToken = accelerometer->ReadingChanged::add(ref new TypedEventHandler<Accelerometer^, AccelerometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged));
visibilityToken = Window::Current->VisibilityChanged += ref new WindowVisibilityChangedEventHandler(this, &Scenario1_DataEvents::VisibilityChanged);
readingToken = accelerometer->ReadingChanged += ref new TypedEventHandler<Accelerometer^, AccelerometerReadingChangedEventArgs^>(this, &Scenario1_DataEvents::ReadingChanged);

ScenarioEnableButton->IsEnabled = false;
ScenarioDisableButton->IsEnabled = true;
}
else
{
rootPage->NotifyUser("No accelerometer found", NotifyType::ErrorMessage);
}
ScenarioEnableButton->IsEnabled = false;
ScenarioDisableButton->IsEnabled = true;
}

void Scenario1_DataEvents::ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
void Scenario1_DataEvents::ScenarioDisable()
{
Window::Current->VisibilityChanged::remove(visibilityToken);
accelerometer->ReadingChanged::remove(readingToken);
Window::Current->VisibilityChanged -= visibilityToken;
accelerometer->ReadingChanged -= readingToken;

// Restore the default report interval to release resources while the sensor is not in use
accelerometer->ReportInterval = 0;
Expand Down
8 changes: 4 additions & 4 deletions Samples/Accelerometer/cpp/Scenario1_DataEvents.xaml.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ namespace SDKTemplate
virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
virtual void OnNavigatedFrom(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;

void ScenarioEnable();
void ScenarioDisable();

private:
SDKTemplate::MainPage^ rootPage;
SDKTemplate::MainPage^ rootPage = MainPage::Current;
Windows::Devices::Sensors::Accelerometer^ accelerometer;
Windows::Foundation::EventRegistrationToken visibilityToken;
Windows::Foundation::EventRegistrationToken readingToken;
uint32 desiredReportInterval;

void VisibilityChanged(Platform::Object^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ e);
void ReadingChanged(Windows::Devices::Sensors::Accelerometer^ sender, Windows::Devices::Sensors::AccelerometerReadingChangedEventArgs^ e);
void ScenarioEnable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void ScenarioDisable(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
};
}
Loading

0 comments on commit 2d48b04

Please sign in to comment.