diff --git a/Samples/BackgroundActivation/README.md b/Samples/BackgroundActivation/README.md
index 3a194c722d..1b44c7ab33 100644
--- a/Samples/BackgroundActivation/README.md
+++ b/Samples/BackgroundActivation/README.md
@@ -30,6 +30,7 @@ This sample demonstrates the following:
- Using a deferral object to include asynchronous code in your background task.
- Handling the cancellation of a background task, and ensuring the task is cancelled when required conditions are no longer met.
- Initializing background task progress and completion handlers when the app is launched.
+- Registering a background task in a Background Task Registration Group.
This sample uses the Single Process Model method for background activity. Applications can also use the Multiple Process Model method for running Background Tasks in a separate process from the foreground application.
diff --git a/Samples/BackgroundActivation/cpp/BackgroundActivation.vcxproj b/Samples/BackgroundActivation/cpp/BackgroundActivation.vcxproj
index a09182a2c3..a4c9c3009b 100644
--- a/Samples/BackgroundActivation/cpp/BackgroundActivation.vcxproj
+++ b/Samples/BackgroundActivation/cpp/BackgroundActivation.vcxproj
@@ -164,6 +164,9 @@
..\shared\Scenario5_ApplicationTriggerTask.xaml
+
+ ..\shared\Scenario6_GroupedTask.xaml
+
@@ -177,6 +180,7 @@
+
Styles\Styles.xaml
@@ -218,6 +222,9 @@
..\shared\Scenario5_ApplicationTriggerTask.xaml
+
+ ..\shared\Scenario6_GroupedTask.xaml
+
diff --git a/Samples/BackgroundActivation/cpp/BackgroundActivation.vcxproj.filters b/Samples/BackgroundActivation/cpp/BackgroundActivation.vcxproj.filters
index ccef0cf5b2..6af32c79a8 100644
--- a/Samples/BackgroundActivation/cpp/BackgroundActivation.vcxproj.filters
+++ b/Samples/BackgroundActivation/cpp/BackgroundActivation.vcxproj.filters
@@ -23,10 +23,11 @@
+
-
+
@@ -35,6 +36,7 @@
+
@@ -49,6 +51,7 @@
+
diff --git a/Samples/BackgroundActivation/cpp/BackgroundActivity.cpp b/Samples/BackgroundActivation/cpp/BackgroundActivity.cpp
index bfb0894472..17e4113e21 100644
--- a/Samples/BackgroundActivation/cpp/BackgroundActivity.cpp
+++ b/Samples/BackgroundActivation/cpp/BackgroundActivity.cpp
@@ -13,6 +13,7 @@
#include "BackgroundActivity.h"
using namespace SDKTemplate;
+using namespace Windows::ApplicationModel::Activation;
using namespace Windows::ApplicationModel::Background;
using namespace Windows::Foundation;
using namespace Windows::Storage;
@@ -81,6 +82,11 @@ void BackgroundActivity::OnCanceled(IBackgroundTaskInstance^ taskInstance, Backg
CancelReason = reason;
}
+void BackgroundActivity::OnStart(BackgroundTaskRegistrationGroup^ sender, BackgroundActivatedEventArgs^ args)
+{
+ Start(args->TaskInstance);
+}
+
void BackgroundActivity::Start(IBackgroundTaskInstance^ taskInstance)
{
// Use the taskInstance->Name and/or taskInstance->InstanceId to determine
diff --git a/Samples/BackgroundActivation/cpp/BackgroundActivity.h b/Samples/BackgroundActivation/cpp/BackgroundActivity.h
index c4d3d25e25..41e4f702f2 100644
--- a/Samples/BackgroundActivation/cpp/BackgroundActivity.h
+++ b/Samples/BackgroundActivation/cpp/BackgroundActivity.h
@@ -19,6 +19,7 @@ namespace SDKTemplate
void Run(Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance);
void OnCanceled(Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance, Windows::ApplicationModel::Background::BackgroundTaskCancellationReason reason);
+ static void OnStart(Windows::ApplicationModel::Background::BackgroundTaskRegistrationGroup^ sender, Windows::ApplicationModel::Activation::BackgroundActivatedEventArgs^ args);
static void Start(Windows::ApplicationModel::Background::IBackgroundTaskInstance^ taskInstance);
private:
Windows::ApplicationModel::Background::BackgroundTaskCancellationReason CancelReason = Windows::ApplicationModel::Background::BackgroundTaskCancellationReason::Abort;
diff --git a/Samples/BackgroundActivation/cpp/SampleConfiguration.cpp b/Samples/BackgroundActivation/cpp/SampleConfiguration.cpp
index 2ea014ce0d..6419edac0f 100644
--- a/Samples/BackgroundActivation/cpp/SampleConfiguration.cpp
+++ b/Samples/BackgroundActivation/cpp/SampleConfiguration.cpp
@@ -16,6 +16,7 @@
using namespace SDKTemplate;
using namespace Windows::ApplicationModel;
using namespace Windows::ApplicationModel::Activation;
+using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
String^ BackgroundTaskSample::SampleBackgroundTaskProgress = "";
@@ -34,6 +35,10 @@ String^ BackgroundTaskSample::ApplicationTriggerTaskProgress = "";
bool BackgroundTaskSample::ApplicationTriggerTaskRegistered = false;
String^ BackgroundTaskSample::ApplicationTriggerTaskResult = "";
+String^ BackgroundTaskSample::GroupedBackgroundTaskProgress = "";
+bool BackgroundTaskSample::GroupedBackgroundTaskRegistered = false;
+
+
PropertySet^ BackgroundTaskSample::TaskStatuses = ref new PropertySet();
Array^ MainPage::scenariosInner = ref new Array
@@ -44,7 +49,8 @@ Array^ MainPage::scenariosInner = ref new Array
{ "Background task with a condition", "SDKTemplate.SampleBackgroundTaskWithCondition" },
{ "Servicing complete task", "SDKTemplate.ServicingCompleteTask" },
{ "Background task with time trigger", "SDKTemplate.TimeTriggeredTask" },
- { "Background task with application trigger", "SDKTemplate.ApplicationTriggerTask" }
+ { "Background task with application trigger", "SDKTemplate.ApplicationTriggerTask" },
+ { "Grouped background task", "SDKTemplate.GroupedBackgroundTask" },
};
String^ BackgroundTaskSample::GetBackgroundTaskStatus(String^ name)
@@ -70,6 +76,10 @@ String^ BackgroundTaskSample::GetBackgroundTaskStatus(String^ name)
{
registered = BackgroundTaskSample::ApplicationTriggerTaskRegistered;
}
+ else if (name == GroupedBackgroundTaskName)
+ {
+ registered = BackgroundTaskSample::GroupedBackgroundTaskRegistered;
+ }
String^ status = registered ? "Registered" : "Unregistered";
@@ -81,7 +91,7 @@ String^ BackgroundTaskSample::GetBackgroundTaskStatus(String^ name)
return status;
}
-BackgroundTaskRegistration^ BackgroundTaskSample::RegisterBackgroundTask(String^ taskEntryPoint, String^ name, IBackgroundTrigger^ trigger, IBackgroundCondition^ condition)
+BackgroundTaskRegistration^ BackgroundTaskSample::RegisterBackgroundTask(String^ taskEntryPoint, String^ name, IBackgroundTrigger^ trigger, IBackgroundCondition^ condition, BackgroundTaskRegistrationGroup^ group)
{
if (TaskRequiresBackgroundAccess(name))
{
@@ -112,6 +122,11 @@ BackgroundTaskRegistration^ BackgroundTaskSample::RegisterBackgroundTask(String^
builder->CancelOnConditionLoss = true;
}
+ if (group != nullptr)
+ {
+ builder->TaskGroup = group;
+ }
+
auto task = builder->Register();
UpdateBackgroundTaskRegistrationStatus(name, true);
@@ -137,28 +152,55 @@ bool BackgroundTaskSample::TaskRequiresBackgroundAccess(String^ name)
}
}
-void BackgroundTaskSample::UnregisterBackgroundTasks(String^ name)
+void BackgroundTaskSample::UnregisterBackgroundTasks(String^ name, BackgroundTaskRegistrationGroup^ group)
{
//
- // Loop through all background tasks and unregister any that have a name that matches
- // the name passed into this function.
+ // If the given task group is registered then loop through all background tasks associated with it
+ // and unregister any with the name passed into this function.
//
- auto iter = BackgroundTaskRegistration::AllTasks->First();
- auto hascur = iter->HasCurrent;
- while (hascur)
+ if (group != nullptr)
{
- auto cur = iter->Current->Value;
-
- if (cur->Name == name)
+ for (auto pair : group->AllTasks)
+ {
+ auto task = pair->Value;
+ if (task->Name == name)
+ {
+ task->Unregister(true);
+ }
+ }
+ }
+ else
+ {
+ //
+ // Loop through all ungrouped background tasks and unregister any with the name passed into this function.
+ //
+ for (auto pair : BackgroundTaskRegistration::AllTasks)
{
- cur->Unregister(true);
- UpdateBackgroundTaskRegistrationStatus(name, false);
+ auto task = pair->Value;
+ if (task->Name == name)
+ {
+ task->Unregister(true);
+ }
}
+ }
+
+ UpdateBackgroundTaskRegistrationStatus(name, false);
+}
+
- hascur = iter->MoveNext();
+BackgroundTaskRegistrationGroup^ BackgroundTaskSample::GetTaskGroup(String^ id, String^ groupName)
+{
+ auto group = BackgroundTaskRegistration::GetTaskGroup(id);
+
+ if (group == nullptr)
+ {
+ group = ref new BackgroundTaskRegistrationGroup(id, groupName);
}
+
+ return group;
}
+
void BackgroundTaskSample::UpdateBackgroundTaskRegistrationStatus(String^ name, bool registered)
{
if (name == SampleBackgroundTaskName)
@@ -181,6 +223,10 @@ void BackgroundTaskSample::UpdateBackgroundTaskRegistrationStatus(String^ name,
{
BackgroundTaskSample::ApplicationTriggerTaskRegistered = registered;
}
+ else if (name == GroupedBackgroundTaskName)
+ {
+ BackgroundTaskSample::GroupedBackgroundTaskRegistered = registered;
+ }
}
void BackgroundTaskSample::RemoveBackgroundTaskStatus(String^ name)
@@ -195,3 +241,9 @@ void App::OnBackgroundActivated(BackgroundActivatedEventArgs^ args)
{
BackgroundActivity::Start(args->TaskInstance);
}
+
+void App::Partial_Construct()
+{
+ auto group = BackgroundTaskSample::GetTaskGroup(BackgroundTaskGroupId, BackgroundTaskGroupFriendlyName);
+ group->BackgroundActivated += ref new TypedEventHandler(&BackgroundActivity::OnStart, CallbackContext::Same);
+}
diff --git a/Samples/BackgroundActivation/cpp/SampleConfiguration.h b/Samples/BackgroundActivation/cpp/SampleConfiguration.h
index a416f94ec9..b687b1b982 100644
--- a/Samples/BackgroundActivation/cpp/SampleConfiguration.h
+++ b/Samples/BackgroundActivation/cpp/SampleConfiguration.h
@@ -11,9 +11,12 @@
#pragma once
#include
+#include "App.g.h"
+#include "BackgroundActivity.h"
using namespace Platform;
using namespace Windows::ApplicationModel::Background;
+using namespace Windows::ApplicationModel::Activation;
using namespace Windows::Storage;
#define SampleBackgroundTaskName "SampleBackgroundTask"
@@ -21,6 +24,10 @@ using namespace Windows::Storage;
#define ServicingCompleteTaskName "ServicingCompleteTask"
#define TimeTriggeredTaskName "TimeTriggeredTask"
#define ApplicationTriggerTaskName "ApplicationTriggerTask"
+#define GroupedBackgroundTaskName "GroupedBackgroundTask"
+#define BackgroundTaskGroupId "3F2504E0-5F89-41D3-9A0C-0405E82C3333"
+#define BackgroundTaskGroupFriendlyName "Background Task Group"
+
namespace SDKTemplate
{
@@ -56,9 +63,10 @@ namespace SDKTemplate
{
public:
static String^ GetBackgroundTaskStatus(String^ name);
- static BackgroundTaskRegistration^ RegisterBackgroundTask(String^ taskEntryPoint, String^ name, IBackgroundTrigger^ trigger, IBackgroundCondition^ condition);
+ static BackgroundTaskRegistration^ RegisterBackgroundTask(String^ taskEntryPoint, String^ name, IBackgroundTrigger^ trigger, IBackgroundCondition^ condition, BackgroundTaskRegistrationGroup^ group = nullptr);
static bool TaskRequiresBackgroundAccess(String^ name);
- static void UnregisterBackgroundTasks(String^ name);
+ static void UnregisterBackgroundTasks(String^ name, BackgroundTaskRegistrationGroup^ group = nullptr);
+ static BackgroundTaskRegistrationGroup^ GetTaskGroup(String^ id, String^ groupName);
static void UpdateBackgroundTaskRegistrationStatus(String^ name, bool registered);
static void RemoveBackgroundTaskStatus(String^ name);
@@ -78,7 +86,11 @@ namespace SDKTemplate
static bool ApplicationTriggerTaskRegistered;
static String^ ApplicationTriggerTaskResult;
+ static String^ GroupedBackgroundTaskProgress;
+ static bool GroupedBackgroundTaskRegistered;
+
static Windows::Foundation::Collections::PropertySet^ TaskStatuses;
};
-
}
+
+
diff --git a/Samples/BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.cpp b/Samples/BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.cpp
new file mode 100644
index 0000000000..ac03aae2f5
--- /dev/null
+++ b/Samples/BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.cpp
@@ -0,0 +1,155 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// 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.
+//
+//*********************************************************
+
+//
+// Scenario6_GroupedTask.xaml.cpp
+// Implementation of the GroupedBackgroundTask class
+//
+
+#include "pch.h"
+#include "Scenario6_GroupedTask.xaml.h"
+#include "SampleConfiguration.h"
+
+using namespace SDKTemplate;
+using namespace concurrency;
+using namespace Windows::ApplicationModel::Background;
+using namespace Windows::UI::Core;
+using namespace Windows::UI::Xaml;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::UI::Xaml::Navigation;
+
+GroupedBackgroundTask::GroupedBackgroundTask()
+{
+ InitializeComponent();
+}
+
+///
+/// Invoked when this page is about to be displayed in a Frame.
+///
+/// Event data that describes how this page was reached. The Parameter
+/// property is typically used to configure the page.
+void GroupedBackgroundTask::OnNavigatedTo(NavigationEventArgs^ e)
+{
+ // A pointer back to the main page. This is needed if you want to call methods in MainPage such
+ // as NotifyUser()
+ rootPage = MainPage::Current;
+
+ group = BackgroundTaskSample::GetTaskGroup(BackgroundTaskGroupId, BackgroundTaskGroupFriendlyName);
+
+ //
+ // Attach progress and completed handlers to any existing tasks.
+ //
+ for (auto pair : group->AllTasks)
+ {
+ auto task = pair->Value;
+ if (task->Name == GroupedBackgroundTaskName)
+ {
+ BackgroundTaskSample::UpdateBackgroundTaskRegistrationStatus(task->Name, true);
+ AttachProgressAndCompletedHandlers(task);
+ break;
+ }
+ }
+
+ UpdateUI();
+}
+
+///
+/// Attach progress and completed handers to a background task.
+///
+/// The task to attach progress and completed handlers to.
+void GroupedBackgroundTask::AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration^ task)
+{
+ task->Progress += ref new BackgroundTaskProgressEventHandler(this, &GroupedBackgroundTask::OnProgress);
+ task->Completed += ref new BackgroundTaskCompletedEventHandler(this, &GroupedBackgroundTask::OnCompleted);
+}
+
+///
+/// Register a Grouped Background Task.
+///
+///
+///
+void GroupedBackgroundTask::RegisterGroupedBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ auto task = BackgroundTaskSample::RegisterBackgroundTask(nullptr,
+ GroupedBackgroundTaskName,
+ ref new SystemTrigger(SystemTriggerType::TimeZoneChange, false),
+ nullptr,
+ group);
+ AttachProgressAndCompletedHandlers(task);
+ UpdateUI();
+}
+
+///
+/// Unregister a Grouped Background Task.
+///
+///
+///
+void GroupedBackgroundTask::UnregisterGroupedTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ BackgroundTaskSample::UnregisterBackgroundTasks(GroupedBackgroundTaskName, group);
+ UpdateUI();
+}
+
+///
+/// Unregister all Background Tasks that are not grouped.
+///
+///
+///
+void GroupedBackgroundTask::UnregisterUngroupedTasks(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ for (auto pair : BackgroundTaskRegistration::AllTasks)
+ {
+ auto task = pair->Value;
+ task->Unregister(true);
+ BackgroundTaskSample::UpdateBackgroundTaskRegistrationStatus(task->Name, false);
+ }
+}
+
+///
+/// Handle background task progress.
+///
+/// The task that is reporting progress.
+/// Arguments of the progress report.
+void GroupedBackgroundTask::OnProgress(BackgroundTaskRegistration^ task, BackgroundTaskProgressEventArgs^ args)
+{
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
+ {
+ auto progress = "Progress: " + args->Progress + "%";
+ BackgroundTaskSample::GroupedBackgroundTaskProgress = progress;
+ UpdateUI();
+ }));
+}
+
+///
+/// Handle background task completion.
+///
+/// The task that is reporting completion.
+/// Arguments of the completion report.
+void GroupedBackgroundTask::OnCompleted(BackgroundTaskRegistration^ task, BackgroundTaskCompletedEventArgs^ args)
+{
+ UpdateUI();
+}
+
+///
+/// Update the scenario UI.
+///
+void GroupedBackgroundTask::UpdateUI()
+{
+ auto uiDelegate = [this]()
+ {
+ RegisterButton->IsEnabled = !BackgroundTaskSample::GroupedBackgroundTaskRegistered;
+ UnregisterGroupedButton->IsEnabled = BackgroundTaskSample::GroupedBackgroundTaskRegistered;
+ Progress->Text = BackgroundTaskSample::GroupedBackgroundTaskProgress;
+ Status->Text = BackgroundTaskSample::GetBackgroundTaskStatus(GroupedBackgroundTaskName);
+ };
+ auto handler = ref new Windows::UI::Core::DispatchedHandler(uiDelegate, Platform::CallbackContext::Any);
+
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, handler);
+}
diff --git a/Samples/BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.h b/Samples/BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.h
new file mode 100644
index 0000000000..4f639635a1
--- /dev/null
+++ b/Samples/BackgroundActivation/cpp/Scenario6_GroupedTask.xaml.h
@@ -0,0 +1,48 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// 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.
+//
+//*********************************************************
+
+//
+// Scenario5_GroupedTask.xaml.h
+// Declaration of the GroupedBackgroundTask class
+//
+
+#pragma once
+
+#include
+#include "pch.h"
+#include "Scenario6_GroupedTask.g.h"
+#include "MainPage.xaml.h"
+
+namespace SDKTemplate
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ [Windows::Foundation::Metadata::WebHostHidden]
+ public ref class GroupedBackgroundTask sealed
+ {
+ public:
+ GroupedBackgroundTask();
+
+ protected:
+ virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e) override;
+ private:
+ SDKTemplate::MainPage^ rootPage;
+ BackgroundTaskRegistrationGroup^ group = nullptr;
+
+ void AttachProgressAndCompletedHandlers(Windows::ApplicationModel::Background::IBackgroundTaskRegistration^ task);
+ void RegisterGroupedBackgroundTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void UnregisterGroupedTask(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void UnregisterUngroupedTasks(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void OnProgress(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskProgressEventArgs^ args);
+ void OnCompleted(Windows::ApplicationModel::Background::BackgroundTaskRegistration^ task, Windows::ApplicationModel::Background::BackgroundTaskCompletedEventArgs^ args);
+ void UpdateUI();
+ };
+}
diff --git a/Samples/BackgroundActivation/cpp/pch.h b/Samples/BackgroundActivation/cpp/pch.h
index 1d46d72775..5208eae636 100644
--- a/Samples/BackgroundActivation/cpp/pch.h
+++ b/Samples/BackgroundActivation/cpp/pch.h
@@ -28,6 +28,10 @@ namespace SDKTemplate
///
protected:
virtual void OnBackgroundActivated(Windows::ApplicationModel::Activation::BackgroundActivatedEventArgs^ args) override;
+
+ private:
+ void Partial_Construct();
};
}
+
#include "App.xaml.h"
\ No newline at end of file
diff --git a/Samples/BackgroundActivation/cs/BackgroundActivation.csproj b/Samples/BackgroundActivation/cs/BackgroundActivation.csproj
index 18360b800d..c018041096 100644
--- a/Samples/BackgroundActivation/cs/BackgroundActivation.csproj
+++ b/Samples/BackgroundActivation/cs/BackgroundActivation.csproj
@@ -119,6 +119,9 @@
Scenario3_ServicingCompleteTask.xaml
+
+ Scenario6_GroupedTask.xaml
+
@@ -165,6 +168,12 @@
+
+ Scenario6_GroupedTask.xaml
+ MSBuild:Compile
+
+
+
Styles\Styles.xaml
MSBuild:Compile
diff --git a/Samples/BackgroundActivation/cs/BackgroundActivity.cs b/Samples/BackgroundActivation/cs/BackgroundActivity.cs
index 9a1e7f496e..77961f2276 100644
--- a/Samples/BackgroundActivation/cs/BackgroundActivity.cs
+++ b/Samples/BackgroundActivation/cs/BackgroundActivity.cs
@@ -11,6 +11,7 @@
using System;
using System.Diagnostics;
using System.Threading;
+using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Background;
using Windows.Foundation;
using Windows.Storage;
@@ -99,6 +100,11 @@ private void PeriodicTimerCallback(ThreadPoolTimer timer)
}
}
+ public static void Start(BackgroundTaskRegistrationGroup sender, BackgroundActivatedEventArgs args)
+ {
+ Start(args.TaskInstance);
+ }
+
public static void Start(IBackgroundTaskInstance taskInstance)
{
// Use the taskInstance.Name and/or taskInstance.InstanceId to determine
diff --git a/Samples/BackgroundActivation/cs/SampleConfiguration.cs b/Samples/BackgroundActivation/cs/SampleConfiguration.cs
index 20803531ee..1327ab1561 100644
--- a/Samples/BackgroundActivation/cs/SampleConfiguration.cs
+++ b/Samples/BackgroundActivation/cs/SampleConfiguration.cs
@@ -31,7 +31,8 @@ public partial class MainPage : Page
new Scenario() { Title="Background Task with Condition", ClassType=typeof(SampleBackgroundTaskWithCondition)},
new Scenario() { Title="Servicing Complete Task", ClassType=typeof(ServicingCompleteTask)},
new Scenario() { Title="Background Task with Time Trigger", ClassType=typeof(TimeTriggeredTask) },
- new Scenario() { Title="Background Task with Application Trigger", ClassType=typeof(ApplicationTriggerTask) }
+ new Scenario() { Title="Background Task with Application Trigger", ClassType=typeof(ApplicationTriggerTask) },
+ new Scenario() { Title="Grouped Background Task", ClassType=typeof(GroupedBackgroundTask) },
};
}
@@ -67,6 +68,12 @@ class BackgroundTaskSample
public static string ApplicationTriggerTaskResult = "";
public static bool ApplicationTriggerTaskRegistered = false;
+ public const string GroupedBackgroundTaskName = "GroupedBackgroundTask";
+ public const string BackgroundTaskGroupId = "3F2504E0-5F89-41D3-9A0C-0405E82C3333";
+ public const string BackgroundTaskGroupFriendlyName = "Background Task Group";
+ public static string GroupedBackgroundTaskProgress = "";
+ public static bool GroupedBackgroundTaskRegistered = false;
+
// These strings are manipulated by multiple threads, so we must
// use a thread-safe container.
public static PropertySet TaskStatuses = new PropertySet();
@@ -79,7 +86,7 @@ class BackgroundTaskSample
/// A name for the background task.
/// The trigger for the background task.
/// An optional conditional event that must be true for the task to fire.
- public static BackgroundTaskRegistration RegisterBackgroundTask(String taskEntryPoint, String name, IBackgroundTrigger trigger, IBackgroundCondition condition)
+ public static BackgroundTaskRegistration RegisterBackgroundTask(String taskEntryPoint, String name, IBackgroundTrigger trigger, IBackgroundCondition condition, BackgroundTaskRegistrationGroup group = null)
{
if (TaskRequiresBackgroundAccess(name))
{
@@ -111,6 +118,11 @@ public static BackgroundTaskRegistration RegisterBackgroundTask(String taskEntry
builder.CancelOnConditionLoss = true;
}
+ if (group != null)
+ {
+ builder.TaskGroup = group;
+ }
+
BackgroundTaskRegistration task = builder.Register();
UpdateBackgroundTaskRegistrationStatus(name, true);
@@ -127,23 +139,56 @@ public static BackgroundTaskRegistration RegisterBackgroundTask(String taskEntry
/// Unregister background tasks with specified name.
///
/// Name of the background task to unregister.
- public static void UnregisterBackgroundTasks(String name)
+ public static void UnregisterBackgroundTasks(String name, BackgroundTaskRegistrationGroup group = null)
{
//
- // Loop through all background tasks and unregister any with SampleBackgroundTaskName or
- // SampleBackgroundTaskWithConditionName.
+ // If the given task group is registered then loop through all background tasks associated with it
+ // and unregister any with the given name.
//
- foreach (var cur in BackgroundTaskRegistration.AllTasks)
+ if (group != null)
+ {
+ foreach (var cur in group.AllTasks)
+ {
+ if (cur.Value.Name == name)
+ {
+ cur.Value.Unregister(true);
+ }
+ }
+ }
+ else
{
- if (cur.Value.Name == name)
+ //
+ // Loop through all ungrouped background tasks and unregister any with the given name.
+ //
+ foreach (var cur in BackgroundTaskRegistration.AllTasks)
{
- cur.Value.Unregister(true);
+ if (cur.Value.Name == name)
+ {
+ cur.Value.Unregister(true);
+ }
}
}
UpdateBackgroundTaskRegistrationStatus(name, false);
}
+ ///
+ /// Retrieve a registered background task group. If no group is registered with the given id,
+ /// then create a new one and return it.
+ ///
+ /// The task group associated with the given id
+ public static BackgroundTaskRegistrationGroup GetTaskGroup(string id, string groupName)
+ {
+ var group = BackgroundTaskRegistration.GetTaskGroup(id);
+
+ if (group == null)
+ {
+ group = new BackgroundTaskRegistrationGroup(id, groupName);
+ }
+
+ return group;
+ }
+
///
/// Store the registration status of a background task with a given name.
///
@@ -168,6 +213,9 @@ public static void UpdateBackgroundTaskRegistrationStatus(String name, bool regi
case ApplicationTriggerTaskName:
ApplicationTriggerTaskRegistered = registered;
break;
+ case GroupedBackgroundTaskName:
+ GroupedBackgroundTaskRegistered = registered;
+ break;
}
}
@@ -196,6 +244,9 @@ public static String GetBackgroundTaskStatus(String name)
case ApplicationTriggerTaskName:
registered = ApplicationTriggerTaskRegistered;
break;
+ case GroupedBackgroundTaskName:
+ registered = GroupedBackgroundTaskRegistered;
+ break;
}
var status = registered ? "Registered" : "Unregistered";
@@ -243,5 +294,14 @@ protected override void OnBackgroundActivated(BackgroundActivatedEventArgs args)
{
BackgroundActivity.Start(args.TaskInstance);
}
+
+ ///
+ /// Register for grouped background task events in the Application constructor.
+ ///
+ partial void Construct()
+ {
+ var group = BackgroundTaskSample.GetTaskGroup(BackgroundTaskSample.BackgroundTaskGroupId, BackgroundTaskSample.BackgroundTaskGroupFriendlyName);
+ group.BackgroundActivated += BackgroundActivity.Start;
+ }
}
}
\ No newline at end of file
diff --git a/Samples/BackgroundActivation/cs/Scenario6_GroupedTask.xaml.cs b/Samples/BackgroundActivation/cs/Scenario6_GroupedTask.xaml.cs
new file mode 100644
index 0000000000..00c214d0ca
--- /dev/null
+++ b/Samples/BackgroundActivation/cs/Scenario6_GroupedTask.xaml.cs
@@ -0,0 +1,156 @@
+//*********************************************************
+//
+// 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 SDKTemplate;
+using Windows.ApplicationModel.Background;
+using Windows.Storage;
+using Windows.UI.Core;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace SDKTemplate
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class GroupedBackgroundTask : Page
+ {
+ // A pointer back to the main page. This is needed if you want to call methods in MainPage such
+ // as NotifyUser()
+ MainPage rootPage = MainPage.Current;
+
+ public GroupedBackgroundTask()
+ {
+ this.InitializeComponent();
+ }
+
+ BackgroundTaskRegistrationGroup group;
+
+ ///
+ /// Invoked when this page is about to be displayed in a Frame.
+ ///
+ /// Event data that describes how this page was reached. The Parameter
+ /// property is typically used to configure the page.
+ protected override void OnNavigatedTo(NavigationEventArgs e)
+ {
+ group = BackgroundTaskSample.GetTaskGroup(BackgroundTaskSample.BackgroundTaskGroupId, BackgroundTaskSample.BackgroundTaskGroupFriendlyName);
+
+ foreach (var task in group.AllTasks)
+ {
+ if (task.Value.Name == BackgroundTaskSample.GroupedBackgroundTaskName)
+ {
+ AttachProgressAndCompletedHandlers(task.Value);
+ BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.GroupedBackgroundTaskName, true);
+ break;
+ }
+ }
+
+ UpdateUI();
+ }
+
+ ///
+ /// Register a Grouped Background Task.
+ ///
+ ///
+ ///
+ private void RegisterGroupedBackgroundTask(object sender, RoutedEventArgs e)
+ {
+ var task = BackgroundTaskSample.RegisterBackgroundTask(null,
+ BackgroundTaskSample.GroupedBackgroundTaskName,
+ new SystemTrigger(SystemTriggerType.TimeZoneChange, false),
+ null,
+ group);
+ AttachProgressAndCompletedHandlers(task);
+ UpdateUI();
+ }
+
+
+ ///
+ /// Unregister a Grouped Background Task.
+ ///
+ ///
+ ///
+ private void UnregisterGroupedTask(object sender, RoutedEventArgs e)
+ {
+ BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.GroupedBackgroundTaskName, group);
+ UpdateUI();
+ }
+
+ ///
+ /// Unregisters all Background Tasks that are not in groups.
+ /// This will not impact tasks registered with groups.
+ ///
+ ///
+ ///
+ private void UnregisterUngroupedTasks(object sender, RoutedEventArgs e)
+ {
+ foreach(var cur in BackgroundTaskRegistration.AllTasks)
+ {
+ cur.Value.Unregister(true);
+ BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(cur.Value.Name, false);
+ }
+ }
+
+ ///
+ /// Attach progress and completed handers to a background task.
+ ///
+ /// The task to attach progress and completed handlers to.
+ private void AttachProgressAndCompletedHandlers(IBackgroundTaskRegistration task)
+ {
+ task.Progress += new BackgroundTaskProgressEventHandler(OnProgress);
+ task.Completed += new BackgroundTaskCompletedEventHandler(OnCompleted);
+ }
+
+ ///
+ /// Handle background task progress.
+ ///
+ /// The task that is reporting progress.
+ /// Arguments of the progress report.
+ private void OnProgress(IBackgroundTaskRegistration task, BackgroundTaskProgressEventArgs args)
+ {
+ var ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ {
+ var progress = "Progress: " + args.Progress + "%";
+ BackgroundTaskSample.GroupedBackgroundTaskProgress = progress;
+ UpdateUI();
+ });
+ }
+
+ ///
+ /// Handle background task completion.
+ ///
+ /// The task that is reporting completion.
+ /// Arguments of the completion report.
+ private void OnCompleted(IBackgroundTaskRegistration task, BackgroundTaskCompletedEventArgs args)
+ {
+ UpdateUI();
+ }
+
+ ///
+ /// Update the scenario UI.
+ ///
+ private async void UpdateUI()
+ {
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
+ () =>
+ {
+ RegisterButton.IsEnabled = !BackgroundTaskSample.GroupedBackgroundTaskRegistered;
+ UnregisterGroupedButton.IsEnabled = BackgroundTaskSample.GroupedBackgroundTaskRegistered;
+ Progress.Text = BackgroundTaskSample.GroupedBackgroundTaskProgress;
+ Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.GroupedBackgroundTaskName);
+ });
+ }
+ }
+}
diff --git a/Samples/BackgroundActivation/shared/Scenario6_GroupedTask.xaml b/Samples/BackgroundActivation/shared/Scenario6_GroupedTask.xaml
new file mode 100644
index 0000000000..248bf2406d
--- /dev/null
+++ b/Samples/BackgroundActivation/shared/Scenario6_GroupedTask.xaml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+ Registers a background task for a Time zone change trigger event with a background task
+ registration group. Registering with a group enables the task registration to remain active
+ when all ungrouped tasks are unregistered.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/BackgroundActivation/vb/BackgroundActivation.vbproj b/Samples/BackgroundActivation/vb/BackgroundActivation.vbproj
index e024221b86..d4257db511 100644
--- a/Samples/BackgroundActivation/vb/BackgroundActivation.vbproj
+++ b/Samples/BackgroundActivation/vb/BackgroundActivation.vbproj
@@ -123,6 +123,9 @@
Scenario3_ServicingCompleteTask.xaml
+
+ Scenario6_GroupedTask.xaml
+
@@ -169,6 +172,12 @@
+
+ Scenario6_GroupedTask.xaml
+ MSBuild:Compile
+
+
+
Styles\Styles.xaml
MSBuild:Compile
diff --git a/Samples/BackgroundActivation/vb/BackgroundActivity.vb b/Samples/BackgroundActivation/vb/BackgroundActivity.vb
index e86104a9e0..e97d81c4ab 100644
--- a/Samples/BackgroundActivation/vb/BackgroundActivity.vb
+++ b/Samples/BackgroundActivation/vb/BackgroundActivity.vb
@@ -72,6 +72,11 @@ Namespace Global.SDKTemplate
End If
End Sub
+ Public Shared Sub Start(sender As BackgroundTaskRegistrationGroup, args As BackgroundActivatedEventArgs)
+ Start(args.TaskInstance)
+ End Sub
+
+
Public Shared Sub Start(taskInstance As IBackgroundTaskInstance)
' Use the taskInstance.Name and/or taskInstance.InstanceId to determine
' what background activity to perform. In this sample, all of our
diff --git a/Samples/BackgroundActivation/vb/SampleConfiguration.vb b/Samples/BackgroundActivation/vb/SampleConfiguration.vb
index 59dfc547aa..95894ef10c 100644
--- a/Samples/BackgroundActivation/vb/SampleConfiguration.vb
+++ b/Samples/BackgroundActivation/vb/SampleConfiguration.vb
@@ -24,7 +24,7 @@ Namespace Global.SDKTemplate
Public Const FEATURE_NAME As String = "Background Activation"
- Public ReadOnly Property scenarios As New List(Of Scenario) From {New Scenario() With {.Title = "Background Task", .ClassType = GetType(SampleBackgroundTask)}, New Scenario() With {.Title = "Background Task with Condition", .ClassType = GetType(SampleBackgroundTaskWithCondition)}, New Scenario() With {.Title = "Servicing Complete Task", .ClassType = GetType(ServicingCompleteTask)}, New Scenario() With {.Title = "Background Task with Time Trigger", .ClassType = GetType(TimeTriggeredTask)}, New Scenario() With {.Title = "Background Task with Application Trigger", .ClassType = GetType(ApplicationTriggerTask)}}
+ Public ReadOnly Property scenarios As New List(Of Scenario) From {New Scenario() With {.Title = "Background Task", .ClassType = GetType(SampleBackgroundTask)}, New Scenario() With {.Title = "Background Task with Condition", .ClassType = GetType(SampleBackgroundTaskWithCondition)}, New Scenario() With {.Title = "Servicing Complete Task", .ClassType = GetType(ServicingCompleteTask)}, New Scenario() With {.Title = "Background Task with Time Trigger", .ClassType = GetType(TimeTriggeredTask)}, New Scenario() With {.Title = "Background Task with Application Trigger", .ClassType = GetType(ApplicationTriggerTask)}, New Scenario() With {.Title = "Grouped Background Task", .ClassType = GetType(GroupedBackgroundTask)}}
End Class
Public Class Scenario
@@ -71,6 +71,16 @@ Namespace Global.SDKTemplate
Public Shared ApplicationTriggerTaskRegistered As Boolean = False
+ Public Const GroupedBackgroundTaskName As String = "GroupedBackgroundTask"
+
+ Public Const BackgroundTaskGroupId As String = "3F2504E0-5F89-41D3-9A0C-0405E82C3333"
+
+ Public Const BackgroundTaskGroupFriendlyName As String = "Background Task Group"
+
+ Public Shared GroupedBackgroundTaskProgress As String = ""
+
+ Public Shared GroupedBackgroundTaskRegistered As Boolean = False
+
Public Shared TaskStatuses As PropertySet = New PropertySet()
'''
@@ -81,7 +91,7 @@ Namespace Global.SDKTemplate
''' A name for the background task.
''' The trigger for the background task.
''' An optional conditional event that must be true for the task to fire.
- Public Shared Function RegisterBackgroundTask(taskEntryPoint As String, name As String, trigger As IBackgroundTrigger, condition As IBackgroundCondition) As BackgroundTaskRegistration
+ Public Shared Function RegisterBackgroundTask(taskEntryPoint As String, name As String, trigger As IBackgroundTrigger, condition As IBackgroundCondition, Optional group As BackgroundTaskRegistrationGroup = Nothing) As BackgroundTaskRegistration
If TaskRequiresBackgroundAccess(name) Then
' If the user denies access, the task will not run.
Dim requestTask = BackgroundExecutionManager.RequestAccessAsync()
@@ -102,6 +112,10 @@ Namespace Global.SDKTemplate
builder.CancelOnConditionLoss = True
End If
+ If group IsNot Nothing Then
+ builder.TaskGroup = group
+ End If
+
Dim task As BackgroundTaskRegistration = builder.Register()
UpdateBackgroundTaskRegistrationStatus(name, True)
'
@@ -115,16 +129,42 @@ Namespace Global.SDKTemplate
''' Unregister background tasks with specified name.
'''
''' Name of the background task to unregister.
- Public Shared Sub UnregisterBackgroundTasks(name As String)
- For Each cur In BackgroundTaskRegistration.AllTasks
- If cur.Value.Name = name Then
- cur.Value.Unregister(True)
- End If
- Next
+ Public Shared Sub UnregisterBackgroundTasks(name As String, Optional group As BackgroundTaskRegistrationGroup = Nothing)
+
+ If group IsNot Nothing Then
+ For Each cur In group.AllTasks
+ If cur.Value.Name = name Then
+ cur.Value.Unregister(True)
+ End If
+ Next
+ Else
+ For Each cur In BackgroundTaskRegistration.AllTasks
+ If cur.Value.Name = name Then
+ cur.Value.Unregister(True)
+ End If
+ Next
+ End If
UpdateBackgroundTaskRegistrationStatus(name, False)
End Sub
+ '''
+ ''' Retrieve a registered background task group. If no group is registered with the given id,
+ ''' then create a new one and return it.
+ '''
+ '''
+ '''
+ ''' The task group associated with the given id
+ Public Shared Function GetTaskGroup(id As String, groupName As String) As BackgroundTaskRegistrationGroup
+ Dim group = BackgroundTaskRegistration.GetTaskGroup(id)
+
+ If group Is Nothing Then
+ group = New BackgroundTaskRegistrationGroup(id, groupName)
+ End If
+
+ Return group
+ End Function
+
'''
''' Store the registration status of a background task with a given name.
'''
@@ -134,15 +174,17 @@ Namespace Global.SDKTemplate
Select name
Case SampleBackgroundTaskName
SampleBackgroundTaskRegistered = registered
- Case SampleBackgroundTaskWithConditionName
+ Case SampleBackgroundTaskWithConditionName
SampleBackgroundTaskWithConditionRegistered = registered
- Case ServicingCompleteTaskName
+ Case ServicingCompleteTaskName
ServicingCompleteTaskRegistered = registered
- Case TimeTriggeredTaskName
+ Case TimeTriggeredTaskName
TimeTriggeredTaskRegistered = registered
- Case ApplicationTriggerTaskName
+ Case ApplicationTriggerTaskName
ApplicationTriggerTaskRegistered = registered
- End Select
+ Case GroupedBackgroundTaskName
+ GroupedBackgroundTaskRegistered = registered
+ End Select
End Sub
'''
@@ -155,15 +197,17 @@ Namespace Global.SDKTemplate
Select name
Case SampleBackgroundTaskName
registered = SampleBackgroundTaskRegistered
- Case SampleBackgroundTaskWithConditionName
+ Case SampleBackgroundTaskWithConditionName
registered = SampleBackgroundTaskWithConditionRegistered
- Case ServicingCompleteTaskName
+ Case ServicingCompleteTaskName
registered = ServicingCompleteTaskRegistered
- Case TimeTriggeredTaskName
+ Case TimeTriggeredTaskName
registered = TimeTriggeredTaskRegistered
- Case ApplicationTriggerTaskName
+ Case ApplicationTriggerTaskName
registered = ApplicationTriggerTaskRegistered
- End Select
+ Case GroupedBackgroundTaskName
+ registered = GroupedBackgroundTaskRegistered
+ End Select
Dim status = If(registered, "Registered", "Unregistered")
Dim taskStatus As Object = Nothing
@@ -195,5 +239,10 @@ Namespace Global.SDKTemplate
Protected Overrides Sub OnBackgroundActivated(args As BackgroundActivatedEventArgs)
BackgroundActivity.Start(args.TaskInstance)
End Sub
+
+ Private Sub Construct()
+ Dim group = BackgroundTaskSample.GetTaskGroup(BackgroundTaskSample.BackgroundTaskGroupId, BackgroundTaskSample.BackgroundTaskGroupFriendlyName)
+ AddHandler group.BackgroundActivated, AddressOf BackgroundActivity.Start
+ End Sub
End Class
End Namespace
diff --git a/Samples/BackgroundActivation/vb/Scenario6_GroupedTask.xaml.vb b/Samples/BackgroundActivation/vb/Scenario6_GroupedTask.xaml.vb
new file mode 100644
index 0000000000..6a07575d85
--- /dev/null
+++ b/Samples/BackgroundActivation/vb/Scenario6_GroupedTask.xaml.vb
@@ -0,0 +1,133 @@
+'*********************************************************
+'
+' 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.
+'
+'*********************************************************
+Imports System
+Imports SDKTemplate
+Imports Windows.ApplicationModel.Background
+Imports Windows.Storage
+Imports Windows.UI.Core
+Imports Windows.UI.Xaml
+Imports Windows.UI.Xaml.Controls
+Imports Windows.UI.Xaml.Navigation
+
+Namespace Global.SDKTemplate
+
+ '''
+ ''' An empty page that can be used on its own or navigated to within a Frame.
+ '''
+ Partial Public NotInheritable Class GroupedBackgroundTask
+ Inherits Page
+
+ Dim rootPage As MainPage = MainPage.Current
+
+ Dim group As BackgroundTaskRegistrationGroup = Nothing
+
+ Public Sub New()
+ Me.InitializeComponent()
+ End Sub
+
+ '''
+ ''' Invoked when this page is about to be displayed in a Frame.
+ '''
+ ''' Event data that describes how this page was reached. The Parameter
+ ''' property is typically used to configure the page.
+ Protected Overrides Sub OnNavigatedTo(e As NavigationEventArgs)
+
+ group = BackgroundTaskSample.GetTaskGroup(BackgroundTaskSample.BackgroundTaskGroupId, BackgroundTaskSample.BackgroundTaskGroupFriendlyName)
+
+ For Each task In group.AllTasks
+ If task.Value.Name = BackgroundTaskSample.GroupedBackgroundTaskName Then
+ AttachProgressAndCompletedHandlers(task.Value)
+ BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(BackgroundTaskSample.GroupedBackgroundTaskName, True)
+ Exit For
+ End If
+ Next
+
+ UpdateUI()
+ End Sub
+
+ '''
+ ''' Register a Grouped Background Task.
+ '''
+ '''
+ '''
+ Private Sub RegisterGroupedBackgroundTask(sender As Object, e As RoutedEventArgs)
+ Dim task = BackgroundTaskSample.RegisterBackgroundTask(Nothing, BackgroundTaskSample.GroupedBackgroundTaskName, New SystemTrigger(SystemTriggerType.TimeZoneChange, False), Nothing, group)
+ AttachProgressAndCompletedHandlers(task)
+ UpdateUI()
+ End Sub
+
+ '''
+ ''' Unregister a Grouped Background Task.
+ '''
+ '''
+ '''
+ Private Sub UnregisterGroupedTask(sender As Object, e As RoutedEventArgs)
+ BackgroundTaskSample.UnregisterBackgroundTasks(BackgroundTaskSample.GroupedBackgroundTaskName, group)
+ UpdateUI()
+ End Sub
+
+ '''
+ ''' Unregister all Background Tasks that are not in groups.
+ ''' This will not impact tasks registered with groups.
+ '''
+ '''
+ '''
+ Private Sub UnregisterUngroupedTasks(sender As Object, e As RoutedEventArgs)
+ For Each cur In BackgroundTaskRegistration.AllTasks
+ cur.Value.Unregister(True)
+ BackgroundTaskSample.UpdateBackgroundTaskRegistrationStatus(cur.Value.Name, False)
+ Next
+ End Sub
+
+ '''
+ ''' Attach progress and completed handers to a background task.
+ '''
+ ''' The task to attach progress and completed handlers to.
+ Private Sub AttachProgressAndCompletedHandlers(task As IBackgroundTaskRegistration)
+ AddHandler task.Progress, New BackgroundTaskProgressEventHandler(AddressOf OnProgress)
+ AddHandler task.Completed, New BackgroundTaskCompletedEventHandler(AddressOf OnCompleted)
+ End Sub
+
+ '''
+ ''' Handle background task progress.
+ '''
+ ''' The task that is reporting progress.
+ ''' Arguments of the progress report.
+ Private Sub OnProgress(task As IBackgroundTaskRegistration, args As BackgroundTaskProgressEventArgs)
+ Dim ignored = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, Sub()
+ Dim progress = "Progress: " & args.Progress & "%"
+ BackgroundTaskSample.GroupedBackgroundTaskProgress = progress
+ UpdateUI()
+ End Sub)
+ End Sub
+
+ '''
+ ''' Handle background task completion.
+ '''
+ ''' The task that is reporting completion.
+ ''' Arguments of the completion report.
+ Private Sub OnCompleted(task As IBackgroundTaskRegistration, args As BackgroundTaskCompletedEventArgs)
+ UpdateUI()
+ End Sub
+
+ '''
+ ''' Update the scenario UI.
+ '''
+ Private Async Sub UpdateUI()
+ Await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, Sub()
+ RegisterButton.IsEnabled = Not BackgroundTaskSample.GroupedBackgroundTaskRegistered
+ UnregisterGroupedButton.IsEnabled = BackgroundTaskSample.GroupedBackgroundTaskRegistered
+ Progress.Text = BackgroundTaskSample.GroupedBackgroundTaskProgress
+ Status.Text = BackgroundTaskSample.GetBackgroundTaskStatus(BackgroundTaskSample.GroupedBackgroundTaskName)
+ End Sub)
+ End Sub
+ End Class
+End Namespace
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Package.appxmanifest b/Samples/SpeechRecognitionAndSynthesis/cpp/Package.appxmanifest
index 9f00375fd1..a4e185c3aa 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Package.appxmanifest
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Package.appxmanifest
@@ -20,7 +20,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.cpp b/Samples/SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.cpp
index 2b0eea967b..64656df861 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.cpp
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/SampleConfiguration.cpp
@@ -18,6 +18,7 @@ using namespace SDKTemplate;
Platform::Array^ MainPage::scenariosInner = ref new Platform::Array
{
{ "Synthesize Text", "SDKTemplate.Scenario_SynthesizeText" },
+ { "Synthesize Text with Boundaries", "SDKTemplate.Scenario_SynthesizeTextBoundaries" },
{ "Synthesize SSML", "SDKTemplate.Scenario_SynthesizeSSML" },
{ "Predefined Dictation Grammar", "SDKTemplate.Scenario_PredefinedDictationGrammar" },
{ "Predefined WebSearch Grammar", "SDKTemplate.Scenario_PredefinedWebSearchGrammar" },
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.cpp b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.cpp
index 1359bc074a..b6da3e539f 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.cpp
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.cpp
@@ -47,9 +47,6 @@ void Scenario_ContinuousDictation::OnNavigatedTo(NavigationEventArgs^ e)
{
Page::OnNavigatedTo(e);
- // Keep track of the UI thread dispatcher, as speech events will come in on a separate thread.
- dispatcher = CoreWindow::GetForCurrentThread()->Dispatcher;
-
// Prompt the user for permission to access the microphone. This request will only happen
// once, it will not re-prompt if the user rejects the permission.
create_task(AudioCapturePermissions::RequestMicrophonePermissionAsync(), task_continuation_context::use_current())
@@ -59,15 +56,15 @@ void Scenario_ContinuousDictation::OnNavigatedTo(NavigationEventArgs^ e)
{
this->btnContinuousRecognize->IsEnabled = true;
- PopulateLanguageDropdown();
- InitializeRecognizer(SpeechRecognizer::SystemSpeechLanguage);
+ PopulateLanguageDropdown();
+ InitializeRecognizer(SpeechRecognizer::SystemSpeechLanguage);
}
else
{
this->dictationTextBox->Text = "Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";
- this->cbLanguageSelection->IsEnabled = false;
+ this->cbLanguageSelection->IsEnabled = false;
}
- });
+ });
}
///
@@ -187,7 +184,7 @@ void Scenario_ContinuousDictation::OnNavigatedFrom(NavigationEventArgs^ e)
/// Unused event details
void Scenario_ContinuousDictation::ContinuousRecognize_Click(Object^ sender, RoutedEventArgs^ e)
{
- btnContinuousRecognize->IsEnabled = false;
+ btnContinuousRecognize->IsEnabled = false;
// The recognizer can only start listening in a continuous fashion if the recognizer is currently idle.
// This prevents an exception from occurring.
if (speechRecognizer->State == SpeechRecognizerState::Idle)
@@ -216,8 +213,8 @@ void Scenario_ContinuousDictation::ContinuousRecognize_Click(Object^ sender, Rou
create_task(messageDialog->ShowAsync());
}
}).then([this]() {
- btnContinuousRecognize->IsEnabled = true;
- });
+ btnContinuousRecognize->IsEnabled = true;
+ });
}
catch (COMException^ exception)
{
@@ -250,8 +247,8 @@ void Scenario_ContinuousDictation::ContinuousRecognize_Click(Object^ sender, Rou
// Ensure we don't leave any hypothesis text behind
dictationTextBox->Text = ref new Platform::String(this->dictatedTextBuilder.str().c_str());
}).then([this]() {
- btnContinuousRecognize->IsEnabled = true;
- });
+ btnContinuousRecognize->IsEnabled = true;
+ });
}
}
@@ -296,7 +293,7 @@ void Scenario_ContinuousDictation::dictationTextBox_TextChanged(Object^ sender,
/// The current state of the recognizer.
void Scenario_ContinuousDictation::SpeechRecognizer_StateChanged(SpeechRecognizer ^sender, SpeechRecognizerStateChangedEventArgs ^args)
{
- dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
{
rootPage->NotifyUser("Speech recognizer state: " + args->State.ToString(), NotifyType::StatusMessage);
}));
@@ -319,7 +316,7 @@ void Scenario_ContinuousDictation::ContinuousRecognitionSession_Completed(Speech
// With dictation (no grammar in place) modes, the default timeout is 20 seconds.
if (args->Status == SpeechRecognitionResultStatus::TimeoutExceeded)
{
- dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
{
rootPage->NotifyUser("Automatic Time Out of Dictation", NotifyType::StatusMessage);
DictationButtonText->Text = " Dictate";
@@ -329,7 +326,7 @@ void Scenario_ContinuousDictation::ContinuousRecognitionSession_Completed(Speech
}
else
{
- dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
{
rootPage->NotifyUser("Continuous Recognition Completed: " + args->Status.ToString(), NotifyType::ErrorMessage);
DictationButtonText->Text = " Dictate";
@@ -355,7 +352,7 @@ void Scenario_ContinuousDictation::ContinuousRecognitionSession_ResultGenerated(
{
this->dictatedTextBuilder << args->Result->Text->Data() << " ";
- dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this]()
{
this->discardedTextBlock->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
@@ -365,7 +362,7 @@ void Scenario_ContinuousDictation::ContinuousRecognitionSession_ResultGenerated(
}
else
{
- dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
{
// In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
// is not the primary input mechanism for the application.
@@ -396,7 +393,7 @@ void Scenario_ContinuousDictation::SpeechRecognizer_HypothesisGenerated(SpeechRe
String^ hypothesis = args->Hypothesis->Text;
std::wstring textBoxContent = dictatedTextBuilder.str() + L" " + hypothesis->Data() + L"...";
- dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, textBoxContent]()
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, textBoxContent]()
{
// Update the textbox with the currently confirmed text, and the hypothesis combined.
this->dictationTextBox->Text = ref new Platform::String(textBoxContent.c_str());
@@ -411,7 +408,7 @@ void Scenario_ContinuousDictation::PopulateLanguageDropdown()
{
Windows::Globalization::Language^ defaultLanguage = SpeechRecognizer::SystemSpeechLanguage;
auto supportedLanguages = SpeechRecognizer::SupportedTopicLanguages;
- std::for_each(begin(supportedLanguages), end(supportedLanguages), [&](Windows::Globalization::Language^ lang)
+ for (Windows::Globalization::Language^ lang : supportedLanguages)
{
ComboBoxItem^ item = ref new ComboBoxItem();
item->Tag = lang;
@@ -423,7 +420,7 @@ void Scenario_ContinuousDictation::PopulateLanguageDropdown()
item->IsSelected = true;
cbLanguageSelection->SelectedItem = item;
}
- });
+ }
}
///
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.h b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.h
index cb0370ed63..dcad096e08 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.h
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml.h
@@ -34,7 +34,6 @@ namespace SDKTemplate
static const unsigned int HResultPrivacyStatementDeclined = 0x80045509;
SDKTemplate::MainPage^ rootPage;
- Windows::UI::Core::CoreDispatcher^ dispatcher;
Windows::Media::SpeechRecognition::SpeechRecognizer^ speechRecognizer;
std::wstringstream dictatedTextBuilder;
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.cpp b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.cpp
index 64234245d8..4371a318f2 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.cpp
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.cpp
@@ -47,9 +47,6 @@ void Scenario_ContinuousRecognitionListGrammar::OnNavigatedTo(NavigationEventArg
{
Page::OnNavigatedTo(e);
- // Keep track of the UI thread dispatcher, as speech events will come in on a separate thread.
- dispatcher = CoreWindow::GetForCurrentThread()->Dispatcher;
-
// Prompt the user for permission to access the microphone. This request will only happen
// once, it will not re-prompt if the user rejects the permission.
create_task(AudioCapturePermissions::RequestMicrophonePermissionAsync(), task_continuation_context::use_current())
@@ -59,20 +56,20 @@ void Scenario_ContinuousRecognitionListGrammar::OnNavigatedTo(NavigationEventArg
{
this->btnContinuousRecognize->IsEnabled = true;
- Windows::Globalization::Language^ speechLanguage = SpeechRecognizer::SystemSpeechLanguage;
- speechContext = ResourceContext::GetForCurrentView();
- speechContext->Languages = ref new VectorView(1, speechLanguage->LanguageTag);
+ Windows::Globalization::Language^ speechLanguage = SpeechRecognizer::SystemSpeechLanguage;
+ speechContext = ResourceContext::GetForCurrentView();
+ speechContext->Languages = ref new VectorView(1, speechLanguage->LanguageTag);
- speechResourceMap = ResourceManager::Current->MainResourceMap->GetSubtree(L"LocalizationSpeechResources");
+ speechResourceMap = ResourceManager::Current->MainResourceMap->GetSubtree(L"LocalizationSpeechResources");
- PopulateLanguageDropdown();
- InitializeRecognizer(SpeechRecognizer::SystemSpeechLanguage);
+ PopulateLanguageDropdown();
+ InitializeRecognizer(SpeechRecognizer::SystemSpeechLanguage);
}
else
{
this->resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
this->resultTextBlock->Text = L"Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";
- this->cbLanguageSelection->IsEnabled = false;
+ this->cbLanguageSelection->IsEnabled = false;
}
});
}
@@ -149,7 +146,7 @@ void Scenario_ContinuousRecognitionListGrammar::InitializeRecognizer(Windows::Gl
speechResourceMap->GetValue("ListGrammarGoHome", speechContext)->ValueAsString + L"', '" +
speechResourceMap->GetValue("ListGrammarGoToContosoStudio", speechContext)->ValueAsString + L"' or '" +
speechResourceMap->GetValue("ListGrammarShowMessage", speechContext)->ValueAsString + L"'";
- listGrammarHelpText->Text =
+ listGrammarHelpText->Text =
speechResourceMap->GetValue("ListGrammarHelpText", speechContext)->ValueAsString + L"\n" +
uiOptionsText;
@@ -231,7 +228,7 @@ void Scenario_ContinuousRecognitionListGrammar::OnNavigatedFrom(NavigationEventA
}
else
{
- cleanupTask = create_task([]() {}, task_continuation_context::use_current());
+ cleanupTask = task_from_result();
}
cleanupTask.then([this]()
@@ -255,7 +252,7 @@ void Scenario_ContinuousRecognitionListGrammar::OnNavigatedFrom(NavigationEventA
/// Unused event details
void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognize_Click(Object^ sender, RoutedEventArgs^ e)
{
- btnContinuousRecognize->IsEnabled = false;
+ btnContinuousRecognize->IsEnabled = false;
// The recognizer can only start listening in a continuous fashion if the recognizer is currently idle.
// This prevents an exception from occurring.
@@ -281,8 +278,8 @@ void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognize_Click(Object
create_task(messageDialog->ShowAsync());
}
}).then([this]() {
- btnContinuousRecognize->IsEnabled = true;
- });
+ btnContinuousRecognize->IsEnabled = true;
+ });
}
else
{
@@ -293,8 +290,8 @@ void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognize_Click(Object
cbLanguageSelection->IsEnabled = true;
create_task(speechRecognizer->ContinuousRecognitionSession->CancelAsync()).then([this]() {
- btnContinuousRecognize->IsEnabled = true;
- });
+ btnContinuousRecognize->IsEnabled = true;
+ });
}
}
@@ -305,7 +302,7 @@ void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognize_Click(Object
/// The current state of the recognizer.
void Scenario_ContinuousRecognitionListGrammar::SpeechRecognizer_StateChanged(SpeechRecognizer ^sender, SpeechRecognizerStateChangedEventArgs ^args)
{
- dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
{
rootPage->NotifyUser("Speech recognizer state: " + args->State.ToString(), NotifyType::StatusMessage);
}));
@@ -322,7 +319,7 @@ void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognitionSession_Com
{
if (args->Status != SpeechRecognitionResultStatus::Success)
{
- dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args]()
{
rootPage->NotifyUser("Continuous Recognition Completed: " + args->Status.ToString(), NotifyType::ErrorMessage);
ContinuousRecoButtonText->Text = " Continuous Recognition";
@@ -353,7 +350,7 @@ void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognitionSession_Res
if (args->Result->Confidence == SpeechRecognitionConfidence::Medium ||
args->Result->Confidence == SpeechRecognitionConfidence::High)
{
- dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args, tag]()
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args, tag]()
{
heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
@@ -364,7 +361,7 @@ void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognitionSession_Res
{
// In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
// is not the primary input mechanism for the application.
- dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args, tag]()
+ Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([this, args, tag]()
{
heardYouSayTextBlock->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
resultTextBlock->Visibility = Windows::UI::Xaml::Visibility::Visible;
@@ -379,7 +376,7 @@ void Scenario_ContinuousRecognitionListGrammar::ContinuousRecognitionSession_Res
void Scenario_ContinuousRecognitionListGrammar::PopulateLanguageDropdown()
{
// disable callback temporarily.
- cbLanguageSelection->SelectionChanged -= cbLanguageSelectionSelectionChangedToken;
+ isPopulatingLanguages = true;
Windows::Globalization::Language^ defaultLanguage = SpeechRecognizer::SystemSpeechLanguage;
auto supportedLanguages = SpeechRecognizer::SupportedGrammarLanguages;
@@ -397,8 +394,7 @@ void Scenario_ContinuousRecognitionListGrammar::PopulateLanguageDropdown()
}
});
- cbLanguageSelectionSelectionChangedToken = cbLanguageSelection->SelectionChanged +=
- ref new SelectionChangedEventHandler(this, &Scenario_ContinuousRecognitionListGrammar::cbLanguageSelection_SelectionChanged);
+ isPopulatingLanguages = false;
}
///
@@ -406,6 +402,11 @@ void Scenario_ContinuousRecognitionListGrammar::PopulateLanguageDropdown()
///
void Scenario_ContinuousRecognitionListGrammar::cbLanguageSelection_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
{
+ if (isPopulatingLanguages)
+ {
+ return;
+ }
+
ComboBoxItem^ item = (ComboBoxItem^)(cbLanguageSelection->SelectedItem);
Windows::Globalization::Language^ newLanguage = (Windows::Globalization::Language^)item->Tag;
@@ -416,7 +417,7 @@ void Scenario_ContinuousRecognitionListGrammar::cbLanguageSelection_SelectionCha
return;
}
}
-
+
try
{
speechContext->Languages = ref new VectorView(1, newLanguage->LanguageTag);
@@ -428,5 +429,5 @@ void Scenario_ContinuousRecognitionListGrammar::cbLanguageSelection_SelectionCha
auto messageDialog = ref new Windows::UI::Popups::MessageDialog(exception->Message, "Exception");
create_task(messageDialog->ShowAsync());
}
-
+
}
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.h b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.h
index f3b4aac7f4..0aef2ac677 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.h
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml.h
@@ -35,21 +35,19 @@ namespace SDKTemplate
static const unsigned int HResultRecognizerNotFound = 0x8004503a;
SDKTemplate::MainPage^ rootPage;
- Windows::UI::Core::CoreDispatcher^ dispatcher;
Windows::Media::SpeechRecognition::SpeechRecognizer^ speechRecognizer;
Windows::ApplicationModel::Resources::Core::ResourceContext^ speechContext;
Windows::ApplicationModel::Resources::Core::ResourceMap^ speechResourceMap;
+ bool isPopulatingLanguages = false;
void ContinuousRecognize_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void InitializeRecognizer(Windows::Globalization::Language^ recognizerLanguage);
void PopulateLanguageDropdown();
-
Windows::Foundation::EventRegistrationToken stateChangedToken;
Windows::Foundation::EventRegistrationToken continuousRecognitionCompletedToken;
Windows::Foundation::EventRegistrationToken continuousRecognitionResultGeneratedToken;
- Windows::Foundation::EventRegistrationToken cbLanguageSelectionSelectionChangedToken;
void SpeechRecognizer_StateChanged(Windows::Media::SpeechRecognition::SpeechRecognizer ^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs ^args);
void ContinuousRecognitionSession_Completed(Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession ^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs ^args);
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cpp b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cpp
index 111ad4fe08..00db0196f6 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cpp
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cpp
@@ -454,7 +454,7 @@ Windows::UI::Color Scenario_ContinuousRecognitionSRGSGrammar::getColor(Platform:
void Scenario_ContinuousRecognitionSRGSGrammar::PopulateLanguageDropdown()
{
// disable callback temporarily.
- cbLanguageSelection->SelectionChanged -= cbLanguageSelectionSelectionChangedToken;
+ isPopulatingLanguages = true;
Windows::Globalization::Language^ defaultLanguage = SpeechRecognizer::SystemSpeechLanguage;
auto supportedLanguages = SpeechRecognizer::SupportedGrammarLanguages;
@@ -471,9 +471,8 @@ void Scenario_ContinuousRecognitionSRGSGrammar::PopulateLanguageDropdown()
cbLanguageSelection->SelectedItem = item;
}
});
-
- cbLanguageSelectionSelectionChangedToken = cbLanguageSelection->SelectionChanged +=
- ref new SelectionChangedEventHandler(this, &Scenario_ContinuousRecognitionSRGSGrammar::cbLanguageSelection_SelectionChanged);
+
+ isPopulatingLanguages = false;
}
///
@@ -481,6 +480,11 @@ void Scenario_ContinuousRecognitionSRGSGrammar::PopulateLanguageDropdown()
///
void Scenario_ContinuousRecognitionSRGSGrammar::cbLanguageSelection_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
{
+ if (isPopulatingLanguages)
+ {
+ return;
+ }
+
ComboBoxItem^ item = (ComboBoxItem^)(cbLanguageSelection->SelectedItem);
Windows::Globalization::Language^ newLanguage = (Windows::Globalization::Language^)item->Tag;
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.h b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.h
index c2026fa5e8..cc217bbc84 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.h
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml.h
@@ -45,6 +45,7 @@ namespace SDKTemplate
Windows::Foundation::Collections::IMap^ colorLookup;
Windows::ApplicationModel::Resources::Core::ResourceContext^ speechContext;
Windows::ApplicationModel::Resources::Core::ResourceMap^ speechResourceMap;
+ bool isPopulatingLanguages = false;
void ContinuousRecognize_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
@@ -54,8 +55,6 @@ namespace SDKTemplate
Windows::Foundation::EventRegistrationToken stateChangedToken;
Windows::Foundation::EventRegistrationToken continuousRecognitionCompletedToken;
Windows::Foundation::EventRegistrationToken continuousRecognitionResultGeneratedToken;
- Windows::Foundation::EventRegistrationToken cbLanguageSelectionSelectionChangedToken;
-
void SpeechRecognizer_StateChanged(Windows::Media::SpeechRecognition::SpeechRecognizer ^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs ^args);
void ContinuousRecognitionSession_Completed(Windows::Media::SpeechRecognition::SpeechContinuousRecognitionSession ^sender, Windows::Media::SpeechRecognition::SpeechContinuousRecognitionCompletedEventArgs ^args);
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.cpp b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.cpp
index e3d0ce8092..cb3f984f79 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.cpp
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.cpp
@@ -378,11 +378,11 @@ void Scenario_ListConstraint::SpeechRecognizer_StateChanged(SpeechRecognizer ^se
void Scenario_ListConstraint::PopulateLanguageDropdown()
{
// disable callback temporarily.
- cbLanguageSelection->SelectionChanged -= cbLanguageSelectionSelectionChangedToken;
+ isPopulatingLanguages = true;
Windows::Globalization::Language^ defaultLanguage = SpeechRecognizer::SystemSpeechLanguage;
auto supportedLanguages = SpeechRecognizer::SupportedGrammarLanguages;
- std::for_each(begin(supportedLanguages), end(supportedLanguages), [&](Windows::Globalization::Language^ lang)
+ for (Windows::Globalization::Language^ lang : supportedLanguages)
{
ComboBoxItem^ item = ref new ComboBoxItem();
item->Tag = lang;
@@ -394,10 +394,9 @@ void Scenario_ListConstraint::PopulateLanguageDropdown()
item->IsSelected = true;
cbLanguageSelection->SelectedItem = item;
}
- });
+ }
- cbLanguageSelectionSelectionChangedToken = cbLanguageSelection->SelectionChanged +=
- ref new SelectionChangedEventHandler(this, &Scenario_ListConstraint::cbLanguageSelection_SelectionChanged);
+ isPopulatingLanguages = false;
}
@@ -406,6 +405,11 @@ void Scenario_ListConstraint::PopulateLanguageDropdown()
///
void Scenario_ListConstraint::cbLanguageSelection_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
{
+ if (isPopulatingLanguages)
+ {
+ return;
+ }
+
ComboBoxItem^ item = (ComboBoxItem^)(cbLanguageSelection->SelectedItem);
Windows::Globalization::Language^ newLanguage = (Windows::Globalization::Language^)item->Tag;
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.h b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.h
index 995cce1109..f508b7a4eb 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.h
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml.h
@@ -44,6 +44,7 @@ namespace SDKTemplate
Windows::Media::SpeechRecognition::SpeechRecognizer^ speechRecognizer;
Windows::ApplicationModel::Resources::Core::ResourceContext^ speechContext;
Windows::ApplicationModel::Resources::Core::ResourceMap^ speechResourceMap;
+ bool isPopulatingLanguages = false;
void RecognizeWithUIListConstraint_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void RecognizeWithoutUIListConstraint_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
@@ -52,7 +53,6 @@ namespace SDKTemplate
void PopulateLanguageDropdown();
Windows::Foundation::EventRegistrationToken stateChangedToken;
- Windows::Foundation::EventRegistrationToken cbLanguageSelectionSelectionChangedToken;
void SpeechRecognizer_StateChanged(Windows::Media::SpeechRecognition::SpeechRecognizer ^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs ^args);
void cbLanguageSelection_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.cpp b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.cpp
index 7661bab18f..073f385c6e 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.cpp
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.cpp
@@ -445,11 +445,11 @@ Windows::UI::Color Scenario_SRGSConstraint::getColor(Platform::String^ colorStri
void Scenario_SRGSConstraint::PopulateLanguageDropdown()
{
// disable callback temporarily.
- cbLanguageSelection->SelectionChanged -= cbLanguageSelectionSelectionChangedToken;
+ isPopulatingLanguages = true;
Windows::Globalization::Language^ defaultLanguage = SpeechRecognizer::SystemSpeechLanguage;
auto supportedLanguages = SpeechRecognizer::SupportedGrammarLanguages;
- std::for_each(begin(supportedLanguages), end(supportedLanguages), [&](Windows::Globalization::Language^ lang)
+ for (Windows::Globalization::Language^ lang : supportedLanguages)
{
ComboBoxItem^ item = ref new ComboBoxItem();
item->Tag = lang;
@@ -461,9 +461,9 @@ void Scenario_SRGSConstraint::PopulateLanguageDropdown()
item->IsSelected = true;
cbLanguageSelection->SelectedItem = item;
}
- });
- cbLanguageSelectionSelectionChangedToken = cbLanguageSelection->SelectionChanged +=
- ref new SelectionChangedEventHandler(this, &Scenario_SRGSConstraint::cbLanguageSelection_SelectionChanged);
+ }
+
+ isPopulatingLanguages = false;
}
@@ -472,6 +472,11 @@ void Scenario_SRGSConstraint::PopulateLanguageDropdown()
///
void Scenario_SRGSConstraint::cbLanguageSelection_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
{
+ if (isPopulatingLanguages)
+ {
+ return;
+ }
+
ComboBoxItem^ item = (ComboBoxItem^)(cbLanguageSelection->SelectedItem);
Windows::Globalization::Language^ newLanguage = (Windows::Globalization::Language^)item->Tag;
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.h b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.h
index 1977f4ae80..9f0c70da96 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.h
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml.h
@@ -44,6 +44,7 @@ namespace SDKTemplate
Windows::Foundation::Collections::IMap^ colorLookup;
Windows::ApplicationModel::Resources::Core::ResourceContext^ speechContext;
Windows::ApplicationModel::Resources::Core::ResourceMap^ speechResourceMap;
+ bool isPopulatingLanguages = false;
void RecognizeWithUI_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void RecognizeWithoutUI_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
@@ -55,7 +56,6 @@ namespace SDKTemplate
Windows::UI::Color getColor(Platform::String^ colorString);
Windows::Foundation::EventRegistrationToken stateChangedToken;
- Windows::Foundation::EventRegistrationToken cbLanguageSelectionSelectionChangedToken;
void SpeechRecognizer_StateChanged(Windows::Media::SpeechRecognition::SpeechRecognizer ^sender, Windows::Media::SpeechRecognition::SpeechRecognizerStateChangedEventArgs ^args);
void cbLanguageSelection_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml
deleted file mode 100644
index ac02474d36..0000000000
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This sample showcases speech synthesis using WinRT APIs to convert SSML to speech.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.cpp b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.cpp
index 6c4987d6f0..55cfdf227c 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.cpp
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.cpp
@@ -11,6 +11,7 @@
#include "pch.h"
#include "Scenario_SynthesizeSSML.xaml.h"
+#include
using namespace SDKTemplate;
using namespace Concurrency;
@@ -20,6 +21,8 @@ using namespace Windows::ApplicationModel::Resources::Core;
using namespace Windows::Data::Xml::Dom;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
+using namespace Windows::Media::Core;
+using namespace Windows::Media::Playback;
using namespace Windows::Media::SpeechSynthesis;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
@@ -42,6 +45,12 @@ Scenario_SynthesizeSSML::Scenario_SynthesizeSSML() : rootPage(MainPage::Current)
InitializeListboxVoiceChooser();
UpdateSSMLText();
+
+ MediaPlayer^ player = ref new MediaPlayer();
+ player->AutoPlay = false;
+ player->MediaEnded += ref new TypedEventHandler(this, &Scenario_SynthesizeSSML::media_MediaEnded);
+
+ media->SetMediaPlayer(player);
}
///
@@ -52,9 +61,9 @@ Scenario_SynthesizeSSML::Scenario_SynthesizeSSML() : rootPage(MainPage::Current)
void Scenario_SynthesizeSSML::Speak_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
// If the media is playing, the user has pressed the button to stop the playback.
- if (media->CurrentState == MediaElementState::Playing)
+ if (media->MediaPlayer->PlaybackSession->PlaybackState == MediaPlaybackState::Playing)
{
- media->Stop();
+ media->MediaPlayer->Pause();
btnSpeak->Content = "Speak";
}
else
@@ -66,37 +75,83 @@ void Scenario_SynthesizeSSML::Speak_Click(Platform::Object^ sender, Windows::UI:
btnSpeak->Content = "Stop";
// Create a stream from the text. This will be played using a media element.
- create_task(synthesizer->SynthesizeSsmlToStreamAsync(text), task_continuation_context::use_current())
- .then([this](task synthesisStreamTask)
+ SynthesizeSSMLStream();
+ }
+ }
+}
+
+task Scenario_SynthesizeSSML::SynthesizeSSMLStream()
+{
+ String^ text = textToSynthesize->Text;
+
+ return create_task(synthesizer->SynthesizeSsmlToStreamAsync(text))
+ .then([this](task previousTask)
+ {
+ try
+ {
+ synthesisStream = previousTask.get();
+
+ // Create a media source from the stream:
+ MediaSource^ mediaSource = MediaSource::CreateFromStream(synthesisStream, synthesisStream->ContentType);
+
+ //Create a Media Playback Item
+ MediaPlaybackItem^ mediaPlaybackItem = ref new MediaPlaybackItem(mediaSource);
+
+ // Ensure that the app is notified for cues.
+ RegisterForMarkEvents(mediaPlaybackItem);
+
+ // Set the source of the MediaElement or MediaPlayerElement to the MediaPlaybackItem
+ // and start playing the synthesized audio stream.
+ media->Source = mediaPlaybackItem;
+ media->MediaPlayer->Play();
+ }
+ catch (Exception^ ex)
+ {
+ if (ex->HResult == HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND))
{
- try
- {
- SpeechSynthesisStream^ synthesisStream = synthesisStreamTask.get();
- // Set the source and start playing the synthesized audio stream.
- media->AutoPlay = true;
- media->SetSource(synthesisStream, synthesisStream->ContentType);
- media->Play();
- }
- catch (Exception^ ex)
- {
- if (ex->HResult == HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND))
- {
- btnSpeak->Content = L"Speak";
- btnSpeak->IsEnabled = false;
- listboxVoiceChooser->IsEnabled = false;
- Windows::UI::Popups::MessageDialog^ dialog = ref new Windows::UI::Popups::MessageDialog(ex->Message, "Media playback components unavailable.");
- create_task(dialog->ShowAsync());
- }
- else
- {
- // Typically occurs if the XML provided isn't valid.
- btnSpeak->Content = "Speak";
- Windows::UI::Popups::MessageDialog^ dialog = ref new Windows::UI::Popups::MessageDialog(ex->Message, "Unable to synthesize text (check for invalid xml)");
- create_task(dialog->ShowAsync());
- }
- }
- });
+ btnSpeak->Content = L"Speak";
+ btnSpeak->IsEnabled = false;
+ listboxVoiceChooser->IsEnabled = false;
+ Windows::UI::Popups::MessageDialog^ dialog = ref new Windows::UI::Popups::MessageDialog(ex->Message, "Media playback components unavailable.");
+ create_task(dialog->ShowAsync());
+ }
+ else
+ {
+ // If the text is not able to be synthesized, throw an error message to the user.
+ btnSpeak->Content = L"Speak";
+ Windows::UI::Popups::MessageDialog^ dialog = ref new Windows::UI::Popups::MessageDialog(ex->Message, "Unable to synthesize text");
+ create_task(dialog->ShowAsync());
+ }
}
+ });
+}
+
+///
+/// Register for all mark events
+///
+/// The Media PLayback Item add handlers to.
+void Scenario_SynthesizeSSML::RegisterForMarkEvents(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem)
+{
+ // If tracks were available at source resolution time, itterate through and register:
+ for (unsigned int index = 0; index < mediaPlaybackItem->TimedMetadataTracks->Size; index++)
+ {
+ RegisterMetadataHandlerForMarks(mediaPlaybackItem, index);
+ }
+}
+
+///
+/// Register for just word bookmark events.
+///
+/// The Media Playback Item to register handlers for.
+/// Index of the timedMetadataTrack within the mediaPlaybackItem.
+void Scenario_SynthesizeSSML::RegisterMetadataHandlerForMarks(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem, int index)
+{
+ auto timedTrack = mediaPlaybackItem->TimedMetadataTracks->GetAt(index);
+ //register for only mark cues
+ if (timedTrack->Id == "SpeechBookmark" )
+ {
+ timedTrack->CueEntered += ref new TypedEventHandler(this, &Scenario_SynthesizeSSML::metadata_MarkCueEntered);
+ mediaPlaybackItem->TimedMetadataTracks->SetPresentationMode(index, TimedMetadataTrackPresentationMode::ApplicationPresented);
}
}
@@ -130,9 +185,50 @@ void Scenario_SynthesizeSSML::ListboxVoiceChooser_SelectionChanged(Platform::Obj
///
/// unused object parameter
/// unused event parameter
-void Scenario_SynthesizeSSML::media_MediaEnded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+void Scenario_SynthesizeSSML::media_MediaEnded(Windows::Media::Playback::MediaPlayer^ timedMetadataTrack, Platform::Object^ e)
+{
+ // Because this call is not awaited, execution of the current method continues before the call is completed
+ Windows::ApplicationModel::Core::CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
+ ref new Windows::UI::Core::DispatchedHandler([this]()
+ {
+ btnSpeak->Content = "Speak";
+ }));
+}
+
+///
+/// This function executes when a SpeechCue is hit and calls the functions to update the UI
+///
+/// The timedMetadataTrack associated with the event.
+/// the arguments associated with the event.
+void Scenario_SynthesizeSSML::metadata_MarkCueEntered(Windows::Media::Core::TimedMetadataTrack^ timedMetadataTrack, Windows::Media::Core::MediaCueEventArgs^ args)
+{
+ // Check in case there are different tracks and the handler was used for more tracks
+ if (timedMetadataTrack->TimedMetadataKind == TimedMetadataKind::Speech)
+ {
+ auto cue = (SpeechCue^)args->Cue;
+ if (cue != nullptr)
+ {
+ wprintf(L"Cue text:[%s]\r\n", cue->Text->Data());
+
+ // Do something with the cue
+ // Because this call is not awaited, execution of the current method continues before the call is completed
+ Windows::ApplicationModel::Core::CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
+ ref new Windows::UI::Core::DispatchedHandler([this, cue, timedMetadataTrack]()
+ {
+ // Your UI update code goes here!
+ FillTextBox(cue);
+ }));
+ }
+ }
+}
+
+///
+/// Update the UI with text from the mark
+///
+/// The cue containing the text
+void Scenario_SynthesizeSSML::FillTextBox(SpeechCue^ cue)
{
- btnSpeak->Content = "Speak";
+ textBoxLastMarkTriggered->Text = cue->Text;
}
///
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.h b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.h
index 6efd717363..f5652f1db6 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.h
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeSSML.xaml.h
@@ -28,12 +28,18 @@ namespace SDKTemplate
SDKTemplate::MainPage^ rootPage;
Windows::Media::SpeechSynthesis::SpeechSynthesizer^ synthesizer;
+ Windows::Media::SpeechSynthesis::SpeechSynthesisStream^ synthesisStream;
Windows::ApplicationModel::Resources::Core::ResourceContext^ speechContext;
Windows::ApplicationModel::Resources::Core::ResourceMap^ speechResourceMap;
void Speak_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void ListboxVoiceChooser_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
- void media_MediaEnded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void media_MediaEnded(Windows::Media::Playback::MediaPlayer^ timedMetadataTrack, Platform::Object^ e);
+ Concurrency::task SynthesizeSSMLStream();
+ void RegisterForMarkEvents(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem);
+ void RegisterMetadataHandlerForMarks(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem, int index);
+ void metadata_MarkCueEntered(Windows::Media::Core::TimedMetadataTrack^ timedMetadataTrack, Windows::Media::Core::MediaCueEventArgs^ args);
+ void FillTextBox(Windows::Media::Core::SpeechCue^ cue);
void InitializeListboxVoiceChooser();
void UpdateSSMLText();
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.cpp b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.cpp
new file mode 100644
index 0000000000..7eee7d43cf
--- /dev/null
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.cpp
@@ -0,0 +1,350 @@
+//*********************************************************
+//
+// 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.
+//
+//*********************************************************
+
+#include "pch.h"
+#include "Scenario_SynthesizeTextBoundaries.xaml.h"
+#include
+
+using namespace SDKTemplate;
+using namespace Concurrency;
+using namespace Platform;
+using namespace Platform::Collections;
+using namespace Windows::ApplicationModel::Resources::Core;
+using namespace Windows::Foundation;
+using namespace Windows::Foundation::Collections;
+using namespace Windows::Media::Core;
+using namespace Windows::Media::Playback;
+using namespace Windows::Media::SpeechSynthesis;
+using namespace Windows::UI::Xaml;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Windows::UI::Xaml::Controls::Primitives;
+using namespace Windows::UI::Xaml::Data;
+using namespace Windows::UI::Xaml::Input;
+using namespace Windows::UI::Xaml::Media;
+using namespace Windows::UI::Xaml::Navigation;
+using namespace Windows::UI::Core;
+
+Scenario_SynthesizeTextBoundaries::Scenario_SynthesizeTextBoundaries() : rootPage(MainPage::Current)
+{
+ InitializeComponent();
+ synthesizer = ref new SpeechSynthesizer();
+
+ // initialize localization for text blob
+ speechContext = ResourceContext::GetForCurrentView();
+ speechContext->Languages = ref new VectorView(1, SpeechSynthesizer::DefaultVoice->Language);
+
+ speechResourceMap = ResourceManager::Current->MainResourceMap->GetSubtree(L"LocalizationTTSResources");
+
+ InitializeListboxVoiceChooser();
+
+ MediaPlayer^ player = ref new MediaPlayer();
+ player->AutoPlay = false;
+ player->MediaEnded += ref new TypedEventHandler(this,&Scenario_SynthesizeTextBoundaries::media_MediaEnded);
+
+ media->SetMediaPlayer(player);
+}
+
+///
+/// This is invoked when the user clicks on the speak/stop button.
+///
+/// Button that triggered this event
+/// State information about the routed event
+void Scenario_SynthesizeTextBoundaries::Speak_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
+{
+ // If the media is playing, the user has pressed the button to stop the playback.
+ if (media->MediaPlayer->PlaybackSession->PlaybackState == MediaPlaybackState::Playing)
+ {
+ media->MediaPlayer->Pause();
+ btnSpeak->Content = "Speak";
+ }
+ else
+ {
+ String^ text = textToSynthesize->Text;
+ if (!text->IsEmpty())
+ {
+ // Change the button label. You could also just disable the button if you don't want any user control.
+ btnSpeak->Content = "Stop";
+
+ synthesizer->Options->IncludeWordBoundaryMetadata = true;
+ synthesizer->Options->IncludeSentenceBoundaryMetadata = true;
+
+ //functionality wrapped in task function
+ SynthesizeTextStream();
+ }
+ }
+
+}
+
+task Scenario_SynthesizeTextBoundaries::SynthesizeTextStream()
+{
+ String^ text = textToSynthesize->Text;
+
+ return create_task(synthesizer->SynthesizeTextToStreamAsync(text))
+ .then([this](task previousTask)
+ {
+ try
+ {
+ synthesisStream = previousTask.get();
+
+ // Create a media source from the stream:
+ MediaSource^ mediaSource = MediaSource::CreateFromStream(synthesisStream, synthesisStream->ContentType);
+
+ //Create a Media Playback Item
+ MediaPlaybackItem^ mediaPlaybackItem = ref new MediaPlaybackItem(mediaSource);
+
+ // Ensure that the app is notified for cues.
+ RegisterForBoundaryEvents(mediaPlaybackItem);
+
+ // Set the source of the MediaElement or MediaPlayerElement to the MediaPlaybackItem
+ // and start playing the synthesized audio stream.
+ media->Source = mediaPlaybackItem;
+ media->MediaPlayer->Play();
+ }
+ catch (Exception^ ex)
+ {
+ if (ex->HResult == HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND))
+ {
+ btnSpeak->Content = L"Speak";
+ btnSpeak->IsEnabled = false;
+ listboxVoiceChooser->IsEnabled = false;
+ Windows::UI::Popups::MessageDialog^ dialog =
+ ref new Windows::UI::Popups::MessageDialog(ex->Message, "Media playback components unavailable.");
+ create_task(dialog->ShowAsync());
+ }
+ else
+ {
+ // If the text is not able to be synthesized, throw an error message to the user.
+ btnSpeak->Content = L"Speak";
+ Windows::UI::Popups::MessageDialog^ dialog =
+ ref new Windows::UI::Popups::MessageDialog(ex->Message, "Unable to synthesize text");
+ create_task(dialog->ShowAsync());
+ }
+ }
+ }, task_continuation_context::use_current());
+}
+
+///
+/// This is called when the user has selects a voice from the drop down.
+///
+/// unused object parameter
+/// unused event parameter
+void Scenario_SynthesizeTextBoundaries::ListboxVoiceChooser_SelectionChanged(Object^ sender, SelectionChangedEventArgs^ e)
+{
+ if (e->AddedItems->Size > 0)
+ {
+ ComboBoxItem^ first = safe_cast(e->AddedItems->GetAt(0));
+ VoiceInformation^ voice = safe_cast(first->Tag);
+ synthesizer->Voice = voice;
+
+
+ // update UI text to be an appropriate default translation.
+ speechContext->Languages = ref new VectorView(1, { voice->Language });
+ textToSynthesize->Text = speechResourceMap->GetValue("SynthesizeTextBoundariesDefaultText", speechContext)->ValueAsString;
+
+ }
+}
+
+///
+/// This is invoked when the stream is finished playing.
+///
+///
+/// In this case, we're changing the button label based on the state.
+///
+/// unused object parameter
+/// unused event parameter
+void Scenario_SynthesizeTextBoundaries::media_MediaEnded(Windows::Media::Playback::MediaPlayer^ sender, Platform::Object^ e)
+{
+
+ // Because this call is not awaited, execution of the current method continues before the call is completed
+ Windows::ApplicationModel::Core::CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
+ ref new Windows::UI::Core::DispatchedHandler([this]()
+ {
+ btnSpeak->Content = "Speak";
+ }));
+}
+
+///
+/// This creates items out of the system installed voices. The voices are then displayed in a listbox.
+/// This allows the user to change the voice of the synthesizer in your app based on their preference.
+///
+void Scenario_SynthesizeTextBoundaries::InitializeListboxVoiceChooser()
+{
+ // Get all of the installed voices.
+ IVectorView^ voices = SpeechSynthesizer::AllVoices;
+
+ // Get the currently selected voice.
+ VoiceInformation^ currentVoice = synthesizer->Voice;
+
+ // Copy the read-only voice information IVectorView into a mutable std::vector
+ std::vector sortedVoices(voices->Size);
+ std::copy(begin(voices), end(voices), sortedVoices.begin());
+
+ // Sort it based on the language tag (en-US, fr-FR, etc), to group them for readability.
+ std::sort(begin(sortedVoices), end(sortedVoices), [](VoiceInformation^ a, VoiceInformation^ b)
+ {
+ return b->Language > a->Language;
+ });
+
+ // Add them to the combo box in order.
+ std::for_each(begin(sortedVoices), end(sortedVoices), [&](VoiceInformation^ voice)
+ {
+ ComboBoxItem^ item = ref new ComboBoxItem();
+ item->Name = voice->DisplayName;
+ item->Tag = voice;
+ item->Content = voice->DisplayName + L" (" + voice->Language + L")";
+ listboxVoiceChooser->Items->Append(item);
+
+ // Check to see if we're looking at the current voice and set it as selected in the listbox.
+ if (currentVoice->Id == voice->Id)
+ {
+ item->IsSelected = true;
+ listboxVoiceChooser->SelectedItem = item;
+ }
+ });
+}
+
+///
+/// Register for all boundary events and register a function to add any new events if they arise.
+///
+/// The Media Playback Item to register events for.
+void Scenario_SynthesizeTextBoundaries::RegisterForBoundaryEvents(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem)
+{
+ // If tracks were available at source resolution time, itterate through and register:
+ for (unsigned int index = 0; index < mediaPlaybackItem->TimedMetadataTracks->Size; index++)
+ {
+ RegisterMetadataHandlerForWords(mediaPlaybackItem, index);
+ RegisterMetadataHandlerForSentences(mediaPlaybackItem, index);
+ }
+
+ // Since the tracks are added later we will
+ // monitor the tracks being added and subscribe to the ones of interest
+ mediaPlaybackItem->TimedMetadataTracksChanged +=
+ ref new TypedEventHandler
+ (this, &Scenario_SynthesizeTextBoundaries::timedMetadataTrackChangedHandler);
+}
+
+///
+/// Register for boundary events when they arise.
+///
+/// The Media PLayback Item add handlers to.
+/// Arguments for the event.
+void Scenario_SynthesizeTextBoundaries::timedMetadataTrackChangedHandler(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem,
+ Windows::Foundation::Collections::IVectorChangedEventArgs^ args)
+{
+ if (args->CollectionChange == CollectionChange::ItemInserted)
+ {
+ RegisterMetadataHandlerForWords(mediaPlaybackItem, args->Index);
+ RegisterMetadataHandlerForSentences(mediaPlaybackItem, args->Index);
+ }
+ else if (args->CollectionChange == CollectionChange::Reset)
+ {
+ for (unsigned int index = 0; index < mediaPlaybackItem->TimedMetadataTracks->Size; index++)
+ {
+ RegisterMetadataHandlerForWords(mediaPlaybackItem, index);
+ RegisterMetadataHandlerForSentences(mediaPlaybackItem, index);
+ }
+ }
+}
+
+
+///
+/// Register for just word boundary events.
+///
+/// The Media PLayback Item add handlers to.
+/// Index of the timedMetadataTrack within the mediaPlaybackItem.
+void Scenario_SynthesizeTextBoundaries::RegisterMetadataHandlerForWords(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem, int index)
+{
+ auto timedTrack = mediaPlaybackItem->TimedMetadataTracks->GetAt(index);
+ //register for only word cues
+ if (timedTrack->Id == "SpeechWord" && checkBoxWordBoundaries->IsChecked->Value == true)
+ {
+ timedTrack->CueEntered += ref new TypedEventHandler
+ (this, &Scenario_SynthesizeTextBoundaries::metadata_SpeechCueEntered);
+ mediaPlaybackItem->TimedMetadataTracks->SetPresentationMode(index, TimedMetadataTrackPresentationMode::ApplicationPresented);
+ }
+}
+
+///
+/// Register for just sentence boundary events.
+///
+/// The Media Playback Item to register handlers for.
+/// Index of the timedMetadataTrack within the mediaPlaybackItem.
+void Scenario_SynthesizeTextBoundaries::RegisterMetadataHandlerForSentences(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem, int index)
+{
+ auto timedTrack = mediaPlaybackItem->TimedMetadataTracks->GetAt(index);
+ //register for only sentence cues
+ if (timedTrack->Id == "SpeechSentence" && (bool)checkBoxSentenceBoundaries->IsChecked->Value == true)
+ {
+ timedTrack->CueEntered += ref new TypedEventHandler
+ (this, &Scenario_SynthesizeTextBoundaries::metadata_SpeechCueEntered);
+ mediaPlaybackItem->TimedMetadataTracks->SetPresentationMode(index, TimedMetadataTrackPresentationMode::ApplicationPresented);
+ }
+}
+
+///
+/// This function executes when a SpeechCue is hit and calls the functions to update the UI
+///
+/// The timedMetadataTrack associated with the event.
+/// the arguments associated with the event.
+void Scenario_SynthesizeTextBoundaries::metadata_SpeechCueEntered(Windows::Media::Core::TimedMetadataTrack^ timedMetadataTrack,
+ Windows::Media::Core::MediaCueEventArgs^ args)
+{
+ // Check in case there are different tracks and the handler was used for more tracks
+ if (timedMetadataTrack->TimedMetadataKind == TimedMetadataKind::Speech)
+ {
+ auto cue = (SpeechCue^)args->Cue;
+ if (cue != nullptr)
+ {
+ printf("Hit Cue with start:%d and end: %d\r\n", cue->StartPositionInInput->Value,cue->EndPositionInInput->Value);
+ wprintf(L"Cue text:[%s]\r\n", cue->Text->Data());
+
+ // Do something with the cue
+ // Because this call is not awaited, execution of the current method continues before the call is completed
+ Windows::ApplicationModel::Core::CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
+ ref new Windows::UI::Core::DispatchedHandler([this, cue, timedMetadataTrack]()
+ {
+ // Your UI update code goes here!
+ HighlightWordOnScreen(cue->StartPositionInInput->Value, cue->EndPositionInInput->Value);
+ FillTextBoxes(cue, timedMetadataTrack);
+ }));
+ }
+ }
+}
+
+///
+/// This function selects the word associated with the start and end positions.
+///
+/// the starting index of the word
+/// the ending index of the word
+void Scenario_SynthesizeTextBoundaries::HighlightWordOnScreen(int startPositionInInput, int endPositionInInput)
+{
+ //since we are using indecies we need to add 1 to the end position
+ textToSynthesize->Select((int)startPositionInInput, (int)(endPositionInInput + 1) - (int)startPositionInInput);
+}
+
+///
+/// This function executes when a SpeechCue is hit and calls the functions to update the UI
+///
+/// The timedMetadataTrack associated with the event.
+/// the SpeechCue object.
+void Scenario_SynthesizeTextBoundaries::FillTextBoxes(Windows::Media::Core::SpeechCue ^ cue, Windows::Media::Core::TimedMetadataTrack ^ timedMetadataTrack)
+{
+ //if it is a sentence cue, populate the sentence text box.
+ if (timedMetadataTrack->Id == "SpeechSentence")
+ {
+ textBoxLastSpeechSentence->Text = cue->Text;
+ }
+ //if it is a word cue, populate the word text box
+ if (timedMetadataTrack->Id == "SpeechWord")
+ {
+ textBoxLastSpeechWord->Text = cue->Text;
+ }
+}
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.h b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.h
new file mode 100644
index 0000000000..f204e0e83a
--- /dev/null
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeTextBoundaries.xaml.h
@@ -0,0 +1,49 @@
+#pragma once
+//*********************************************************
+//
+// 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.
+//
+//*********************************************************
+
+#pragma once
+
+#include "Scenario_SynthesizeTextBoundaries.g.h"
+#include "MainPage.xaml.h"
+
+namespace SDKTemplate
+{
+ [Windows::Foundation::Metadata::WebHostHidden]
+ public ref class Scenario_SynthesizeTextBoundaries sealed
+ {
+ public:
+ Scenario_SynthesizeTextBoundaries();
+ private:
+ SDKTemplate::MainPage^ rootPage;
+
+
+ Windows::Media::SpeechSynthesis::SpeechSynthesizer^ synthesizer;
+ Windows::Media::SpeechSynthesis::SpeechSynthesisStream^ synthesisStream;
+ Windows::ApplicationModel::Resources::Core::ResourceContext^ speechContext;
+ Windows::ApplicationModel::Resources::Core::ResourceMap^ speechResourceMap;
+
+ void Speak_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
+ void ListboxVoiceChooser_SelectionChanged(Platform::Object^ sender, Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
+ void media_MediaEnded(Windows::Media::Playback::MediaPlayer^ sender, Platform::Object^ e);
+ Concurrency::task SynthesizeTextStream();
+ void RegisterForBoundaryEvents(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem);
+ void RegisterMetadataHandlerForWords(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem, int index);
+ void RegisterMetadataHandlerForSentences(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem, int index);
+ void metadata_SpeechCueEntered(Windows::Media::Core::TimedMetadataTrack^ timedMetadataTrack, Windows::Media::Core::MediaCueEventArgs^ args);
+ void HighlightWordOnScreen(int startPositionInInput, int endPositionInInput);
+ void FillTextBoxes(Windows::Media::Core::SpeechCue^ cue, Windows::Media::Core::TimedMetadataTrack^ timedMetadataTrack);
+ void timedMetadataTrackChangedHandler(Windows::Media::Playback::MediaPlaybackItem^ mediaPlaybackItem,
+ Windows::Foundation::Collections::IVectorChangedEventArgs^ args);
+
+ void InitializeListboxVoiceChooser();
+ };
+}
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/SpeechAndTTS.vcxproj b/Samples/SpeechRecognitionAndSynthesis/cpp/SpeechAndTTS.vcxproj
index 9387bd3ad2..a52fe47804 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/SpeechAndTTS.vcxproj
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/SpeechAndTTS.vcxproj
@@ -114,7 +114,7 @@
- /bigobj %(AdditionalOptions)
+ /bigobj %(AdditionalOptions) /await4453;28204
@@ -147,34 +147,37 @@
- Scenario_ContinuousDictation.xaml
+ ..\shared\xaml\Scenario_ContinuousDictation.xaml
- Scenario_ContinuousRecognitionListGrammar.xaml
+ ..\shared\xaml\Scenario_ContinuousRecognitionListGrammar.xaml
- Scenario_ContinuousRecognitionSRGSGrammar.xaml
+ ..\shared\xaml\Scenario_ContinuousRecognitionSRGSGrammar.xaml
- Scenario_ListConstraint.xaml
+ ..\shared\xaml\Scenario_ListConstraint.xaml
- Scenario_PauseAsync.xaml
+ ..\shared\xaml\Scenario_PauseAsync.xaml
- Scenario_PredefinedDictationGrammar.xaml
+ ..\shared\xaml\Scenario_PredefinedDictationGrammar.xaml
- Scenario_PredefinedWebSearchGrammar.xaml
+ ..\shared\xaml\Scenario_PredefinedWebSearchGrammar.xaml
- Scenario_SRGSConstraint.xaml
+ ..\shared\xaml\Scenario_SRGSConstraint.xaml
- Scenario_SynthesizeSSML.xaml
+ ..\shared\xaml\Scenario_SynthesizeSSML.xaml
- Scenario_SynthesizeText.xaml
+ ..\shared\xaml\Scenario_SynthesizeText.xaml
+
+
+ ..\shared\xaml\Scenario_SynthesizeTextBoundaries.xaml
@@ -184,19 +187,22 @@
Designer
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
Styles\Styles.xaml
+
+ Designer
+
@@ -221,34 +227,37 @@
- Scenario_ContinuousDictation.xaml
+ ..\shared\xaml\Scenario_ContinuousDictation.xaml
- Scenario_ContinuousRecognitionListGrammar.xaml
+ ..\shared\xaml\Scenario_ContinuousRecognitionListGrammar.xaml
- Scenario_ContinuousRecognitionSRGSGrammar.xaml
+ ..\shared\xaml\Scenario_ContinuousRecognitionSRGSGrammar.xaml
- Scenario_ListConstraint.xaml
+ ..\shared\xaml\Scenario_ListConstraint.xaml
- Scenario_PauseAsync.xaml
+ ..\shared\xaml\Scenario_PauseAsync.xaml
- Scenario_PredefinedDictationGrammar.xaml
+ ..\shared\xaml\Scenario_PredefinedDictationGrammar.xaml
- Scenario_PredefinedWebSearchGrammar.xaml
+ ..\shared\xaml\Scenario_PredefinedWebSearchGrammar.xaml
- Scenario_SRGSConstraint.xaml
+ ..\shared\xaml\Scenario_SRGSConstraint.xaml
- Scenario_SynthesizeSSML.xaml
+ ..\shared\xaml\Scenario_SynthesizeSSML.xaml
- Scenario_SynthesizeText.xaml
+ ..\shared\xaml\Scenario_SynthesizeText.xaml
+
+
+ ..\shared\xaml\Scenario_SynthesizeTextBoundaries.xaml
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/SpeechAndTTS.vcxproj.filters b/Samples/SpeechRecognitionAndSynthesis/cpp/SpeechAndTTS.vcxproj.filters
index b628e0b465..e3bf8a7c91 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/SpeechAndTTS.vcxproj.filters
+++ b/Samples/SpeechRecognitionAndSynthesis/cpp/SpeechAndTTS.vcxproj.filters
@@ -115,6 +115,7 @@
+
@@ -132,6 +133,7 @@
+
@@ -141,16 +143,17 @@
Styles
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/AudioCapturePermissions.cs b/Samples/SpeechRecognitionAndSynthesis/cs/AudioCapturePermissions.cs
index e67e53c3d0..1a927d8df8 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/AudioCapturePermissions.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/AudioCapturePermissions.cs
@@ -13,7 +13,7 @@
using System.Threading.Tasks;
using Windows.Media.Capture;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
public class AudioCapturePermissions
{
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousDictationScenario.xaml b/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousDictationScenario.xaml
deleted file mode 100644
index 5e7d233451..0000000000
--- a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousDictationScenario.xaml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Continuous Dictation.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The speech recognition privacy settings have not been accepted. Open Privacy Settings to review the privacy policy and enable personalization.
-
-
-
-
-
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionListGrammarScenario.xaml b/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionListGrammarScenario.xaml
deleted file mode 100644
index 544d836bf9..0000000000
--- a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionListGrammarScenario.xaml
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- This sample showcases continuous recognition using a list grammar for asynchronous voice commands.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionSRGSConstraintScenario.xaml b/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionSRGSConstraintScenario.xaml
deleted file mode 100644
index 2a0c408e5c..0000000000
--- a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionSRGSConstraintScenario.xaml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- This sample showcases continuous recognition using an SRGS/GRXML grammar for asynchronous voice commands.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/ListConstraintScenario.xaml b/Samples/SpeechRecognitionAndSynthesis/cs/ListConstraintScenario.xaml
deleted file mode 100644
index 3a425575aa..0000000000
--- a/Samples/SpeechRecognitionAndSynthesis/cs/ListConstraintScenario.xaml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- This sample showcases one-shot speech recognition using a custom list-based grammar.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/Package.appxmanifest b/Samples/SpeechRecognitionAndSynthesis/cs/Package.appxmanifest
index d17e094c0b..2631854b85 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/Package.appxmanifest
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Package.appxmanifest
@@ -21,7 +21,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/PauseAsyncScenario.xaml b/Samples/SpeechRecognitionAndSynthesis/cs/PauseAsyncScenario.xaml
deleted file mode 100644
index 0a1921f73d..0000000000
--- a/Samples/SpeechRecognitionAndSynthesis/cs/PauseAsyncScenario.xaml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- This sample showcases how to switch grammars during a continuous recognition session.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/PredefinedDictationGrammarScenario.xaml b/Samples/SpeechRecognitionAndSynthesis/cs/PredefinedDictationGrammarScenario.xaml
deleted file mode 100644
index 071cf85f65..0000000000
--- a/Samples/SpeechRecognitionAndSynthesis/cs/PredefinedDictationGrammarScenario.xaml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- This sample showcases one-shot speech recognition using the predefined dictation grammar.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The speech recognition privacy settings have not been accepted. Open Privacy Settings to review the privacy policy and enable personalization.
-
-
-
-
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/PredefinedWebSearchGrammarScenario.xaml b/Samples/SpeechRecognitionAndSynthesis/cs/PredefinedWebSearchGrammarScenario.xaml
deleted file mode 100644
index 5f97293748..0000000000
--- a/Samples/SpeechRecognitionAndSynthesis/cs/PredefinedWebSearchGrammarScenario.xaml
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- This sample showcases one-shot speech recognition using the predefined web search grammar.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The speech recognition privacy settings have not been accepted. Open Privacy Settings to review the privacy policy and enable personalization.
-
-
-
-
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/SRGSConstraintScenario.xaml b/Samples/SpeechRecognitionAndSynthesis/cs/SRGSConstraintScenario.xaml
deleted file mode 100644
index 7b105f3fcd..0000000000
--- a/Samples/SpeechRecognitionAndSynthesis/cs/SRGSConstraintScenario.xaml
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- This sample showcases one-shot speech recognition using a custom SRGS/GRXML grammar.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/SampleConfiguration.cs b/Samples/SpeechRecognitionAndSynthesis/cs/SampleConfiguration.cs
index c8a677f3c0..403097ed03 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/SampleConfiguration.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/SampleConfiguration.cs
@@ -12,7 +12,7 @@
using System;
using System.Collections.Generic;
using Windows.UI.Xaml.Controls;
-using SpeechAndTTS;
+using SDKTemplate;
namespace SDKTemplate
{
@@ -22,16 +22,17 @@ public partial class MainPage : Page
List scenarios = new List
{
- new Scenario() { Title="Synthesize Text", ClassType=typeof(SynthesizeTextScenario)},
- new Scenario() { Title="Synthesize SSML", ClassType=typeof(SynthesizeSSMLScenario)},
- new Scenario() { Title="Predefined Dictation Grammar", ClassType=typeof(PredefinedDictationGrammarScenario)},
- new Scenario() { Title="Predefined WebSearch Grammar", ClassType=typeof(PredefinedWebSearchGrammarScenario)},
- new Scenario() { Title="Custom List Constraint", ClassType=typeof(ListConstraintScenario)},
- new Scenario() { Title="Custom SRGS Constraint", ClassType=typeof(SRGSConstraintScenario)},
- new Scenario() { Title="Continuous Dictation", ClassType=typeof(ContinuousDictationScenario)},
- new Scenario() { Title="Continuous List Commands", ClassType=typeof(ContinuousRecoListGrammarScenario)},
- new Scenario() { Title="Continuous SRGS Commands", ClassType=typeof(ContinuousRecoSRGSConstraintScenario)},
- new Scenario() { Title="PauseAsync to Change Grammar", ClassType=typeof(PauseAsyncScenario)}
+ new Scenario() { Title="Synthesize Text", ClassType=typeof(Scenario_SynthesizeText)},
+ new Scenario() { Title="Synthesize Text with Boundaries", ClassType=typeof(Scenario_SynthesizeTextBoundaries)},
+ new Scenario() { Title="Synthesize SSML", ClassType=typeof(Scenario_SynthesizeSSML)},
+ new Scenario() { Title="Predefined Dictation Grammar", ClassType=typeof(Scenario_PredefinedDictationGrammar)},
+ new Scenario() { Title="Predefined WebSearch Grammar", ClassType=typeof(Scenario_PredefinedWebSearchGrammar)},
+ new Scenario() { Title="Custom List Constraint", ClassType=typeof(Scenario_ListConstraint)},
+ new Scenario() { Title="Custom SRGS Constraint", ClassType=typeof(Scenario_SRGSConstraint)},
+ new Scenario() { Title="Continuous Dictation", ClassType=typeof(Scenario_ContinuousDictation)},
+ new Scenario() { Title="Continuous List Commands", ClassType=typeof(Scenario_ContinuousRecognitionListGrammar)},
+ new Scenario() { Title="Continuous SRGS Commands", ClassType=typeof(Scenario_ContinuousRecognitionSRGSGrammar)},
+ new Scenario() { Title="PauseAsync to Change Grammar", ClassType=typeof(Scenario_PauseAsync)}
};
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousDictationScenario.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousDictation.xaml.cs
similarity index 95%
rename from Samples/SpeechRecognitionAndSynthesis/cs/ContinuousDictationScenario.xaml.cs
rename to Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousDictation.xaml.cs
index a91cb60698..2fdda5caf7 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousDictationScenario.xaml.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousDictation.xaml.cs
@@ -23,17 +23,13 @@
using Windows.UI.Xaml.Documents;
using System.Threading.Tasks;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
- public sealed partial class ContinuousDictationScenario : Page
+ public sealed partial class Scenario_ContinuousDictation : Page
{
// Reference to the main sample page in order to post status messages.
private MainPage rootPage;
- // Speech events may come in on a thread other than the UI thread, keep track of the UI thread's
- // dispatcher, so we can update the UI in a thread-safe manner.
- private CoreDispatcher dispatcher;
-
// The speech recognizer used throughout this sample.
private SpeechRecognizer speechRecognizer;
@@ -51,7 +47,7 @@ public sealed partial class ContinuousDictationScenario : Page
///
private static uint HResultPrivacyStatementDeclined = 0x80045509;
- public ContinuousDictationScenario()
+ public Scenario_ContinuousDictation()
{
this.InitializeComponent();
isListening = false;
@@ -70,9 +66,6 @@ protected async override void OnNavigatedTo(NavigationEventArgs e)
{
rootPage = MainPage.Current;
- // Keep track of the UI thread dispatcher, as speech events will come in on a separate thread.
- dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
-
// Prompt the user for permission to access the microphone. This request will only happen
// once, it will not re-prompt if the user rejects the permission.
bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
@@ -231,7 +224,7 @@ private async void ContinuousRecognitionSession_Completed(SpeechContinuousRecogn
// With dictation (no grammar in place) modes, the default timeout is 20 seconds.
if (args.Status == SpeechRecognitionResultStatus.TimeoutExceeded)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
rootPage.NotifyUser("Automatic Time Out of Dictation", NotifyType.StatusMessage);
DictationButtonText.Text = " Dictate";
@@ -242,7 +235,7 @@ await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
}
else
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
rootPage.NotifyUser("Continuous Recognition Completed: " + args.Status.ToString(), NotifyType.StatusMessage);
DictationButtonText.Text = " Dictate";
@@ -264,7 +257,7 @@ private async void SpeechRecognizer_HypothesisGenerated(SpeechRecognizer sender,
// Update the textbox with the currently confirmed text, and the hypothesis combined.
string textboxContent = dictatedTextBuilder.ToString() + " " + hypothesis + " ...";
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
dictationTextBox.Text = textboxContent;
btnClearText.IsEnabled = true;
@@ -287,7 +280,7 @@ private async void ContinuousRecognitionSession_ResultGenerated(SpeechContinuous
{
dictatedTextBuilder.Append(args.Result.Text + " ");
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
discardedTextBlock.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
@@ -300,7 +293,7 @@ await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
// In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
// is not the primary input mechanism for the application.
// Here, just remove any hypothesis text by resetting it to the last known good.
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
dictationTextBox.Text = dictatedTextBuilder.ToString();
string discardedText = args.Result.Text;
@@ -322,7 +315,7 @@ await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
/// The current state of the recognizer.
private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage);
});
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionListGrammarScenario.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionListGrammar.xaml.cs
similarity index 95%
rename from Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionListGrammarScenario.xaml.cs
rename to Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionListGrammar.xaml.cs
index f2a3eb92a3..d16994d236 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionListGrammarScenario.xaml.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionListGrammar.xaml.cs
@@ -21,17 +21,13 @@
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
- public sealed partial class ContinuousRecoListGrammarScenario : Page
+ public sealed partial class Scenario_ContinuousRecognitionListGrammar : Page
{
// Reference to the main sample page in order to post status messages.
private MainPage rootPage;
- // Speech events may come in on a thread other than the UI thread, keep track of the UI thread's
- // dispatcher, so we can update the UI in a thread-safe manner.
- private CoreDispatcher dispatcher;
-
// The speech recognizer used throughout this sample.
private SpeechRecognizer speechRecognizer;
@@ -45,10 +41,12 @@ public sealed partial class ContinuousRecoListGrammarScenario : Page
private ResourceContext speechContext;
private ResourceMap speechResourceMap;
+ private bool isPopulatingLanguages = false;
+
// Keep track of whether the continuous recognizer is currently running, so it can be cleaned up appropriately.
private bool isListening;
- public ContinuousRecoListGrammarScenario()
+ public Scenario_ContinuousRecognitionListGrammar()
{
this.InitializeComponent();
isListening = false;
@@ -66,9 +64,6 @@ protected async override void OnNavigatedTo(NavigationEventArgs e)
{
rootPage = MainPage.Current;
- // Keep track of the UI thread dispatcher, as speech events will come in on a separate thread.
- dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
-
// Prompt the user for permission to access the microphone. This request will only happen
// once, it will not re-prompt if the user rejects the permission.
bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
@@ -104,7 +99,8 @@ private void PopulateLanguageDropdown()
{
// disable the callback so we don't accidentally trigger initialization of the recognizer
// while initialization is already in progress.
- cbLanguageSelection.SelectionChanged -= cbLanguageSelection_SelectionChanged;
+ isPopulatingLanguages = true;
+
Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
IEnumerable supportedLanguages = SpeechRecognizer.SupportedGrammarLanguages;
foreach (Language lang in supportedLanguages)
@@ -120,8 +116,8 @@ private void PopulateLanguageDropdown()
cbLanguageSelection.SelectedItem = item;
}
}
-
- cbLanguageSelection.SelectionChanged += cbLanguageSelection_SelectionChanged;
+
+ isPopulatingLanguages = false;
}
///
@@ -132,6 +128,11 @@ private void PopulateLanguageDropdown()
/// Ignored
private async void cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
+ if (isPopulatingLanguages)
+ {
+ return;
+ }
+
ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
Language newLanguage = (Language)item.Tag;
if (speechRecognizer != null)
@@ -310,7 +311,7 @@ private async void ContinuousRecognitionSession_Completed(SpeechContinuousRecogn
{
if (args.Status != SpeechRecognitionResultStatus.Success)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
rootPage.NotifyUser("Continuous Recognition Completed: " + args.Status.ToString(), NotifyType.StatusMessage);
ContinuousRecoButtonText.Text = " Continuous Recognition";
@@ -342,7 +343,7 @@ private async void ContinuousRecognitionSession_ResultGenerated(SpeechContinuous
if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||
args.Result.Confidence == SpeechRecognitionConfidence.High)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
heardYouSayTextBlock.Visibility = Visibility.Visible;
resultTextBlock.Visibility = Visibility.Visible;
@@ -353,7 +354,7 @@ await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
// In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
// is not the primary input mechanism for the application.
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
heardYouSayTextBlock.Visibility = Visibility.Collapsed;
resultTextBlock.Visibility = Visibility.Visible;
@@ -369,7 +370,7 @@ await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
/// The current state of the recognizer.
private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {
rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage);
});
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionSRGSConstraintScenario.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs
similarity index 96%
rename from Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionSRGSConstraintScenario.xaml.cs
rename to Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs
index 3c5e18196a..3266b23087 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/ContinuousRecognitionSRGSConstraintScenario.xaml.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ContinuousRecognitionSRGSGrammar.xaml.cs
@@ -25,17 +25,13 @@
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
- public sealed partial class ContinuousRecoSRGSConstraintScenario : Page
+ public sealed partial class Scenario_ContinuousRecognitionSRGSGrammar : Page
{
// Reference to the main sample page in order to post status messages.
private MainPage rootPage;
- // Speech events may come in on a thread other than the UI thread, keep track of the UI thread's
- // dispatcher, so we can update the UI in a thread-safe manner.
- private CoreDispatcher dispatcher;
-
///
/// the HResult 0x8004503a typically represents the case where a recognizer for a particular language cannot
/// be found. This may occur if the language is installed, but the speech pack for that language is not.
@@ -49,6 +45,8 @@ public sealed partial class ContinuousRecoSRGSConstraintScenario : Page
private ResourceContext speechContext;
private ResourceMap speechResourceMap;
+ private bool isPopulatingLanguages = false;
+
private Dictionary colorLookup = new Dictionary
{
{ "COLOR_RED", Colors.Red }, {"COLOR_BLUE", Colors.Blue }, {"COLOR_BLACK", Colors.Black},
@@ -57,7 +55,7 @@ public sealed partial class ContinuousRecoSRGSConstraintScenario : Page
{ "COLOR_ORANGE",Colors.Orange}, {"COLOR_GRAY", Colors.Gray}, {"COLOR_WHITE", Colors.White}
};
- public ContinuousRecoSRGSConstraintScenario()
+ public Scenario_ContinuousRecognitionSRGSGrammar()
{
InitializeComponent();
}
@@ -74,9 +72,6 @@ protected async override void OnNavigatedTo(NavigationEventArgs e)
{
rootPage = MainPage.Current;
- // Keep track of the UI thread dispatcher, as speech events will come in on a separate thread.
- dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
-
// Prompt the user for permission to access the microphone. This request will only happen
// once, it will not re-prompt if the user rejects the permission.
bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
@@ -113,7 +108,8 @@ private void PopulateLanguageDropdown()
{
// disable the callback so we don't accidentally trigger initialization of the recognizer
// while initialization is already in progress.
- cbLanguageSelection.SelectionChanged -= cbLanguageSelection_SelectionChanged;
+ isPopulatingLanguages = true;
+
Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
IEnumerable supportedLanguages = SpeechRecognizer.SupportedGrammarLanguages;
foreach (Language lang in supportedLanguages)
@@ -129,7 +125,7 @@ private void PopulateLanguageDropdown()
cbLanguageSelection.SelectedItem = item;
}
}
- cbLanguageSelection.SelectionChanged += cbLanguageSelection_SelectionChanged;
+ isPopulatingLanguages = false;
}
///
@@ -140,6 +136,11 @@ private void PopulateLanguageDropdown()
/// Ignored
private async void cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
+ if (isPopulatingLanguages)
+ {
+ return;
+ }
+
btnContinuousRecognize.IsEnabled = false;
ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
Language newLanguage = (Language)item.Tag;
@@ -334,7 +335,7 @@ public async void ContinuousRecognize_Click(object sender, RoutedEventArgs e)
/// The state of the recognizer
private async void ContinuousRecognitionSession_Completed(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
rootPage.NotifyUser("Continuous Recognition Completed: " + args.Status.ToString(), NotifyType.StatusMessage);
ContinuousRecoButtonText.Text = " Continuous Recognition";
@@ -356,7 +357,7 @@ private async void ContinuousRecognitionSession_ResultGenerated(SpeechContinuous
if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||
args.Result.Confidence == SpeechRecognitionConfidence.High)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
HandleRecognitionResult(args.Result);
});
@@ -367,7 +368,7 @@ await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
// In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
// is not the primary input mechanism for the application.
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
resultTextBlock.Text = speechResourceMap.GetValue("SRGSGarbagePromptText", speechContext).ValueAsString;
});
@@ -381,7 +382,7 @@ await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
/// The current state of the recognizer.
private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage);
});
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/ListConstraintScenario.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ListConstraint.xaml.cs
similarity index 97%
rename from Samples/SpeechRecognitionAndSynthesis/cs/ListConstraintScenario.xaml.cs
rename to Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ListConstraint.xaml.cs
index c6e7e918c1..a141820d42 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/ListConstraintScenario.xaml.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_ListConstraint.xaml.cs
@@ -25,9 +25,9 @@
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
- public sealed partial class ListConstraintScenario : Page
+ public sealed partial class Scenario_ListConstraint : Page
{
///
/// This HResult represents the scenario where a user is prompted to allow in-app speech, but
@@ -44,12 +44,12 @@ public sealed partial class ListConstraintScenario : Page
private static uint HResultRecognizerNotFound = 0x8004503a;
private SpeechRecognizer speechRecognizer;
- private CoreDispatcher dispatcher;
private ResourceContext speechContext;
private ResourceMap speechResourceMap;
+ private bool isPopulatingLanguages = false;
private IAsyncOperation recognitionOperation;
- public ListConstraintScenario()
+ public Scenario_ListConstraint()
{
InitializeComponent();
}
@@ -62,9 +62,6 @@ public ListConstraintScenario()
/// The navigation event details
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
- // Save the UI thread dispatcher to allow speech status messages to be shown on the UI.
- dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
-
bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
if (permissionGained)
{
@@ -100,7 +97,8 @@ private void PopulateLanguageDropdown()
{
// disable the callback so we don't accidentally trigger initialization of the recognizer
// while initialization is already in progress.
- cbLanguageSelection.SelectionChanged -= cbLanguageSelection_SelectionChanged;
+ isPopulatingLanguages = true;
+
Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
IEnumerable supportedLanguages = SpeechRecognizer.SupportedGrammarLanguages;
foreach(Language lang in supportedLanguages)
@@ -116,7 +114,7 @@ private void PopulateLanguageDropdown()
cbLanguageSelection.SelectedItem = item;
}
}
- cbLanguageSelection.SelectionChanged += cbLanguageSelection_SelectionChanged;
+ isPopulatingLanguages = false;
}
///
@@ -127,6 +125,11 @@ private void PopulateLanguageDropdown()
/// Ignored
private async void cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
+ if (isPopulatingLanguages)
+ {
+ return;
+ }
+
ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
Language newLanguage = (Language)item.Tag;
if (speechRecognizer != null)
@@ -301,7 +304,7 @@ private async Task InitializeRecognizer(Language recognizerLanguage)
/// The recognizer's status
private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
MainPage.Current.NotifyUser("Speech recognizer state: " + args.State.ToString(), NotifyType.StatusMessage);
});
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/PauseAsyncScenario.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_PauseAsync.xaml.cs
similarity index 96%
rename from Samples/SpeechRecognitionAndSynthesis/cs/PauseAsyncScenario.xaml.cs
rename to Samples/SpeechRecognitionAndSynthesis/cs/Scenario_PauseAsync.xaml.cs
index 6bbab8d8fd..cf4fd02c24 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/PauseAsyncScenario.xaml.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_PauseAsync.xaml.cs
@@ -19,17 +19,13 @@
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
- public sealed partial class PauseAsyncScenario : Page
+ public sealed partial class Scenario_PauseAsync : Page
{
// Reference to the main sample page in order to post status messages.
private MainPage rootPage;
- // Speech events may come in on a thread other than the UI thread, keep track of the UI thread's
- // dispatcher, so we can update the UI in a thread-safe manner.
- private CoreDispatcher dispatcher;
-
// The speech recognizer used throughout this sample.
private SpeechRecognizer speechRecognizer;
@@ -40,7 +36,7 @@ public sealed partial class PauseAsyncScenario : Page
private SpeechRecognitionListConstraint emailConstraint;
private SpeechRecognitionListConstraint phoneConstraint;
- public PauseAsyncScenario()
+ public Scenario_PauseAsync()
{
InitializeComponent();
isListening = false;
@@ -58,9 +54,6 @@ protected async override void OnNavigatedTo(NavigationEventArgs e)
{
rootPage = MainPage.Current;
- // Keep track of the UI thread dispatcher, as speech events will come in on a separate thread.
- dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
-
// Prompt the user for permission to access the microphone. This request will only happen
// once, it will not re-prompt if the user rejects the permission.
bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
@@ -163,7 +156,7 @@ private async void ContinuousRecognitionSession_Completed(SpeechContinuousRecogn
{
if (args.Status != SpeechRecognitionResultStatus.Success)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
rootPage.NotifyUser("Continuous Recognition Completed: " + args.Status.ToString(), NotifyType.StatusMessage);
recognizeButtonText.Text = " Continuous Recognition";
@@ -196,7 +189,7 @@ private async void ContinuousRecognitionSession_ResultGenerated(SpeechContinuous
if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||
args.Result.Confidence == SpeechRecognitionConfidence.High)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
resultTextBlock.Text = string.Format("Heard: '{0}', (Tag: '{1}', Confidence: {2})", args.Result.Text, tag, args.Result.Confidence.ToString());
});
@@ -205,7 +198,7 @@ await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
// In some scenarios, a developer may choose to ignore giving the user feedback in this case, if speech
// is not the primary input mechanism for the application.
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
resultTextBlock.Text = string.Format("Sorry, I didn't catch that. (Heard: '{0}', Tag: {1}, Confidence: {2})", args.Result.Text, tag, args.Result.Confidence.ToString());
});
@@ -219,7 +212,7 @@ await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
/// The current state of the recognizer.
private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
rootPage.NotifyUser(args.State.ToString(), NotifyType.StatusMessage);
});
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/PredefinedDictationGrammarScenario.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedDictationGrammar.xaml.cs
similarity index 97%
rename from Samples/SpeechRecognitionAndSynthesis/cs/PredefinedDictationGrammarScenario.xaml.cs
rename to Samples/SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedDictationGrammar.xaml.cs
index 53a11f85d3..f9420299fb 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/PredefinedDictationGrammarScenario.xaml.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedDictationGrammar.xaml.cs
@@ -23,9 +23,9 @@
using Windows.UI.Xaml.Navigation;
using Windows.Foundation;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
- public sealed partial class PredefinedDictationGrammarScenario : Page
+ public sealed partial class Scenario_PredefinedDictationGrammar : Page
{
///
/// This HResult represents the scenario where a user is prompted to allow in-app speech, but
@@ -35,12 +35,11 @@ public sealed partial class PredefinedDictationGrammarScenario : Page
private static uint HResultPrivacyStatementDeclined = 0x80045509;
private SpeechRecognizer speechRecognizer;
- private CoreDispatcher dispatcher;
private IAsyncOperation recognitionOperation;
private ResourceContext speechContext;
private ResourceMap speechResourceMap;
- public PredefinedDictationGrammarScenario()
+ public Scenario_PredefinedDictationGrammar()
{
InitializeComponent();
}
@@ -53,9 +52,6 @@ public PredefinedDictationGrammarScenario()
/// The navigation event details
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
- // Save the UI thread dispatcher to allow speech status messages to be shown on the UI.
- dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
-
bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
if (permissionGained)
{
@@ -213,7 +209,7 @@ private async Task InitializeRecognizer(Language recognizerLanguage)
/// The recognizer's status
private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
MainPage.Current.NotifyUser("Speech recognizer state: " + args.State.ToString(), NotifyType.StatusMessage);
});
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/PredefinedWebSearchGrammarScenario.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedWebSearchGrammar.xaml.cs
similarity index 97%
rename from Samples/SpeechRecognitionAndSynthesis/cs/PredefinedWebSearchGrammarScenario.xaml.cs
rename to Samples/SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedWebSearchGrammar.xaml.cs
index 665e062ca0..5f269803d4 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/PredefinedWebSearchGrammarScenario.xaml.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_PredefinedWebSearchGrammar.xaml.cs
@@ -23,9 +23,9 @@
using Windows.Foundation;
using Windows.ApplicationModel.Resources.Core;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
- public sealed partial class PredefinedWebSearchGrammarScenario : Page
+ public sealed partial class Scenario_PredefinedWebSearchGrammar : Page
{
///
/// This HResult represents the scenario where a user is prompted to allow in-app speech, but
@@ -35,12 +35,11 @@ public sealed partial class PredefinedWebSearchGrammarScenario : Page
private static uint HResultPrivacyStatementDeclined = 0x80045509;
private SpeechRecognizer speechRecognizer;
- private CoreDispatcher dispatcher;
private IAsyncOperation recognitionOperation;
private ResourceContext speechContext;
private ResourceMap speechResourceMap;
- public PredefinedWebSearchGrammarScenario()
+ public Scenario_PredefinedWebSearchGrammar()
{
InitializeComponent();
}
@@ -53,9 +52,6 @@ public PredefinedWebSearchGrammarScenario()
/// The navigation event details
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
- // Save the UI thread dispatcher to allow speech status messages to be shown on the UI.
- dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
-
bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
if (permissionGained)
{
@@ -183,7 +179,7 @@ private async Task InitializeRecognizer(Language recognizerLanguage)
/// The recognizer's status
private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
MainPage.Current.NotifyUser("Speech recognizer state: " + args.State.ToString(), NotifyType.StatusMessage);
});
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/SRGSConstraintScenario.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SRGSConstraint.xaml.cs
similarity index 97%
rename from Samples/SpeechRecognitionAndSynthesis/cs/SRGSConstraintScenario.xaml.cs
rename to Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SRGSConstraint.xaml.cs
index 76bcb6eeea..6db638ad4d 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/SRGSConstraintScenario.xaml.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SRGSConstraint.xaml.cs
@@ -26,9 +26,9 @@
using Windows.UI.Xaml.Navigation;
using Windows.Foundation;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
- public sealed partial class SRGSConstraintScenario : Page
+ public sealed partial class Scenario_SRGSConstraint : Page
{
///
/// This HResult represents the scenario where a user is prompted to allow in-app speech, but
@@ -46,9 +46,9 @@ public sealed partial class SRGSConstraintScenario : Page
private SpeechRecognizer speechRecognizer;
private IAsyncOperation recognitionOperation;
- private CoreDispatcher dispatcher;
private ResourceContext speechContext;
private ResourceMap speechResourceMap;
+ private bool isPopulatingLanguages = false;
private Dictionary colorLookup = new Dictionary
{
@@ -59,7 +59,7 @@ public sealed partial class SRGSConstraintScenario : Page
};
- public SRGSConstraintScenario()
+ public Scenario_SRGSConstraint()
{
InitializeComponent();
}
@@ -72,9 +72,6 @@ public SRGSConstraintScenario()
/// The navigation event details
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
- // Save the UI thread dispatcher to allow speech status messages to be shown on the UI.
- dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
-
bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
if (permissionGained)
{
@@ -112,7 +109,8 @@ private void PopulateLanguageDropdown()
// disable the callback so we don't accidentally trigger initialization of the recognizer
// while initialization is already in progress.
- cbLanguageSelection.SelectionChanged -= cbLanguageSelection_SelectionChanged;
+ isPopulatingLanguages = true;
+
Language defaultLanguage = SpeechRecognizer.SystemSpeechLanguage;
IEnumerable supportedLanguages = SpeechRecognizer.SupportedGrammarLanguages;
foreach (Language lang in supportedLanguages)
@@ -128,8 +126,8 @@ private void PopulateLanguageDropdown()
cbLanguageSelection.SelectedItem = item;
}
}
-
- cbLanguageSelection.SelectionChanged += cbLanguageSelection_SelectionChanged;
+
+ isPopulatingLanguages = false;
}
///
@@ -140,6 +138,11 @@ private void PopulateLanguageDropdown()
/// Ignored
private async void cbLanguageSelection_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
+ if (isPopulatingLanguages)
+ {
+ return;
+ }
+
ComboBoxItem item = (ComboBoxItem)(cbLanguageSelection.SelectedItem);
Language newLanguage = (Language)item.Tag;
@@ -279,7 +282,7 @@ private async Task InitializeRecognizer(Language recognizerLanguage)
/// The recognizer's status
private async void SpeechRecognizer_StateChanged(SpeechRecognizer sender, SpeechRecognizerStateChangedEventArgs args)
{
- await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
MainPage.Current.NotifyUser("Speech recognizer state: " + args.State.ToString(), NotifyType.StatusMessage);
});
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeSSMLScenario.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeSSML.xaml.cs
similarity index 57%
rename from Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeSSMLScenario.xaml.cs
rename to Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeSSML.xaml.cs
index 6773410ff3..913982f4b8 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeSSMLScenario.xaml.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeSSML.xaml.cs
@@ -13,20 +13,23 @@
using System.Linq;
using Windows.ApplicationModel.Resources.Core;
using Windows.Data.Xml.Dom;
+using Windows.Foundation.Collections;
+using Windows.Media.Core;
+using Windows.Media.Playback;
using Windows.Media.SpeechSynthesis;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
- public sealed partial class SynthesizeSSMLScenario : Page
+ public sealed partial class Scenario_SynthesizeSSML : Page
{
private SpeechSynthesizer synthesizer;
private ResourceContext speechContext;
private ResourceMap speechResourceMap;
- public SynthesizeSSMLScenario()
+ public Scenario_SynthesizeSSML()
{
InitializeComponent();
synthesizer = new SpeechSynthesizer();
@@ -36,6 +39,13 @@ public SynthesizeSSMLScenario()
speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationTTSResources");
+ MediaPlayer player = new MediaPlayer();
+ player.AutoPlay = false;
+ player.MediaEnded += media_MediaEnded;
+
+ media.SetMediaPlayer(player);
+ media.MediaPlayer.AutoPlay = false;
+
InitializeListboxVoiceChooser();
UpdateSSMLText();
}
@@ -48,9 +58,9 @@ public SynthesizeSSMLScenario()
private async void Speak_Click(object sender, RoutedEventArgs e)
{
// If the media is playing, the user has pressed the button to stop the playback.
- if (media.CurrentState.Equals(MediaElementState.Playing))
+ if (media.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
{
- media.Stop();
+ media.MediaPlayer.Pause();
btnSpeak.Content = "Speak";
}
else
@@ -66,10 +76,19 @@ private async void Speak_Click(object sender, RoutedEventArgs e)
// Create a stream from the text. This will be played using a media element.
SpeechSynthesisStream synthesisStream = await synthesizer.SynthesizeSsmlToStreamAsync(text);
- // Set the source and start playing the synthesized audio stream.
- media.AutoPlay = true;
- media.SetSource(synthesisStream, synthesisStream.ContentType);
- media.Play();
+ // Create a media source from the stream:
+ var mediaSource = MediaSource.CreateFromStream(synthesisStream, synthesisStream.ContentType);
+
+ //Create a Media Playback Item
+ var mediaPlaybackItem = new MediaPlaybackItem(mediaSource);
+
+ // Ensure that the app is notified for marks.
+ RegisterForMarkEvents(mediaPlaybackItem);
+
+ // Set the source of the MediaElement or MediaPlayerElement to the MediaPlaybackItem
+ // and start playing the synthesized audio stream.
+ media.Source = mediaPlaybackItem;
+ media.MediaPlayer.Play();
}
catch (System.IO.FileNotFoundException)
{
@@ -93,6 +112,87 @@ private async void Speak_Click(object sender, RoutedEventArgs e)
}
}
+ ///
+ /// Register for all mark events
+ ///
+ /// The Media PLayback Item add handlers to.
+ private void RegisterForMarkEvents(MediaPlaybackItem mediaPlaybackItem)
+ {
+ //tracks could all be generated at creation
+ for (int index =0; index < mediaPlaybackItem.TimedMetadataTracks.Count; index++)
+ {
+ RegisterMetadataHandlerForMarks(mediaPlaybackItem, index);
+ }
+
+ // if the tracks are added later we will
+ // monitor the tracks being added and subscribe to the ones of interest
+ mediaPlaybackItem.TimedMetadataTracksChanged += (MediaPlaybackItem sender, IVectorChangedEventArgs args) =>
+ {
+ if (args.CollectionChange == CollectionChange.ItemInserted)
+ {
+ RegisterMetadataHandlerForMarks(sender, (int)args.Index);
+ }
+ else if (args.CollectionChange == CollectionChange.Reset)
+ {
+ for (int index = 0; index < sender.TimedMetadataTracks.Count; index++)
+ {
+ RegisterMetadataHandlerForMarks(sender, index);
+ }
+ }
+ };
+ }
+
+ ///
+ /// Register for just word bookmark events.
+ ///
+ /// The Media Playback Item to register handlers for.
+ /// Index of the timedMetadataTrack within the mediaPlaybackItem.
+ private void RegisterMetadataHandlerForMarks(MediaPlaybackItem mediaPlaybackItem, int index)
+ {
+ //make sure we only register for bookmarks
+ var timedTrack = mediaPlaybackItem.TimedMetadataTracks[index];
+ if(timedTrack.Id == "SpeechBookmark")
+ {
+ timedTrack.CueEntered += metadata_MarkCueEntered;
+ mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);
+
+ }
+ }
+
+ ///
+ /// This function executes when a SpeechCue is hit and calls the functions to update the UI
+ ///
+ /// The timedMetadataTrack associated with the event.
+ /// the arguments associated with the event.
+ private async void metadata_MarkCueEntered(TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args)
+ {
+ // Check in case there are different tracks and the handler was used for more tracks
+ if (timedMetadataTrack.TimedMetadataKind == TimedMetadataKind.Speech)
+ {
+ var cue = args.Cue as SpeechCue;
+ if (cue != null)
+ {
+ System.Diagnostics.Debug.WriteLine("Cue text:[" + cue.Text + "]");
+ // Do something with the cue
+ await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
+ () =>
+ {
+ // Your UI update code goes here!
+ FillTextBox(cue);
+ });
+ }
+ }
+ }
+
+ ///
+ /// Update the UI with text from the mark
+ ///
+ /// The cue containing the text
+ private void FillTextBox(SpeechCue cue)
+ {
+ textBoxLastMarkTriggered.Text = cue.Text;
+ }
+
///
/// This is invoked when the stream is finished playing.
///
@@ -101,9 +201,14 @@ private async void Speak_Click(object sender, RoutedEventArgs e)
///
/// unused object parameter
/// unused event parameter
- void media_MediaEnded(object sender, RoutedEventArgs e)
+ async void media_MediaEnded(MediaPlayer sender, object e)
{
- btnSpeak.Content = "Speak";
+ await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
+ () =>
+ {
+ // Your UI update code goes here!
+ btnSpeak.Content = "Speak";
+ });
}
///
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeTextScenario.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeText.xaml.cs
similarity index 97%
rename from Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeTextScenario.xaml.cs
rename to Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeText.xaml.cs
index 6b066b2a73..172fb82a9b 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeTextScenario.xaml.cs
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeText.xaml.cs
@@ -18,15 +18,15 @@
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
-namespace SpeechAndTTS
+namespace SDKTemplate
{
- public sealed partial class SynthesizeTextScenario : Page
+ public sealed partial class Scenario_SynthesizeText : Page
{
private SpeechSynthesizer synthesizer;
private ResourceContext speechContext;
private ResourceMap speechResourceMap;
- public SynthesizeTextScenario()
+ public Scenario_SynthesizeText()
{
InitializeComponent();
synthesizer = new SpeechSynthesizer();
@@ -47,7 +47,7 @@ public SynthesizeTextScenario()
private async void Speak_Click(object sender, RoutedEventArgs e)
{
// If the media is playing, the user has pressed the button to stop the playback.
- if (media.CurrentState.Equals(MediaElementState.Playing))
+ if (media.CurrentState == MediaElementState.Playing)
{
media.Stop();
btnSpeak.Content = "Speak";
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeTextBoundaries.xaml.cs b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeTextBoundaries.xaml.cs
new file mode 100644
index 0000000000..1bcab17896
--- /dev/null
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/Scenario_SynthesizeTextBoundaries.xaml.cs
@@ -0,0 +1,303 @@
+//*********************************************************
+//
+// 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.Linq;
+using Windows.ApplicationModel.Resources.Core;
+using Windows.Foundation.Collections;
+using Windows.Media.Core;
+using Windows.Media.Playback;
+using Windows.Media.SpeechSynthesis;
+using Windows.UI.Core;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+
+namespace SDKTemplate
+{
+ public sealed partial class Scenario_SynthesizeTextBoundaries : Page
+ {
+ private SpeechSynthesizer synthesizer;
+ private ResourceContext speechContext;
+ private ResourceMap speechResourceMap;
+
+ public Scenario_SynthesizeTextBoundaries()
+ {
+ InitializeComponent();
+ synthesizer = new SpeechSynthesizer();
+
+ speechContext = ResourceContext.GetForCurrentView();
+ speechContext.Languages = new string[] { SpeechSynthesizer.DefaultVoice.Language };
+
+ speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationTTSResources");
+
+ MediaPlayer player = new MediaPlayer();
+ player.AutoPlay = false;
+ player.MediaEnded += media_MediaEnded;
+
+ media.SetMediaPlayer(player);
+
+ InitializeListboxVoiceChooser();
+ }
+
+ ///
+ /// This is invoked when the user clicks on the speak/stop button.
+ ///
+ /// Button that triggered this event
+ /// State information about the routed event
+ private async void Speak_Click(object sender, RoutedEventArgs e)
+ {
+ // If the media is playing, the user has pressed the button to stop the playback.
+ if (media.MediaPlayer.PlaybackSession.PlaybackState == MediaPlaybackState.Playing)
+ {
+ media.MediaPlayer.Pause();
+ btnSpeak.Content = "Speak";
+ }
+ else
+ {
+ string text = textToSynthesize.Text;
+ if (!String.IsNullOrEmpty(text))
+ {
+ // Change the button label. You could also just disable the button if you don't want any user control.
+ btnSpeak.Content = "Stop";
+
+ try
+ {
+ // Enable word marker generation (false by default).
+ synthesizer.Options.IncludeWordBoundaryMetadata = true;
+ synthesizer.Options.IncludeSentenceBoundaryMetadata = true;
+
+ SpeechSynthesisStream synthesisStream = await synthesizer.SynthesizeTextToStreamAsync(text);
+
+ // Create a media source from the stream:
+ var mediaSource = MediaSource.CreateFromStream(synthesisStream, synthesisStream.ContentType);
+
+ //Create a Media Playback Item
+ var mediaPlaybackItem = new MediaPlaybackItem(mediaSource);
+
+ // Ensure that the app is notified for cues.
+ RegisterForWordBoundaryEvents(mediaPlaybackItem);
+
+ // Set the source of the MediaElement or MediaPlayerElement to the MediaPlaybackItem
+ // and start playing the synthesized audio stream.
+ media.Source = mediaPlaybackItem;
+ media.MediaPlayer.Play();
+ }
+ catch (System.IO.FileNotFoundException)
+ {
+ // If media player components are unavailable, (eg, using a N SKU of windows), we won't
+ // be able to start media playback. Handle this gracefully
+ btnSpeak.Content = "Speak";
+ btnSpeak.IsEnabled = false;
+ textToSynthesize.IsEnabled = false;
+ listboxVoiceChooser.IsEnabled = false;
+ var messageDialog = new Windows.UI.Popups.MessageDialog("Media player components unavailable");
+ await messageDialog.ShowAsync();
+ }
+ catch (Exception)
+ {
+ // If the text is unable to be synthesized, throw an error message to the user.
+ btnSpeak.Content = "Speak";
+ media.AutoPlay = false;
+ var messageDialog = new Windows.UI.Popups.MessageDialog("Unable to synthesize text");
+ await messageDialog.ShowAsync();
+ }
+ }
+ }
+ }
+
+ ///
+ /// This is invoked when the stream is finished playing.
+ ///
+ ///
+ /// In this case, we're changing the button label based on the state.
+ ///
+ /// unused object parameter
+ /// unused event parameter
+ async void media_MediaEnded(MediaPlayer sender, object e)
+ {
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
+ () =>
+ {
+ // Your UI update code goes here!
+ btnSpeak.Content = "Speak";
+ });
+ }
+
+ ///
+ /// This creates items out of the system installed voices. The voices are then displayed in a listbox.
+ /// This allows the user to change the voice of the synthesizer in your app based on their preference.
+ ///
+ private void InitializeListboxVoiceChooser()
+ {
+ // Get all of the installed voices.
+ var voices = SpeechSynthesizer.AllVoices;
+
+ // Get the currently selected voice.
+ VoiceInformation currentVoice = synthesizer.Voice;
+
+ foreach (VoiceInformation voice in voices.OrderBy(p => p.Language))
+ {
+ ComboBoxItem item = new ComboBoxItem();
+ item.Name = voice.DisplayName;
+ item.Tag = voice;
+ item.Content = voice.DisplayName + " (Language: " + voice.Language + ")";
+ listboxVoiceChooser.Items.Add(item);
+
+ // Check to see if we're looking at the current voice and set it as selected in the listbox.
+ if (currentVoice.Id == voice.Id)
+ {
+ item.IsSelected = true;
+ listboxVoiceChooser.SelectedItem = item;
+ }
+ }
+ }
+
+ ///
+ /// This is called when the user has selects a voice from the drop down.
+ ///
+ /// unused object parameter
+ /// unused event parameter
+ private void ListboxVoiceChooser_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ ComboBoxItem item = (ComboBoxItem)(listboxVoiceChooser.SelectedItem);
+ VoiceInformation voice = (VoiceInformation)(item.Tag);
+ synthesizer.Voice = voice;
+
+ // update UI text to be an appropriate default translation.
+ speechContext.Languages = new string[] { voice.Language };
+ textToSynthesize.Text = speechResourceMap.GetValue("SynthesizeTextBoundariesDefaultText", speechContext).ValueAsString;
+ }
+
+ ///
+ /// This function executes when a SpeechCue is hit and calls the functions to update the UI
+ ///
+ /// The timedMetadataTrack associated with the event.
+ /// the arguments associated with the event.
+ private async void metadata_SpeechCueEntered(TimedMetadataTrack timedMetadataTrack, MediaCueEventArgs args)
+ {
+ // Check in case there are different tracks and the handler was used for more tracks
+ if (timedMetadataTrack.TimedMetadataKind == TimedMetadataKind.Speech)
+ {
+ var cue = args.Cue as SpeechCue;
+ if (cue != null)
+ {
+ System.Diagnostics.Debug.WriteLine("Hit Cue with start:" + cue.StartPositionInInput + " and end:" + cue.EndPositionInInput);
+ System.Diagnostics.Debug.WriteLine("Cue text:[" + cue.Text + "]");
+ // Do something with the cue
+ await Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
+ () =>
+ {
+ // Your UI update code goes here!
+ HighlightTextOnScreen(cue.StartPositionInInput, cue.EndPositionInInput);
+ FillTextBoxes(cue, timedMetadataTrack);
+ });
+ }
+ }
+ }
+
+ ///
+ /// This function executes when a SpeechCue is hit and calls the functions to update the UI
+ ///
+ /// The timedMetadataTrack associated with the event.
+ /// the SpeechCue object.
+ private void FillTextBoxes(SpeechCue cue, TimedMetadataTrack timedMetadataTrack)
+ {
+ //if it is a sentence cue, populate the sentence text box.
+ if(timedMetadataTrack.Id == "SpeechSentence")
+ {
+ textBoxLastSpeechSentence.Text = cue.Text;
+ }
+ //if it is a word cue, populate the word text box
+ if(timedMetadataTrack.Id == "SpeechWord")
+ {
+ textBoxLastSpeechWord.Text = cue.Text;
+ }
+ }
+
+ ///
+ /// This function selects the text associated with the start and end positions.
+ ///
+ /// the starting index of the word
+ /// the ending index of the word
+ private void HighlightTextOnScreen(int? startPositionInInput, int? endPositionInInput)
+ {
+ if (startPositionInInput != null && endPositionInInput != null)
+ {
+ textToSynthesize.Select(startPositionInInput.Value, endPositionInInput.Value - startPositionInInput.Value + 1);
+ }
+ }
+
+ ///
+ /// Register for all boundary events and register a function to add any new events if they arise.
+ ///
+ /// The Media PLayback Item add handlers to.
+ private void RegisterForWordBoundaryEvents(MediaPlaybackItem mediaPlaybackItem)
+ {
+ // If tracks were available at source resolution time, itterate through and register:
+ for (int index = 0; index < mediaPlaybackItem.TimedMetadataTracks.Count; index++)
+ {
+ RegisterMetadataHandlerForWords(mediaPlaybackItem, index);
+ RegisterMetadataHandlerForSentences(mediaPlaybackItem, index);
+ }
+
+ // Since the tracks are added later we will
+ // monitor the tracks being added and subscribe to the ones of interest
+ mediaPlaybackItem.TimedMetadataTracksChanged += (MediaPlaybackItem sender, IVectorChangedEventArgs args) =>
+ {
+ if (args.CollectionChange == CollectionChange.ItemInserted)
+ {
+ RegisterMetadataHandlerForWords(sender, (int)args.Index);
+ RegisterMetadataHandlerForSentences(mediaPlaybackItem, (int)args.Index);
+ }
+ else if (args.CollectionChange == CollectionChange.Reset)
+ {
+ for (int index = 0; index < sender.TimedMetadataTracks.Count; index++)
+ {
+ RegisterMetadataHandlerForWords(sender, index);
+ RegisterMetadataHandlerForSentences(mediaPlaybackItem, index);
+ }
+ }
+ };
+ }
+
+ ///
+ /// Register for just word boundary events.
+ ///
+ /// The Media Playback Item to register handlers for.
+ /// Index of the timedMetadataTrack within the mediaPlaybackItem.
+ private void RegisterMetadataHandlerForWords(MediaPlaybackItem mediaPlaybackItem, int index)
+ {
+ var timedTrack = mediaPlaybackItem.TimedMetadataTracks[index];
+ //register for only word cues
+ if (timedTrack.Id == "SpeechWord" && checkBoxWordBoundaries.IsChecked.Value)
+ {
+ timedTrack.CueEntered += metadata_SpeechCueEntered;
+ mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);
+ }
+ }
+
+ ///
+ /// Register for just sentence boundary events.
+ ///
+ /// The Media Playback Item to register handlers for.
+ /// Index of the timedMetadataTrack within the mediaPlaybackItem.
+ private void RegisterMetadataHandlerForSentences(MediaPlaybackItem mediaPlaybackItem, int index)
+ {
+ var timedTrack = mediaPlaybackItem.TimedMetadataTracks[index];
+ //register for only sentence cues
+ if (timedTrack.Id == "SpeechSentence" && checkBoxSentenceBoundaries.IsChecked.Value)
+ {
+ timedTrack.CueEntered += metadata_SpeechCueEntered;
+ mediaPlaybackItem.TimedMetadataTracks.SetPresentationMode((uint)index, TimedMetadataTrackPresentationMode.ApplicationPresented);
+ }
+ }
+ }
+}
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/SpeechAndTTS.csproj b/Samples/SpeechRecognitionAndSynthesis/cs/SpeechAndTTS.csproj
index c1370847d8..29c9ffdc9f 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/SpeechAndTTS.csproj
+++ b/Samples/SpeechRecognitionAndSynthesis/cs/SpeechAndTTS.csproj
@@ -14,7 +14,6 @@
10.0.15063.010.0.15063.014
- truetrue512{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
@@ -97,43 +96,46 @@
App.xaml
-
- ContinuousDictationScenario.xaml
+
+ Scenario_ContinuousDictation.xaml
-
- ContinuousRecognitionListGrammarScenario.xaml
+
+ Scenario_ContinuousRecognitionListGrammar.xaml
-
- ContinuousRecognitionSRGSConstraintScenario.xaml
+
+ Scenario_ContinuousRecognitionSRGSGrammar.xaml
MainPage.xaml.cs
MainPage.xaml
-
- PredefinedDictationGrammarScenario.xaml
+
+ Scenario_PredefinedDictationGrammar.xaml
-
- PredefinedWebSearchGrammarScenario.xaml
+
+ Scenario_PredefinedWebSearchGrammar.xaml
-
- ListConstraintScenario.xaml
+
+ Scenario_ListConstraint.xaml
Properties\AssemblyInfo.cs
-
- SRGSConstraintScenario.xaml
+
+ Scenario_SRGSConstraint.xaml
-
- PauseAsyncScenario.xaml
+
+ Scenario_PauseAsync.xaml
-
- SynthesizeSSMLScenario.xaml
+
+ Scenario_SynthesizeSSML.xaml
-
- SynthesizeTextScenario.xaml
+
+ Scenario_SynthesizeTextBoundaries.xaml
+
+
+ Scenario_SynthesizeText.xaml
@@ -147,15 +149,18 @@
MSBuild:CompileDesigner
-
+
+ Scenario_ContinuousDictation.xaml
MSBuild:CompileDesigner
-
+
+ Scenario_ContinuousRecognitionListGrammar.xaml
MSBuild:CompileDesigner
-
+
+ Scenario_ContinuousRecognitionSRGSGrammar.xaml
MSBuild:CompileDesigner
@@ -164,19 +169,23 @@
MSBuild:CompileDesigner
-
+
+ Scenario_PredefinedDictationGrammar.xaml
MSBuild:CompileDesigner
-
+
+ Scenario_PredefinedWebSearchGrammar.xaml
MSBuild:CompileDesigner
-
+
+ Scenario_ListConstraint.xaml
MSBuild:CompileDesigner
-
+
+ Scenario_SRGSConstraint.xaml
MSBuild:CompileDesigner
@@ -185,15 +194,23 @@
MSBuild:CompileDesigner
-
+
+ Scenario_PauseAsync.xaml
+ MSBuild:Compile
+ Designer
+
+
+ Scenario_SynthesizeSSML.xaml
MSBuild:CompileDesigner
-
+
+ Scenario_SynthesizeTextBoundaries.xaml
MSBuild:CompileDesigner
-
+
+ Scenario_SynthesizeText.xaml
MSBuild:CompileDesigner
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/SpeechAndTTS.jsproj b/Samples/SpeechRecognitionAndSynthesis/js/SpeechAndTTS.jsproj
index 8d61ea254b..3150ae8af6 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/SpeechAndTTS.jsproj
+++ b/Samples/SpeechRecognitionAndSynthesis/js/SpeechAndTTS.jsproj
@@ -50,16 +50,17 @@
default.html
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
images\microsoft-sdk.png
@@ -86,16 +87,17 @@
-
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
Microsoft.WinJS.4.0\css\ui-dark.css
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario9_ContinuousRecognitionSRGSGrammar.html b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario10_ContinuousRecognitionSRGSGrammar.html
similarity index 94%
rename from Samples/SpeechRecognitionAndSynthesis/js/html/scenario9_ContinuousRecognitionSRGSGrammar.html
rename to Samples/SpeechRecognitionAndSynthesis/js/html/scenario10_ContinuousRecognitionSRGSGrammar.html
index e66d79824f..1bc0eeda7f 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario9_ContinuousRecognitionSRGSGrammar.html
+++ b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario10_ContinuousRecognitionSRGSGrammar.html
@@ -17,7 +17,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario10_PauseAsync.html b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario11_PauseAsync.html
similarity index 96%
rename from Samples/SpeechRecognitionAndSynthesis/js/html/scenario10_PauseAsync.html
rename to Samples/SpeechRecognitionAndSynthesis/js/html/scenario11_PauseAsync.html
index 8745afbbf4..8b3313397e 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario10_PauseAsync.html
+++ b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario11_PauseAsync.html
@@ -17,7 +17,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario2_SynthesizeTextBoundaries.html b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario2_SynthesizeTextBoundaries.html
new file mode 100644
index 0000000000..172c0a93c6
--- /dev/null
+++ b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario2_SynthesizeTextBoundaries.html
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Description:
+
+
This sample showcases basic speech synthesis using WinRT APIs to convert text to speech.
+
+
+
+
+
+
+
+
+
+ Use Word Boundaries
+ Use Sentence Boundaries
+
+
+
Last word boundary hit
+
+
+
+
Last sentence boundary hit
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario2_SynthesizeSSML.html b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario3_SynthesizeSSML.html
similarity index 80%
rename from Samples/SpeechRecognitionAndSynthesis/js/html/scenario2_SynthesizeSSML.html
rename to Samples/SpeechRecognitionAndSynthesis/js/html/scenario3_SynthesizeSSML.html
index 6c7adfd07d..993b724a5c 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario2_SynthesizeSSML.html
+++ b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario3_SynthesizeSSML.html
@@ -16,7 +16,7 @@
-
+
@@ -35,6 +35,11 @@
Description:
+
+
Last mark triggered:
+
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario3_PredefinedDictationGrammar.html b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario4_PredefinedDictationGrammar.html
similarity index 96%
rename from Samples/SpeechRecognitionAndSynthesis/js/html/scenario3_PredefinedDictationGrammar.html
rename to Samples/SpeechRecognitionAndSynthesis/js/html/scenario4_PredefinedDictationGrammar.html
index 61ef77fac4..636956f9c3 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario3_PredefinedDictationGrammar.html
+++ b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario4_PredefinedDictationGrammar.html
@@ -17,7 +17,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario4_PredefinedWebSearchGrammar.html b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario5_PredefinedWebSearchGrammar.html
similarity index 96%
rename from Samples/SpeechRecognitionAndSynthesis/js/html/scenario4_PredefinedWebSearchGrammar.html
rename to Samples/SpeechRecognitionAndSynthesis/js/html/scenario5_PredefinedWebSearchGrammar.html
index dae2a47571..dc0e0b07a0 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario4_PredefinedWebSearchGrammar.html
+++ b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario5_PredefinedWebSearchGrammar.html
@@ -17,7 +17,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario5_ListConstraint.html b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario6_ListConstraint.html
similarity index 96%
rename from Samples/SpeechRecognitionAndSynthesis/js/html/scenario5_ListConstraint.html
rename to Samples/SpeechRecognitionAndSynthesis/js/html/scenario6_ListConstraint.html
index e9fbf648ea..42483076e6 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario5_ListConstraint.html
+++ b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario6_ListConstraint.html
@@ -17,7 +17,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario6_SRGSConstraint.html b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario7_SRGSConstraint.html
similarity index 96%
rename from Samples/SpeechRecognitionAndSynthesis/js/html/scenario6_SRGSConstraint.html
rename to Samples/SpeechRecognitionAndSynthesis/js/html/scenario7_SRGSConstraint.html
index 6bfcc88e1e..f6e56f4748 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario6_SRGSConstraint.html
+++ b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario7_SRGSConstraint.html
@@ -17,7 +17,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario7_ContinuousDictation.html b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario8_ContinuousDictation.html
similarity index 96%
rename from Samples/SpeechRecognitionAndSynthesis/js/html/scenario7_ContinuousDictation.html
rename to Samples/SpeechRecognitionAndSynthesis/js/html/scenario8_ContinuousDictation.html
index 7eda2d0fd1..5ce63ca14c 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario7_ContinuousDictation.html
+++ b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario8_ContinuousDictation.html
@@ -18,7 +18,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario8_ContinuousRecognitionListGrammar.html b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario9_ContinuousRecognitionListGrammar.html
similarity index 95%
rename from Samples/SpeechRecognitionAndSynthesis/js/html/scenario8_ContinuousRecognitionListGrammar.html
rename to Samples/SpeechRecognitionAndSynthesis/js/html/scenario9_ContinuousRecognitionListGrammar.html
index e93499710e..b9234810fe 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/html/scenario8_ContinuousRecognitionListGrammar.html
+++ b/Samples/SpeechRecognitionAndSynthesis/js/html/scenario9_ContinuousRecognitionListGrammar.html
@@ -17,7 +17,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/sample-configuration.js b/Samples/SpeechRecognitionAndSynthesis/js/js/sample-configuration.js
index 16391fbb20..bb58687a81 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/sample-configuration.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/sample-configuration.js
@@ -16,15 +16,16 @@
var scenarios = [
{ url: "/html/scenario1_SynthesizeText.html", title: "Synthesize Text" },
- { url: "/html/scenario2_SynthesizeSSML.html", title: "Synthesize SSML" },
- { url: "/html/scenario3_PredefinedDictationGrammar.html", title: "Predefined Dictation Grammar" },
- { url: "/html/scenario4_PredefinedWebSearchGrammar.html", title: "Predefined Web Search Grammar" },
- { url: "/html/scenario5_ListConstraint.html", title: "Custom List Constraint" },
- { url: "/html/scenario6_SRGSConstraint.html", title: "Custom SRGS Constraint" },
- { url: "/html/scenario7_ContinuousDictation.html", title: "Continuous Dictation" },
- { url: "/html/scenario8_ContinuousRecognitionListGrammar.html", title: "Continuous List Commands" },
- { url: "/html/scenario9_ContinuousRecognitionSRGSGrammar.html", title: "Continuous SRGS Commands" },
- { url: "/html/scenario10_PauseAsync.html", title: "PauseAsync to Change Grammar" }
+ { url: "/html/scenario2_SynthesizeTextBoundaries.html", title: "Synthesize Text with Boundaries" },
+ { url: "/html/scenario3_SynthesizeSSML.html", title: "Synthesize SSML" },
+ { url: "/html/scenario4_PredefinedDictationGrammar.html", title: "Predefined Dictation Grammar" },
+ { url: "/html/scenario5_PredefinedWebSearchGrammar.html", title: "Predefined Web Search Grammar" },
+ { url: "/html/scenario6_ListConstraint.html", title: "Custom List Constraint" },
+ { url: "/html/scenario7_SRGSConstraint.html", title: "Custom SRGS Constraint" },
+ { url: "/html/scenario8_ContinuousDictation.html", title: "Continuous Dictation" },
+ { url: "/html/scenario9_ContinuousRecognitionListGrammar.html", title: "Continuous List Commands" },
+ { url: "/html/scenario10_ContinuousRecognitionSRGSGrammar.html", title: "Continuous SRGS Commands" },
+ { url: "/html/scenario11_PauseAsync.html", title: "PauseAsync to Change Grammar" }
];
WinJS.Namespace.define("SdkSample", {
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario9_ContinuousRecognitionSRGSGrammar.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario10_ContinuousRecognitionSRGSGrammar.js
similarity index 99%
rename from Samples/SpeechRecognitionAndSynthesis/js/js/scenario9_ContinuousRecognitionSRGSGrammar.js
rename to Samples/SpeechRecognitionAndSynthesis/js/js/scenario10_ContinuousRecognitionSRGSGrammar.js
index ffc136ef82..79b6e63f23 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario9_ContinuousRecognitionSRGSGrammar.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario10_ContinuousRecognitionSRGSGrammar.js
@@ -11,7 +11,7 @@
(function () {
"use strict";
- var page = WinJS.UI.Pages.define("/html/scenario9_ContinuousRecognitionSRGSGrammar.html", {
+ var page = WinJS.UI.Pages.define("/html/scenario10_ContinuousRecognitionSRGSGrammar.html", {
ready: function (element, options) {
AudioCapturePermissions.requestMicrophonePermission().then(function (available) {
if (available) {
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario10_PauseAsync.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario11_PauseAsync.js
similarity index 99%
rename from Samples/SpeechRecognitionAndSynthesis/js/js/scenario10_PauseAsync.js
rename to Samples/SpeechRecognitionAndSynthesis/js/js/scenario11_PauseAsync.js
index bfcb2e3f0d..61d795a71d 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario10_PauseAsync.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario11_PauseAsync.js
@@ -11,7 +11,7 @@
(function () {
"use strict";
- var page = WinJS.UI.Pages.define("/html/scenario10_PauseAsync.html", {
+ var page = WinJS.UI.Pages.define("/html/scenario11_PauseAsync.html", {
ready: function (element, options) {
AudioCapturePermissions.requestMicrophonePermission().then(function (available) {
if (available) {
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario1_SynthesizeText.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario1_SynthesizeText.js
index bfab9eaea8..528ed0b288 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario1_SynthesizeText.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario1_SynthesizeText.js
@@ -52,6 +52,7 @@
var synthesizer;
var audio;
+ var marksMetadataTrackForAudio;
// localization resources
var context;
@@ -95,11 +96,11 @@
// Creates a stream from the text. This will be played using an audio element.
synthesizer.synthesizeTextToStreamAsync(textToSynthesize.value).done(
- function (markersStream) {
+ function (textStream) {
// Set the source and start playing the synthesized audio stream.
- var blob = MSApp.createBlobFromRandomAccessStream(markersStream.ContentType, markersStream);
+ var blob = MSApp.createBlobFromRandomAccessStream(textStream.ContentType, textStream);
audio.src = URL.createObjectURL(blob, { oneTimeOnly: true });
- markersStream.seek(0);
+ textStream.seek(0);
audio.play();
},
function (error) {
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario2_SynthesizeTextBoundaries.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario2_SynthesizeTextBoundaries.js
new file mode 100644
index 0000000000..1837cfa556
--- /dev/null
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario2_SynthesizeTextBoundaries.js
@@ -0,0 +1,326 @@
+//*********************************************************
+//
+// 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.
+//
+//*********************************************************
+
+(function () {
+ "use strict";
+ var page = WinJS.UI.Pages.define("/html/scenario2_SynthesizeTextBoundaries.html", {
+ ready: function (element, options) {
+ try {
+ synthesizer = new Windows.Media.SpeechSynthesis.SpeechSynthesizer();
+ audio = new Audio();
+
+ //
+ // Create a track on the HTML5 audio tag to receive the metadata created
+ // by the speech synthesizer
+ //
+ marksMetadataTrackForAudio = audio.addTextTrack("metadata", "SpeechBoundaries");
+ marksMetadataTrackForAudio.addEventListener("cuechange", cueChange, false);
+
+ btnSpeak.addEventListener("click", speakFn, false);
+ voicesSelect.addEventListener("click", setVoiceFunction, false);
+
+ var rcns = Windows.ApplicationModel.Resources.Core;
+ context = new rcns.ResourceContext();
+ context.languages = new Array(synthesizer.voice.language);
+ resourceMap = rcns.ResourceManager.current.mainResourceMap.getSubtree('LocalizationTTSResources');
+
+ textToSynthesize.innerText = resourceMap.getValue('SynthesizeTextBoundariesDefaultText', context).valueAsString;
+
+ listbox_GetVoices();
+ audio_SetUp();
+
+ causeAudioTrackCrash();
+ } catch (exception) {
+ if (exception.number == -2147467263) {// E_NOTIMPL
+
+ // If media player components aren't installed (for example, when using an N SKU of windows)
+ // this error may occur when instantiating the Audio object.
+ statusMessage.innerText = "Media Player components are not available.";
+ statusBox.style.backgroundColor = "red";
+ btnSpeak.disabled = true;
+ textToSynthesize.disabled = true;
+ }
+ }
+ },
+
+ unload: function (element, options) {
+ if (audio != null) {
+ audio.onpause = null;
+ audio.pause();
+ }
+ }
+ });
+
+ var synthesizer;
+ var audio;
+ var marksMetadataTrackForAudio;
+
+ // localization resources
+ var context;
+ var resourceMap;
+
+ function audio_SetUp() {
+ ///
+ /// Sets up the audio element's events so the app UI updates based on the current state of playback.
+ ///
+ audio.onplay = function () { // Fires when the audio begins playing
+ statusMessage.innerText = "Playing";
+ };
+
+ audio.onpause = function () { // Fires when the user presses the stop button
+ statusMessage.innerText = "Completed";
+ btnSpeak.innerText = "Speak";
+ };
+
+ audio.onended = function () { // Fires when the audio finishes playing
+ statusMessage.innerText = "Completed";
+ btnSpeak.innerText = "Speak";
+ voicesSelect.disabled = false;
+ // Clean old cues
+ while (marksMetadataTrackForAudio.cues.length > 0) {
+ var cue = marksMetadataTrackForAudio.cues[0];
+ marksMetadataTrackForAudio.removeCue(cue);
+ }
+ };
+ }
+
+ function speakFn() {
+ ///
+ /// This is invoked when the user clicks on the speak/stop button. It attempts to convert the
+ /// textbox content into a stream, then plays the stream through the audio element.
+ ///
+ if (btnSpeak.innerText == "Stop") {
+ voicesSelect.disabled = false;
+ audio.pause();
+ // Clean old cues
+ while (marksMetadataTrackForAudio.cues.length > 0) {
+ var cue = marksMetadataTrackForAudio.cues[0];
+ marksMetadataTrackForAudio.removeCue(cue);
+ }
+ return;
+ }
+
+ // Changes the button label. You could also just disable the button if you don't want any user control.
+ voicesSelect.disabled = true;
+ btnSpeak.innerText = "Stop";
+ statusBox.style.backgroundColor = "green";
+
+ if (checkBoxWordBoundaries.checked == true) {
+ // Enable cues track generation for word boundaries
+ synthesizer.options.includeWordBoundaryMetadata = true
+ }
+ else {
+ //make sure it is false if unchecked
+ synthesizer.options.includeWordBoundaryMetadata = false;
+ }
+
+ if (checkBoxSentenceBoundaries.checked == true) {
+ // Enable cues track generation for word boundaries
+ synthesizer.options.includeSentenceBoundaryMetadata = true
+ }
+ else {
+ //make sure it is false if unchecked
+ synthesizer.options.includeSentenceBoundaryMetadata = false;
+ }
+
+ // Creates a stream from the text. This will be played using an audio element.
+ synthesizer.synthesizeTextToStreamAsync(textToSynthesize.value).done(
+ function (markersStream) {
+ // Set the source and start playing the synthesized audio stream.
+ var blob = MSApp.createBlobFromRandomAccessStream(markersStream.ContentType, markersStream);
+ audio.src = URL.createObjectURL(blob, { oneTimeOnly: true });
+ markersStream.seek(0);
+ // There is only may be more than one track. We need to set Audio Metadata from all of them
+ // Word boundaries will be one track and Sentence boundaries will be another if both are active
+ if (markersStream.timedMetadataTracks.length !== 0) {
+ setAudioMetadaTrack(markersStream.timedMetadataTracks);
+ }
+ audio.play();
+ },
+ function (error) {
+ errorMessage(error.message);
+ });
+ }
+
+ function causeAudioTrackCrash() {
+
+ var metadataTrackForAudio = audio.addTextTrack("metadata", "SpeechBoundaries");
+ metadataTrackForAudio.addEventListener("cuechange", cueChange, false);
+
+ var textCue1 = new TextTrackCue(.101, 250, "first Cue");
+ metadataTrackForAudio.addCue(textCue1);
+ var textCue2 = new TextTrackCue(.099, 250, "second Cue");
+ metadataTrackForAudio.addCue(textCue2);
+ }
+
+ //
+ // Event handler for cues being reached by the audio stream being played out.
+ //
+
+ function cueChange() {
+ var cues = marksMetadataTrackForAudio.activeCues;
+
+ if (cues.length > 0) {
+ for (var index = 0; index < cues.length; index++) {
+ var speechCue = JSON.parse(cues[index].text);
+
+ statusMessage.innerText = speechCue.text;
+ // the plus 1 is because it is a 0 based array
+ highlightTextOnScreen(speechCue.startPositionInInput, speechCue.endPositionInInput + 1);
+ fillTextBoxes(speechCue);
+
+ //depending on the speed of your cues, a wait may be helpfult to make sure it displays.
+ wait(200);
+ }
+ }
+ }
+
+ function sleep(ms) {
+ return new Promise(resolve => setTimeout(resolve, ms));
+ }
+
+ async function wait(ms) {
+ await sleep(ms);
+ }
+
+ //populate the correct text boxes with the last boundary hit.
+ function fillTextBoxes(speechCue) {
+ if (speechCue.cueType == "SpeechWord") {
+ lastWordBoundaryText.innerText = speechCue.text;
+ }
+ if (speechCue.cueType == "SpeechSentence") {
+ lastSentenceBoundaryText.innerText = speechCue.text;
+ }
+ }
+
+ //select the text between the positions to highlight them on the screen
+ function highlightTextOnScreen(startPosition, endPosition) {
+ textToSynthesize.setSelectionRange(startPosition, endPosition);
+ }
+
+ function listbox_GetVoices() {
+ ///
+ /// This creates items out of the system installed voices. The voices are then displayed in a listbox.
+ /// This allows the user to change the voice of the synthesizer in your app based on their preference.
+ ///
+
+ // Get the list of all of the voices installed on this machine.
+ var allVoices = Windows.Media.SpeechSynthesis.SpeechSynthesizer.allVoices;
+
+ // Get the currently selected voice.
+ var defaultVoice = Windows.Media.SpeechSynthesis.SpeechSynthesizer.defaultVoice;
+
+ for (var voiceIndex = 0; voiceIndex < allVoices.size; voiceIndex++) {
+ var currVoice = allVoices[voiceIndex];
+ var option = document.createElement("option");
+ option.text = currVoice.displayName + " (" + currVoice.language + ")";
+ voicesSelect.add(option, null);
+
+ // Check to see if we're looking at the current voice and set it as selected in the listbox.
+ if (currVoice.id === defaultVoice.id) {
+ voicesSelect.selectedIndex = voiceIndex;
+ }
+ }
+ }
+
+ function setVoiceFunction() {
+ ///
+ /// This is called when the user selects a voice from the drop down.
+ ///
+ if (voicesSelect.selectedIndex !== -1) {
+ var allVoices = Windows.Media.SpeechSynthesis.SpeechSynthesizer.allVoices;
+
+ // Use the selected index to find the voice.
+ var selectedVoice = allVoices[voicesSelect.selectedIndex];
+
+ synthesizer.voice = selectedVoice;
+
+ // change the language of the sample text.
+ context.languages = new Array(synthesizer.voice.language);
+ textToSynthesize.innerText = resourceMap.getValue('SynthesizeTextDefaultText', context).valueAsString;
+ }
+ }
+
+ function errorMessage(text) {
+ ///
+ /// Sets the specified text area with the error message details.
+ ///
+ errorTextArea.innerText = text;
+ }
+
+ //
+ // This function sets the cues from the media track on the speech synthesizer stream to a
+ // HTML5 audio track with media cues converted in json format.
+ function setAudioMetadaTrack(speechMediaTracks) {
+
+ var index = 0;
+ var jindex = 0;
+ //currently the addTextCue must be called in order so we have to sort the sentence and word boundaries
+ //there is a bug open to fix the addTextCue
+ if (speechMediaTracks.length == 1) { //we just have sentence OR word boundaries
+ for (index = 0; index < speechMediaTracks[0].cues.length; index++) {
+ var speechCue = speechMediaTracks[0].cues[index];
+ addTextCue(speechCue, speechMediaTracks[0].id);
+ }
+ }
+ else { // we have sentence AND word boundaries
+ var speechCue0;
+ var speechCue1;
+ while (index < speechMediaTracks[0].cues.length && jindex < speechMediaTracks[1].cues.length) {
+ if (index < speechMediaTracks[0].cues.length) {
+ speechCue0 = speechMediaTracks[0].cues[index];
+ }
+ else {
+ speechCue0.startTime = Number.MAX_SAFE_INTEGER;
+ }
+ if (jindex < speechMediaTracks[1].cues.length) {
+ speechCue1 = speechMediaTracks[1].cues[jindex];
+ }
+ else {
+ speechCue1.startTime = Number.MAX_SAFE_INTEGER;
+ }
+ if (speechCue1.startTime < speechCue0.startTime) {//speechCue1 comes first
+ addTextCue(speechCue1, speechMediaTracks[1].id);
+ jindex++;
+ }
+ else { //speechCue0 comes first
+ addTextCue(speechCue0, speechMediaTracks[0].id);
+ index++;
+ }
+ }
+ while (index < speechMediaTracks[0].cues.length) {
+ speechCue0 = speechMediaTracks[0].cues[index];
+ addTextCue(speechCue0, speechMediaTracks[0].id);
+ index++;
+ }
+ while (jindex < speechMediaTracks[1].cues.length) {
+ speechCue1 = speechMediaTracks[1].cues[jindex];
+ addTextCue(speechCue1, speechMediaTracks[1].id);
+ jindex++;
+ }
+ }
+ }
+
+ function addTextCue(speechCue, type) {
+ //we need to properly clone the data properties and put them in the TextTrackCue to make them available at the event trigger time
+ var jsonSpeech = {
+ "startPositionInInput": speechCue.startPositionInInput,
+ "endPositionInInput": speechCue.endPositionInInput,
+ "text": speechCue.text,
+ "cueType": type,
+ "duration": speechCue.duration
+ }
+ var textCue = new TextTrackCue(speechCue.startTime / 1000.0, (speechCue.startTime + speechCue.duration + 300) / 1000.0, JSON.stringify(jsonSpeech));
+ marksMetadataTrackForAudio.addCue(textCue);
+
+ //git test
+ }
+})();
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario2_SynthesizeSSML.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario3_SynthesizeSSML.js
similarity index 78%
rename from Samples/SpeechRecognitionAndSynthesis/js/js/scenario2_SynthesizeSSML.js
rename to Samples/SpeechRecognitionAndSynthesis/js/js/scenario3_SynthesizeSSML.js
index 32bc799555..ceb9152ef1 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario2_SynthesizeSSML.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario3_SynthesizeSSML.js
@@ -11,12 +11,20 @@
(function () {
"use strict";
- var page = WinJS.UI.Pages.define("/html/scenario2_SynthesizeSSML.html", {
+ var page = WinJS.UI.Pages.define("/html/scenario3_SynthesizeSSML.html", {
ready: function (element, options) {
try {
synthesizer = new Windows.Media.SpeechSynthesis.SpeechSynthesizer();
+
audio = new Audio();
+ //
+ // Create a track on the HTML5 audio tag to receive the metadata created
+ // by the speech synthesizer
+ //
+ marksMetadataTrackForAudio = audio.addTextTrack("metadata", "SpeechBookmarks");
+ marksMetadataTrackForAudio.addEventListener("cuechange", cueChange, false);
+
btnSpeak.addEventListener("click", speakFn, false);
voicesSelect.addEventListener("click", setVoiceFunction, false);
@@ -30,7 +38,7 @@
listbox_GetVoices();
audio_SetUp();
} catch (exception) {
- if (exception.number == -2147467263) // E_NOTIMPL
+ if (exception.number === -2147467263) // E_NOTIMPL
{
// If media player components aren't installed (for example, when using an N SKU of windows)
// this error may occur when instantiating the Audio object.
@@ -43,7 +51,7 @@
},
unload: function (element, options) {
- if (audio != null) {
+ if (audio !== null) {
audio.onpause = null;
audio.pause();
}
@@ -52,6 +60,7 @@
var synthesizer;
var audio;
+ var marksMetadataTrackForAudio;
// localization resources
var context;
@@ -82,7 +91,7 @@
/// This is invoked when the user clicks on the speak/stop button. It attempts to convert the
/// textbox content into a stream, then plays the stream through the audio element.
///
- if (btnSpeak.innerText == "Stop") {
+ if (btnSpeak.innerText === "Stop") {
voicesSelect.disabled = false;
audio.pause();
return;
@@ -100,6 +109,11 @@
var blob = MSApp.createBlobFromRandomAccessStream(markersStream.ContentType, markersStream);
audio.src = URL.createObjectURL(blob, { oneTimeOnly: true });
markersStream.seek(0);
+
+ // There is only one track present the one for cues so we pick it
+ if (markersStream.timedMetadataTracks.length !== 0) {
+ setAudioMetadaTrack(markersStream.timedMetadataTracks[0]);
+ }
audio.play();
},
function (error) {
@@ -107,6 +121,19 @@
});
}
+ //
+ // Event handler for cues being reached by the audio stream being played out.
+ //
+
+ function cueChange() {
+ var cues = marksMetadataTrackForAudio.activeCues;
+ if (cues.length > 0) {
+ var speechCue = cues[0];
+ statusMessage.innerText = speechCue.text;
+ lastMarkTriggered.innerText =speechCue.text;
+ }
+ }
+
function listbox_GetVoices() {
///
/// This creates items out of the system installed voices. The voices are then displayed in a listbox.
@@ -190,4 +217,23 @@
///
errorTextArea.innerText = text;
}
+
+ //
+ // This function sets the cues from the media track on the speech synthesizer stream to a
+ // HTML5 audio track with media cues converted in json format.
+ function setAudioMetadaTrack(speechMediaTrack) {
+
+ // Clean old cues
+ while (marksMetadataTrackForAudio.cues.length > 0) {
+ var cue = marksMetadataTrackForAudio.cues[0];
+ marksMetadataTrackForAudio.removeCue(cue);
+ }
+
+ for (var index = 0; index < speechMediaTrack.cues.length; index++) {
+ var speechCue = speechMediaTrack.cues[index];
+ var textCue = new TextTrackCue(speechCue.startTime / 1000.0, (speechCue.startTime + speechCue.duration + 100) / 1000.0, speechCue.text);
+ marksMetadataTrackForAudio.addCue(textCue);
+ }
+
+ }
})();
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario3_PredefinedDictationGrammar.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario4_PredefinedDictationGrammar.js
similarity index 99%
rename from Samples/SpeechRecognitionAndSynthesis/js/js/scenario3_PredefinedDictationGrammar.js
rename to Samples/SpeechRecognitionAndSynthesis/js/js/scenario4_PredefinedDictationGrammar.js
index 26dddbf989..c2e3fe8ac3 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario3_PredefinedDictationGrammar.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario4_PredefinedDictationGrammar.js
@@ -11,7 +11,7 @@
(function () {
"use strict";
- var page = WinJS.UI.Pages.define("/html/scenario3_PredefinedDictationGrammar.html", {
+ var page = WinJS.UI.Pages.define("/html/scenario4_PredefinedDictationGrammar.html", {
ready: function (element, options) {
AudioCapturePermissions.requestMicrophonePermission().then(function (available) {
if (available) {
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario4_PredefinedWebSearchGrammar.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario5_PredefinedWebSearchGrammar.js
similarity index 99%
rename from Samples/SpeechRecognitionAndSynthesis/js/js/scenario4_PredefinedWebSearchGrammar.js
rename to Samples/SpeechRecognitionAndSynthesis/js/js/scenario5_PredefinedWebSearchGrammar.js
index 4a675b6c93..21d24407d9 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario4_PredefinedWebSearchGrammar.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario5_PredefinedWebSearchGrammar.js
@@ -11,7 +11,7 @@
(function () {
"use strict";
- var page = WinJS.UI.Pages.define("/html/scenario4_PredefinedWebSearchGrammar.html", {
+ var page = WinJS.UI.Pages.define("/html/scenario5_PredefinedWebSearchGrammar.html", {
ready: function (element, options) {
AudioCapturePermissions.requestMicrophonePermission().then(function (available) {
if (available) {
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario5_ListConstraint.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario6_ListConstraint.js
similarity index 99%
rename from Samples/SpeechRecognitionAndSynthesis/js/js/scenario5_ListConstraint.js
rename to Samples/SpeechRecognitionAndSynthesis/js/js/scenario6_ListConstraint.js
index c3e8ede990..9c9847efd4 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario5_ListConstraint.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario6_ListConstraint.js
@@ -11,7 +11,7 @@
(function () {
"use strict";
- var page = WinJS.UI.Pages.define("/html/scenario5_ListConstraint.html", {
+ var page = WinJS.UI.Pages.define("/html/scenario6_ListConstraint.html", {
ready: function (element, options) {
AudioCapturePermissions.requestMicrophonePermission().then(function (available) {
if (available) {
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario6_SRGSConstraint.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario7_SRGSConstraint.js
similarity index 99%
rename from Samples/SpeechRecognitionAndSynthesis/js/js/scenario6_SRGSConstraint.js
rename to Samples/SpeechRecognitionAndSynthesis/js/js/scenario7_SRGSConstraint.js
index 61448ebc25..2b32706a3d 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario6_SRGSConstraint.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario7_SRGSConstraint.js
@@ -11,7 +11,7 @@
(function () {
"use strict";
- var page = WinJS.UI.Pages.define("/html/scenario6_SRGSConstraint.html", {
+ var page = WinJS.UI.Pages.define("/html/scenario7_SRGSConstraint.html", {
ready: function (element, options) {
AudioCapturePermissions.requestMicrophonePermission().then(function (available) {
if (available) {
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario7_ContinuousDictation.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario8_ContinuousDictation.js
similarity index 99%
rename from Samples/SpeechRecognitionAndSynthesis/js/js/scenario7_ContinuousDictation.js
rename to Samples/SpeechRecognitionAndSynthesis/js/js/scenario8_ContinuousDictation.js
index ca76a97092..d8ddc30370 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario7_ContinuousDictation.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario8_ContinuousDictation.js
@@ -11,7 +11,7 @@
(function () {
"use strict";
- var page = WinJS.UI.Pages.define("/html/scenario7_ContinuousDictation.html", {
+ var page = WinJS.UI.Pages.define("/html/scenario8_ContinuousDictation.html", {
ready: function (element, options) {
AudioCapturePermissions.requestMicrophonePermission().then(function (available) {
if (available) {
diff --git a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario8_ContinuousRecognitionListGrammar.js b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario9_ContinuousRecognitionListGrammar.js
similarity index 99%
rename from Samples/SpeechRecognitionAndSynthesis/js/js/scenario8_ContinuousRecognitionListGrammar.js
rename to Samples/SpeechRecognitionAndSynthesis/js/js/scenario9_ContinuousRecognitionListGrammar.js
index 22413fac9e..014a097ec7 100644
--- a/Samples/SpeechRecognitionAndSynthesis/js/js/scenario8_ContinuousRecognitionListGrammar.js
+++ b/Samples/SpeechRecognitionAndSynthesis/js/js/scenario9_ContinuousRecognitionListGrammar.js
@@ -11,7 +11,7 @@
(function () {
"use strict";
- var page = WinJS.UI.Pages.define("/html/scenario8_ContinuousRecognitionListGrammar.html", {
+ var page = WinJS.UI.Pages.define("/html/scenario9_ContinuousRecognitionListGrammar.html", {
ready: function (element, options) {
AudioCapturePermissions.requestMicrophonePermission().then(function (available) {
if (available) {
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/de-DE/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/de-DE/LocalizationTTSResources.resjson
index ba830b31ff..4791d63843 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/de-DE/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/de-DE/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027de-DE\u0027\u003e\r\n\r\nDies ist ein Beispiel für eine phonetische Aussprache:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nDies ist ein Beispiel eines Datums:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nDies ist ein Beispiel für eine Zahl zu sagen:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "Der schnelle rot-Fuchs sprang über den faulen Hund der braun"
+ "SynthesizeSSMLDefaultText": "\n\nDies ist ein Beispiel für eine phonetische Aussprache:\n whatchamacallit .\n\nDies ist ein Beispiel eines Datums:\n 04/30/2013 .\n\nDies ist ein Beispiel für eine Zahl zu sagen:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "Der schnelle rote Fuchs sprang über den faulen braunen Hund.",
+ "SynthesizeTextBoundariesDefaultText": "Sie haben die Möglichkeit, allein per Spracheingabe Programme zu starten, Menüs zu öffnen, auf Schaltflächen oder andere Bildschirmobjekte zu klicken, Text in Dokumente zu diktieren sowie E-Mails zu schreiben und zu versenden. Nahezu alle Aktionen, die mittels Tastatur und Maus ausgeführt werden, lassen sich auch per Spracheingabe ausführen."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/de-DE/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/de-DE/LocalizationTTSResources.resw
index 3ef8721d6a..db532cf2bf 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/de-DE/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/de-DE/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='de-DE'>
-Dies ist ein Beispiel für eine phonetische Aussprache:
+<mark name='phonetic'/>Dies ist ein Beispiel für eine phonetische Aussprache:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-Dies ist ein Beispiel eines Datums:
+<mark name='date'/>Dies ist ein Beispiel eines Datums:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-Dies ist ein Beispiel für eine Zahl zu sagen:
+<mark name='number'/>Dies ist ein Beispiel für eine Zahl zu sagen:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
- Der schnelle rot-Fuchs sprang über den faulen Hund der braun
+ Der schnelle rote Fuchs sprang über den faulen braunen Hund.
+
+
+ Sie haben die Möglichkeit, allein per Spracheingabe Programme zu starten, Menüs zu öffnen, auf Schaltflächen oder andere Bildschirmobjekte zu klicken, Text in Dokumente zu diktieren sowie E-Mails zu schreiben und zu versenden. Nahezu alle Aktionen, die mittels Tastatur und Maus ausgeführt werden, lassen sich auch per Spracheingabe ausführen.
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-AU/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-AU/LocalizationTTSResources.resjson
index b490c5e73a..b0ebf99298 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-AU/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-AU/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027en-GB\u0027\u003e\r\n\r\nThis is an example of a phonetic pronunciation:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nThis is an example of a date:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nThis is an example of an ordinal number:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "The Quick Red Fox Jumped Over The Lazy Brown Dog"
+ "SynthesizeSSMLDefaultText": "\n\nThis is an example of a phonetic pronunciation:\n whatchamacallit .\n\nThis is an example of a date:\n 04/30/2013 .\n\nThis is an example of an ordinal number:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "The quick red fox jumped over the lazy brown dog",
+ "SynthesizeTextBoundariesDefaultText": "Using only your voice, you can start programs, open menus, click buttons and other objects on the screen, dictate text into documents, and write and send emails. Just about everything you do with your keyboard and mouse can be done with only your voice."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-AU/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-AU/LocalizationTTSResources.resw
index 766d648459..669e428448 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-AU/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-AU/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='en-GB'>
-This is an example of a phonetic pronunciation:
+<mark name='phonetic'/>This is an example of a phonetic pronunciation:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-This is an example of a date:
+<mark name='date'/>This is an example of a date:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-This is an example of an ordinal number:
+<mark name='number'/>This is an example of an ordinal number:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
- The Quick Red Fox Jumped Over The Lazy Brown Dog
+ The quick red fox jumped over the lazy brown dog
+
+
+ Using only your voice, you can start programs, open menus, click buttons and other objects on the screen, dictate text into documents, and write and send emails. Just about everything you do with your keyboard and mouse can be done with only your voice.
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-CA/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-CA/LocalizationTTSResources.resjson
index b490c5e73a..b0ebf99298 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-CA/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-CA/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027en-GB\u0027\u003e\r\n\r\nThis is an example of a phonetic pronunciation:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nThis is an example of a date:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nThis is an example of an ordinal number:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "The Quick Red Fox Jumped Over The Lazy Brown Dog"
+ "SynthesizeSSMLDefaultText": "\n\nThis is an example of a phonetic pronunciation:\n whatchamacallit .\n\nThis is an example of a date:\n 04/30/2013 .\n\nThis is an example of an ordinal number:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "The quick red fox jumped over the lazy brown dog",
+ "SynthesizeTextBoundariesDefaultText": "Using only your voice, you can start programs, open menus, click buttons and other objects on the screen, dictate text into documents, and write and send emails. Just about everything you do with your keyboard and mouse can be done with only your voice."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-CA/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-CA/LocalizationTTSResources.resw
index 766d648459..669e428448 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-CA/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-CA/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='en-GB'>
-This is an example of a phonetic pronunciation:
+<mark name='phonetic'/>This is an example of a phonetic pronunciation:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-This is an example of a date:
+<mark name='date'/>This is an example of a date:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-This is an example of an ordinal number:
+<mark name='number'/>This is an example of an ordinal number:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
- The Quick Red Fox Jumped Over The Lazy Brown Dog
+ The quick red fox jumped over the lazy brown dog
+
+
+ Using only your voice, you can start programs, open menus, click buttons and other objects on the screen, dictate text into documents, and write and send emails. Just about everything you do with your keyboard and mouse can be done with only your voice.
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-GB/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-GB/LocalizationTTSResources.resjson
index b490c5e73a..b0ebf99298 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-GB/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-GB/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027en-GB\u0027\u003e\r\n\r\nThis is an example of a phonetic pronunciation:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nThis is an example of a date:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nThis is an example of an ordinal number:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "The Quick Red Fox Jumped Over The Lazy Brown Dog"
+ "SynthesizeSSMLDefaultText": "\n\nThis is an example of a phonetic pronunciation:\n whatchamacallit .\n\nThis is an example of a date:\n 04/30/2013 .\n\nThis is an example of an ordinal number:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "The quick red fox jumped over the lazy brown dog",
+ "SynthesizeTextBoundariesDefaultText": "Using only your voice, you can start programs, open menus, click buttons and other objects on the screen, dictate text into documents, and write and send emails. Just about everything you do with your keyboard and mouse can be done with only your voice."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-GB/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-GB/LocalizationTTSResources.resw
index 766d648459..669e428448 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-GB/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-GB/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='en-GB'>
-This is an example of a phonetic pronunciation:
+<mark name='phonetic'/>This is an example of a phonetic pronunciation:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-This is an example of a date:
+<mark name='date'/>This is an example of a date:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-This is an example of an ordinal number:
+<mark name='number'/>This is an example of an ordinal number:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
- The Quick Red Fox Jumped Over The Lazy Brown Dog
+ The quick red fox jumped over the lazy brown dog
+
+
+ Using only your voice, you can start programs, open menus, click buttons and other objects on the screen, dictate text into documents, and write and send emails. Just about everything you do with your keyboard and mouse can be done with only your voice.
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-IN/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-IN/LocalizationTTSResources.resjson
index a259064a29..d6c4311d78 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-IN/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-IN/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027en-IN\u0027\u003e\r\n\r\nThis is an example of a phonetic pronunciation:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nThis is an example of a date:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nThis is an example of an ordinal number:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "The quick red fox jumped over the lazy brown dog"
+ "SynthesizeSSMLDefaultText": "\nThis is an example of a phonetic pronunciation:\n whatchamacallit .\n\nThis is an example of a date:\n 04/30/2013 .\n\nThis is an example of an ordinal number:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "The quick red fox jumped over the lazy brown dog",
+ "SynthesizeTextBoundariesDefaultText": "Using only your voice, you can start programs, open menus, click buttons and other objects on the screen, dictate text into documents, and write and send emails. Just about everything you do with your keyboard and mouse can be done with only your voice."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-IN/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-IN/LocalizationTTSResources.resw
index b432611b31..844d02156b 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-IN/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-IN/LocalizationTTSResources.resw
@@ -122,19 +122,21 @@
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='en-IN'>
-
-This is an example of a phonetic pronunciation:
+<mark name='phonetic'/>This is an example of a phonetic pronunciation:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-This is an example of a date:
+<mark name='date'/>This is an example of a date:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-This is an example of an ordinal number:
+<mark name='number'/>This is an example of an ordinal number:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
The quick red fox jumped over the lazy brown dog
+
+ Using only your voice, you can start programs, open menus, click buttons and other objects on the screen, dictate text into documents, and write and send emails. Just about everything you do with your keyboard and mouse can be done with only your voice.
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-US/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-US/LocalizationTTSResources.resjson
index 2133f35e6c..f9efa8b1e2 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-US/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-US/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027en-US\u0027\u003e\r\n\r\nThis is an example of a phonetic pronunciation:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nThis is an example of a date:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nThis is an example of an ordinal number:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "The quick red fox jumped over the lazy brown dog"
+ "SynthesizeSSMLDefaultText": "\n\nThis is an example of a phonetic pronunciation:\n whatchamacallit .\n\nThis is an example of a date:\n 04/30/2013 .\n\nThis is an example of an ordinal number:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "The quick red fox jumped over the lazy brown dog",
+ "SynthesizeTextBoundariesDefaultText": "Using only your voice, you can start programs, open menus, click buttons and other objects on the screen, dictate text into documents, and write and send e-mails. Just about everything you do with your keyboard and mouse can be done with only your voice."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-US/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-US/LocalizationTTSResources.resw
index 190254b246..0c0fbc4718 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-US/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/en-US/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='en-US'>
-This is an example of a phonetic pronunciation:
+<mark name='phonetic'/>This is an example of a phonetic pronunciation:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-This is an example of a date:
+<mark name='date'/>This is an example of a date:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-This is an example of an ordinal number:
+<mark name='number'/>This is an example of an ordinal number:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
The quick red fox jumped over the lazy brown dog
+
+ Using only your voice, you can start programs, open menus, click buttons and other objects on the screen, dictate text into documents, and write and send e-mails. Just about everything you do with your keyboard and mouse can be done with only your voice.
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-ES/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-ES/LocalizationTTSResources.resjson
index 3b76f71c77..5edd47d34e 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-ES/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-ES/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027es-ES\u0027\u003e\r\n\r\nEste es un ejemplo de una pronunciación fonética:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nEste es un ejemplo de una cita:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nEste es un ejemplo de decir un número:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "El rápido zorro rojo saltado sobre el perro perezoso marrón"
+ "SynthesizeSSMLDefaultText": "\n\nEste es un ejemplo de una pronunciación fonética:\n whatchamacallit .\n\nEste es un ejemplo de una cita:\n 04/30/2013 .\n\nEste es un ejemplo de decir un número:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "El rápido zorro rojo saltado sobre el perro perezoso marrón",
+ "SynthesizeTextBoundariesDefaultText": "Solo con su voz podrá iniciar programas, abrir menús, hacer clic en botones y otros objetos de la pantalla, dictar texto para insertar en documentos, y escribir y enviar mensajes de correo electrónico. Casi todo lo que hace con el teclado y el mouse lo puede hacer ahora con la voz."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-ES/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-ES/LocalizationTTSResources.resw
index 9b41fa4b79..b2ae558a88 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-ES/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-ES/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='es-ES'>
-Este es un ejemplo de una pronunciación fonética:
+<mark name='phonetic'/>Este es un ejemplo de una pronunciación fonética:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-Este es un ejemplo de una cita:
+<mark name='date'/>Este es un ejemplo de una cita:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-Este es un ejemplo de decir un número:
+<mark name='number'/>Este es un ejemplo de decir un número:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
El rápido zorro rojo saltado sobre el perro perezoso marrón
+
+ Solo con su voz podrá iniciar programas, abrir menús, hacer clic en botones y otros objetos de la pantalla, dictar texto para insertar en documentos, y escribir y enviar mensajes de correo electrónico. Casi todo lo que hace con el teclado y el mouse lo puede hacer ahora con la voz.
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-MX/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-MX/LocalizationTTSResources.resjson
index a261432dab..c9ef719af5 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-MX/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-MX/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027es-MX\u0027\u003e\r\n\r\nEste es un ejemplo de una pronunciación fonética:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nEste es un ejemplo de una cita:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nEste es un ejemplo de decir un número:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "El rápido zorro rojo saltado sobre el perro perezoso marrón"
+ "SynthesizeSSMLDefaultText": "\n\nEste es un ejemplo de una pronunciación fonética:\n whatchamacallit .\n\nEste es un ejemplo de una cita:\n 04/30/2013 .\n\nEste es un ejemplo de decir un número:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "El rápido zorro rojo saltado sobre el perro perezoso marrón",
+ "SynthesizeTextBoundariesDefaultText": "Solo con su voz podrá iniciar programas, abrir menús, hacer clic en botones y otros objetos de la pantalla, dictar texto para insertar en documentos, y escribir y enviar mensajes de correo electrónico. Casi todo lo que hace con el teclado y el mouse lo puede hacer ahora con la voz."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-MX/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-MX/LocalizationTTSResources.resw
index ee8f0d37b0..ada77454df 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-MX/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/es-MX/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='es-MX'>
-Este es un ejemplo de una pronunciación fonética:
+<mark name='phonetic'/>Este es un ejemplo de una pronunciación fonética:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-Este es un ejemplo de una cita:
+<mark name='date'/>Este es un ejemplo de una cita:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-Este es un ejemplo de decir un número:
+<mark name='number'/>Este es un ejemplo de decir un número:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
El rápido zorro rojo saltado sobre el perro perezoso marrón
+
+ Solo con su voz podrá iniciar programas, abrir menús, hacer clic en botones y otros objetos de la pantalla, dictar texto para insertar en documentos, y escribir y enviar mensajes de correo electrónico. Casi todo lo que hace con el teclado y el mouse lo puede hacer ahora con la voz.
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/fr-FR/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/fr-FR/LocalizationTTSResources.resjson
index 461750c872..752f55d970 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/fr-FR/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/fr-FR/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027fr-FR\u0027\u003e\r\n\r\nIl s\u0027agit d\u0027un exemple d\u0027une prononciation phonétique :\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nIl s\u0027agit d\u0027un exemple d\u0027une date :\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nIl s\u0027agit d\u0027un exemple de dire un certain nombre :\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "Le rapide renard roux a sauté sur le chien paresseux brun"
+ "SynthesizeSSMLDefaultText": "\n\nIl s'agit d'un exemple d'une prononciation phonétique :\n whatchamacallit .\n\nIl s'agit d'un exemple d'une date :\n 04/30/2013 .\n\nIl s'agit d'un exemple de dire un certain nombre :\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "Le rapide renard roux a sauté sur le chien paresseux brun",
+ "SynthesizeTextBoundariesDefaultText": "Simplement à l’aide de votre voix, vous pouvez démarrer des programmes, ouvrir des menus, cliquer sur des boutons et autres objets à l’écran, dicter du texte dans des documents, et écrire et envoyer des courriers électroniques. Tout ce que vous faites habituellement avec votre clavier et votre souris, vous pouvez le faire avec votre voix."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/fr-FR/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/fr-FR/LocalizationTTSResources.resw
index 28c2fea084..c2d81add10 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/fr-FR/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/fr-FR/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='fr-FR'>
-Il s'agit d'un exemple d'une prononciation phonétique :
+<mark name='phonetic'/>Il s'agit d'un exemple d'une prononciation phonétique :
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-Il s'agit d'un exemple d'une date :
+<mark name='date'/>Il s'agit d'un exemple d'une date :
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-Il s'agit d'un exemple de dire un certain nombre :
+<mark name='number'/>Il s'agit d'un exemple de dire un certain nombre :
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
Le rapide renard roux a sauté sur le chien paresseux brun
+
+ Simplement à l’aide de votre voix, vous pouvez démarrer des programmes, ouvrir des menus, cliquer sur des boutons et autres objets à l’écran, dicter du texte dans des documents, et écrire et envoyer des courriers électroniques. Tout ce que vous faites habituellement avec votre clavier et votre souris, vous pouvez le faire avec votre voix.
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/it-IT/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/it-IT/LocalizationTTSResources.resjson
index e0cbdca731..d8d24e6478 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/it-IT/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/it-IT/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027it-IT\u0027\u003e\r\n\r\nQuesto è un esempio di una pronuncia fonetica:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nQuesto è un esempio di una data:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nQuesto è un esempio di dire un numero:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "Volpe veloce saltato sopra il cane pigro marrone"
+ "SynthesizeSSMLDefaultText": "\n\nQuesto è un esempio di una pronuncia fonetica:\n whatchamacallit .\n\nQuesto è un esempio di una data:\n 04/30/2013 .\n\nQuesto è un esempio di dire un numero:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "Volpe veloce saltato sopra il cane pigro marrone",
+ "SynthesizeTextBoundariesDefaultText": "Usando solo la voce puoi avviare programmi, aprire menu, fare clic su pulsanti e altri oggetti sullo schermo, dettare testo nei documenti e scrivere e inviare messaggi e-mail. Quasi tutte le operazioni svolte con la tastiera e il mouse possono essere eseguite con la voce."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/it-IT/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/it-IT/LocalizationTTSResources.resw
index b1e2d0bf48..5b588ca7a3 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/it-IT/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/it-IT/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='it-IT'>
-Questo è un esempio di una pronuncia fonetica:
+<mark name='phonetic'/>Questo è un esempio di una pronuncia fonetica:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-Questo è un esempio di una data:
+<mark name='date'/>Questo è un esempio di una data:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-Questo è un esempio di dire un numero:
+<mark name='number'/>Questo è un esempio di dire un numero:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
Volpe veloce saltato sopra il cane pigro marrone
+
+ Usando solo la voce puoi avviare programmi, aprire menu, fare clic su pulsanti e altri oggetti sullo schermo, dettare testo nei documenti e scrivere e inviare messaggi e-mail. Quasi tutte le operazioni svolte con la tastiera e il mouse possono essere eseguite con la voce.
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ja-JP/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ja-JP/LocalizationTTSResources.resjson
index 666469fc01..139ebf615c 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ja-JP/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ja-JP/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027en-US\u0027\u003e\r\n\r\nThis is an example of a phonetic pronunciation:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nThis is an example of a date:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nThis is an example of an ordinal number:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "怠惰な茶色犬を飛び越えたクイック レッド フォックス"
+ "SynthesizeSSMLDefaultText": "\n\nThis is an example of a phonetic pronunciation:\n whatchamacallit .\n\nThis is an example of a date:\n 04/30/2013 .\n\nThis is an example of an ordinal number:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "怠惰な茶色犬を飛び越えたクイック レッド フォックス",
+ "SynthesizeTextBoundariesDefaultText": "プログラムの起動、メニューのオープン、ボタンなど画面上にあるオブジェクトのクリック、テキストをディクテーションしてドキュメントに保存、電子メールの作成と送信などの操作を、音声だけで行うことができます。キーボードとマウスの操作が、ほぼすべて音声のみで実行できます。"
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ja-JP/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ja-JP/LocalizationTTSResources.resw
index c6fd810e9e..d0f6189e5e 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ja-JP/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ja-JP/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='en-US'>
-This is an example of a phonetic pronunciation:
+<mark name='phonetic'/>This is an example of a phonetic pronunciation:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-This is an example of a date:
+<mark name='date'/>This is an example of a date:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-This is an example of an ordinal number:
+<mark name='number'/>This is an example of an ordinal number:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
怠惰な茶色犬を飛び越えたクイック レッド フォックス
+
+ プログラムの起動、メニューのオープン、ボタンなど画面上にあるオブジェクトのクリック、テキストをディクテーションしてドキュメントに保存、電子メールの作成と送信などの操作を、音声だけで行うことができます。キーボードとマウスの操作が、ほぼすべて音声のみで実行できます。
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ko-KR/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ko-KR/LocalizationTTSResources.resjson
index 1179af65ca..ccbbe43f8c 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ko-KR/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ko-KR/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027ko-KR\u0027\u003e\r\n\r\n이것은 음성 발음의 예:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\n이것은 날짜의 예:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\n이것은 말하는 숫자의 예입니다.\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "갈색 게으른 개에 뛰어 빠른 레드 폭스"
+ "SynthesizeSSMLDefaultText": "\n\n이것은 음성 발음의 예:\n whatchamacallit .\n\n이것은 날짜의 예:\n 04/30/2013 .\n\n이것은 말하는 숫자의 예입니다.\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "갈색 게으른 개에 뛰어 빠른 레드 폭스",
+ "SynthesizeTextBoundariesDefaultText": "음성만 사용 하면 프로그램, 메뉴 열기, 화면에서 단추 및 기타 개체를 클릭 하 고 문서에 텍스트를 받아쓰게 한 다음 전자 메일을 쓰고 보낼 수 있습니다. 단지 당신이 당신의 키보드와 마우스와 더불어 하는 모든 것에 대해 당신의 목소리로 할 수 있다."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ko-KR/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ko-KR/LocalizationTTSResources.resw
index b9d71ab26b..c0bd54cefb 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ko-KR/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ko-KR/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='ko-KR'>
-이것은 음성 발음의 예:
+<mark name='phonetic'/>이것은 음성 발음의 예:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-이것은 날짜의 예:
+<mark name='date'/>이것은 날짜의 예:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-이것은 말하는 숫자의 예입니다.
+<mark name='number'/>이것은 말하는 숫자의 예입니다.
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
갈색 게으른 개에 뛰어 빠른 레드 폭스
+
+ 음성만 사용 하면 프로그램, 메뉴 열기, 화면에서 단추 및 기타 개체를 클릭 하 고 문서에 텍스트를 받아쓰게 한 다음 전자 메일을 쓰고 보낼 수 있습니다. 단지 당신이 당신의 키보드와 마우스와 더불어 하는 모든 것에 대해 당신의 목소리로 할 수 있다.
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pl-PL/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pl-PL/LocalizationTTSResources.resjson
index e0000c54ba..f6c49d7844 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pl-PL/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pl-PL/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027pl-PL\u0027\u003e\r\n\r\nTo jest przykład fonetycznej wymowy:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nTo jest przykład daty:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nTo jest przykład mówi wiele:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "Szybki, czerwony lis przeskoczył nad leniwym psem brązowy"
+ "SynthesizeSSMLDefaultText": "\n\nTo jest przykład fonetycznej wymowy:\n whatchamacallit .\n\nTo jest przykład daty:\n 04/30/2013 .\n\nTo jest przykład mówi wiele:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "Szybki, czerwony lis przeskoczył nad leniwym psem brązowy",
+ "SynthesizeTextBoundariesDefaultText": "Używając tylko głosu, można uruchamiać programy, otwórz menu, kliknij przyciski i innych obiektów na ekranie, dyktowanie tekstu w dokumentach i pisać i wysyłać e-maile. Prawie wszystko, co możesz zrobić z klawiatury i myszy może odbywać się tylko swoim głosem."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pl-PL/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pl-PL/LocalizationTTSResources.resw
index f8691cf1e5..952cf043b5 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pl-PL/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pl-PL/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='pl-PL'>
-To jest przykład fonetycznej wymowy:
+<mark name='phonetic'/>To jest przykład fonetycznej wymowy:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-To jest przykład daty:
+<mark name='date'/>To jest przykład daty:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-To jest przykład mówi wiele:
+<mark name='number'/>To jest przykład mówi wiele:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
Szybki, czerwony lis przeskoczył nad leniwym psem brązowy
+
+ Używając tylko głosu, można uruchamiać programy, otwórz menu, kliknij przyciski i innych obiektów na ekranie, dyktowanie tekstu w dokumentach i pisać i wysyłać e-maile. Prawie wszystko, co możesz zrobić z klawiatury i myszy może odbywać się tylko swoim głosem.
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pt-BR/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pt-BR/LocalizationTTSResources.resjson
index 1d935fba2e..58055d93d9 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pt-BR/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pt-BR/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027pt-BR\u0027\u003e\r\n\r\nEste é um exemplo de uma pronúncia fonética:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nEste é um exemplo de uma data:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nEste é um exemplo de um número de dizer:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "A rápida raposa vermelha, saltada sobre o cachorro preguiçoso marrom"
+ "SynthesizeSSMLDefaultText": "\n\nEste é um exemplo de uma pronúncia fonética:\n whatchamacallit .\n\nEste é um exemplo de uma data:\n 04/30/2013 .\n\nEste é um exemplo de um número de dizer:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "A rápida raposa vermelha, saltada sobre o cachorro preguiçoso marrom",
+ "SynthesizeTextBoundariesDefaultText": "Usando apenas a voz, você pode iniciar programas, abrir menus, clicar em botões e em outros objetos na tela, ditar texto em documentos e escrever e enviar emails. Tudo o que você faz com o teclado e o mouse pode ser feito apenas com a voz."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pt-BR/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pt-BR/LocalizationTTSResources.resw
index 21d342fdd7..b739059212 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pt-BR/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/pt-BR/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='pt-BR'>
-Este é um exemplo de uma pronúncia fonética:
+<mark name='phonetic'/>Este é um exemplo de uma pronúncia fonética:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-Este é um exemplo de uma data:
+<mark name='date'/>Este é um exemplo de uma data:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-Este é um exemplo de um número de dizer:
+<mark name='number'/>Este é um exemplo de um número de dizer:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
A rápida raposa vermelha, saltada sobre o cachorro preguiçoso marrom
+
+ Usando apenas a voz, você pode iniciar programas, abrir menus, clicar em botões e em outros objetos na tela, ditar texto em documentos e escrever e enviar emails. Tudo o que você faz com o teclado e o mouse pode ser feito apenas com a voz.
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ru-RU/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ru-RU/LocalizationTTSResources.resjson
index de8355cf2f..ce622594b6 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ru-RU/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ru-RU/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027ru-RU\u0027\u003e\r\n\r\nЭто пример фонетического произношения:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\nЭто пример даты:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\nЭто пример сказать ряд:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "Быстрый red fox, перепрыгнул через ленивую собаку коричневый"
+ "SynthesizeSSMLDefaultText": "\n\nЭто пример фонетического произношения:\n whatchamacallit .\n\nЭто пример даты:\n 04/30/2013 .\n\nЭто пример сказать ряд:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "Быстрый red fox, перепрыгнул через ленивую собаку коричневый",
+ "SynthesizeTextBoundariesDefaultText": "Используя только ваш голос, можно запускать программы, открывать меню, нажмите кнопки и другие объекты на экране, диктовать текст документов и писать и отправлять электронную почту. Почти все, что вы делаете с вашей клавиатуры и мыши может быть сделано с только ваш голос."
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ru-RU/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ru-RU/LocalizationTTSResources.resw
index 123db1f512..3755122852 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ru-RU/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/ru-RU/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='ru-RU'>
-Это пример фонетического произношения:
+<mark name='phonetic'/>Это пример фонетического произношения:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-Это пример даты:
+<mark name='date'/>Это пример даты:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-Это пример сказать ряд:
+<mark name='number'/>Это пример сказать ряд:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
Быстрый red fox, перепрыгнул через ленивую собаку коричневый
+
+ Используя только ваш голос, можно запускать программы, открывать меню, нажмите кнопки и другие объекты на экране, диктовать текст документов и писать и отправлять электронную почту. Почти все, что вы делаете с вашей клавиатуры и мыши может быть сделано с только ваш голос.
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-CN/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-CN/LocalizationTTSResources.resjson
index d5559fed11..6a13dbb592 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-CN/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-CN/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027zh-CN\u0027\u003e\r\n\r\n这是发音的一个语音的示例:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\n这是一个日期的示例:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\n这是说了一些示例:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "快速的红狐狸跳过懒惰的棕色狗"
+ "SynthesizeSSMLDefaultText": "\n\n这是发音的一个语音的示例:\n whatchamacallit .\n\n这是一个日期的示例:\n 04/30/2013 .\n\n这是说了一些示例:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "快速的红狐狸跳过懒惰的棕色狗",
+ "SynthesizeTextBoundariesDefaultText": "仅使用语音,便可以启动程序、打开菜单、单击屏幕上的按钮和其他对象、将文本口述到文档中以及书写和发送电子邮件。只要是可以用键盘和鼠标完成的所有事情,都可以仅用语音来完成。"
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-CN/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-CN/LocalizationTTSResources.resw
index 3988daf2ec..e870f10f6b 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-CN/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-CN/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='zh-CN'>
-这是发音的一个语音的示例:
+<mark name='phonetic'/>这是发音的一个语音的示例:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-这是一个日期的示例:
+<mark name='date'/>这是一个日期的示例:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-这是说了一些示例:
+<mark name='number'/>这是说了一些示例:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
快速的红狐狸跳过懒惰的棕色狗
+
+ 仅使用语音,便可以启动程序、打开菜单、单击屏幕上的按钮和其他对象、将文本口述到文档中以及书写和发送电子邮件。只要是可以用键盘和鼠标完成的所有事情,都可以仅用语音来完成。
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-TW/LocalizationTTSResources.resjson b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-TW/LocalizationTTSResources.resjson
index 2ceeeffca3..3d8cafd139 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-TW/LocalizationTTSResources.resjson
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-TW/LocalizationTTSResources.resjson
@@ -1,4 +1,5 @@
{
- "SynthesizeSSMLDefaultText": "\u003cspeak version=\u00271.0\u0027 xmlns=\u0027http://www.w3.org/2001/10/synthesis\u0027 \r\n xmlns:xsi=\u0027http://www.w3.org/2001/XMLSchema-instance\u0027 \r\n xsi:schemaLocation=\u0027http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd\u0027 \r\n xml:lang=\u0027zh-TW\u0027\u003e\r\n\r\n這是發音的一個語音的示例:\r\n\u003cphoneme alphabet=\u0027x-microsoft-ups\u0027 ph=\u0027S1 W AA T . CH AX . M AX . S2 K AA L . IH T\u0027\u003e whatchamacallit \u003c/phoneme\u003e.\r\n\r\n這是一個日期的示例:\r\n\u003csay-as interpret-as=\u0027date\u0027 format=\u0027mdy\u0027\u003e 04/30/2013 \u003c/say-as\u003e.\r\n\r\n這是說了一些示例:\r\n\u003csay-as interpret-as=\u0027ordinal\u0027\u003e 4 \u003c/say-as\u003e.\r\n\r\n\u003c/speak\u003e",
- "SynthesizeTextDefaultText": "快速的紅狐狸跳過懶惰的棕色狗"
+ "SynthesizeSSMLDefaultText": "\n\n這是發音的一個語音的示例:\n whatchamacallit .\n\n這是一個日期的示例:\n 04/30/2013 .\n\n這是說了一些示例:\n 4 .\n\n",
+ "SynthesizeTextDefaultText": "快速的紅狐狸跳過懶惰的棕色狗",
+ "SynthesizeTextBoundariesDefaultText": "只要使用您的聲音,就可以啟動程式、開啟功能表、按一下按鈕和螢幕上的其他物件、將文字聽寫為文件,以及撰寫和傳送電子郵件。而可以使用鍵盤和滑鼠完成的所有事項,都可以使用您的聲音完成。"
}
diff --git a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-TW/LocalizationTTSResources.resw b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-TW/LocalizationTTSResources.resw
index e5e707c942..af39608096 100644
--- a/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-TW/LocalizationTTSResources.resw
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/Strings/zh-TW/LocalizationTTSResources.resw
@@ -123,18 +123,21 @@
xsi:schemaLocation='http://www.w3.org/2001/10/synthesis http://www.w3.org/TR/speech-synthesis/synthesis.xsd'
xml:lang='zh-TW'>
-這是發音的一個語音的示例:
+<mark name='phonetic'/>這是發音的一個語音的示例:
<phoneme alphabet='x-microsoft-ups' ph='S1 W AA T . CH AX . M AX . S2 K AA L . IH T'> whatchamacallit </phoneme>.
-這是一個日期的示例:
+<mark name='date'/>這是一個日期的示例:
<say-as interpret-as='date' format='mdy'> 04/30/2013 </say-as>.
-這是說了一些示例:
+<mark name='number'/>這是說了一些示例:
<say-as interpret-as='ordinal'> 4 </say-as>.
-
+<mark name='end'/>
</speak>
快速的紅狐狸跳過懶惰的棕色狗
+
+ 只要使用您的聲音,就可以啟動程式、開啟功能表、按一下按鈕和螢幕上的其他物件、將文字聽寫為文件,以及撰寫和傳送電子郵件。而可以使用鍵盤和滑鼠完成的所有事項,都可以使用您的聲音完成。
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ContinuousDictation.xaml
similarity index 81%
rename from Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ContinuousDictation.xaml
index 8a8a46db05..169caeac65 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousDictation.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ContinuousDictation.xaml
@@ -10,18 +10,16 @@
//
//*********************************************************
-->
-
-
+
@@ -38,7 +36,7 @@
-
+
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ContinuousRecognitionListGrammar.xaml
similarity index 81%
rename from Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ContinuousRecognitionListGrammar.xaml
index 808327179a..cec9ea0629 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionListGrammar.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ContinuousRecognitionListGrammar.xaml
@@ -10,18 +10,16 @@
//
//*********************************************************
-->
-
-
+
@@ -30,7 +28,7 @@
- This sample showcases continuous recognition using a list grammar for asynchronous voice commands.
+ This sample showcases continuous recognition using a list grammar for asynchronous voice commands.
@@ -38,7 +36,7 @@
-
+
-
+
\ No newline at end of file
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ContinuousRecognitionSRGSGrammar.xaml
similarity index 85%
rename from Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ContinuousRecognitionSRGSGrammar.xaml
index d33ef43eec..430c4cd198 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ContinuousRecognitionSRGSGrammar.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ContinuousRecognitionSRGSGrammar.xaml
@@ -10,18 +10,16 @@
//
//*********************************************************
-->
-
-
+
@@ -38,7 +36,7 @@
-
+
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ListConstraint.xaml
similarity index 87%
rename from Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ListConstraint.xaml
index b2d3aef712..bfc2bcd554 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_ListConstraint.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_ListConstraint.xaml
@@ -10,18 +10,16 @@
//
//*********************************************************
-->
-
-
+
@@ -38,7 +36,7 @@
-
+
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_PauseAsync.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_PauseAsync.xaml
similarity index 92%
rename from Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_PauseAsync.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_PauseAsync.xaml
index 9b124a2d3d..386d0483dc 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_PauseAsync.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_PauseAsync.xaml
@@ -10,12 +10,10 @@
//
//*********************************************************
-->
-
@@ -60,10 +58,6 @@
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedDictationGrammar.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_PredefinedDictationGrammar.xaml
similarity index 90%
rename from Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedDictationGrammar.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_PredefinedDictationGrammar.xaml
index 5459c911c7..b8c5cad657 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedDictationGrammar.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_PredefinedDictationGrammar.xaml
@@ -10,18 +10,16 @@
//
//*********************************************************
-->
-
-
+
@@ -60,11 +58,6 @@
The speech recognition privacy settings have not been accepted. Open Privacy Settings to review the privacy policy and enable personalization.
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedWebSearchGrammar.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_PredefinedWebSearchGrammar.xaml
similarity index 90%
rename from Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedWebSearchGrammar.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_PredefinedWebSearchGrammar.xaml
index 2d3fd9a424..c46ccfca9d 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_PredefinedWebSearchGrammar.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_PredefinedWebSearchGrammar.xaml
@@ -10,18 +10,16 @@
//
//*********************************************************
-->
-
-
+
@@ -60,11 +58,6 @@
The speech recognition privacy settings have not been accepted. Open Privacy Settings to review the privacy policy and enable personalization.
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SRGSConstraint.xaml
similarity index 81%
rename from Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SRGSConstraint.xaml
index 6db42a2d9e..bd06b451bf 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SRGSConstraint.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SRGSConstraint.xaml
@@ -10,18 +10,16 @@
//
//*********************************************************
-->
-
-
+
@@ -38,7 +36,7 @@
-
+
-
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeTextScenario.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SynthesizeSSML.xaml
similarity index 77%
rename from Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeTextScenario.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SynthesizeSSML.xaml
index b098146228..d5165f1a51 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeTextScenario.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SynthesizeSSML.xaml
@@ -11,10 +11,9 @@
//*********************************************************
-->
@@ -29,7 +28,7 @@
- This sample showcases basic speech synthesis using WinRT APIs to convert text to speech.
+ This sample showcases speech synthesis using WinRT APIs to convert SSML to speech.
@@ -43,21 +42,18 @@
SelectionChanged="ListboxVoiceChooser_SelectionChanged"
HorizontalAlignment="Left"/>
-
+
+ HorizontalAlignment="Left" Height="394"/>
+
+
-
-
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeText.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SynthesizeText.xaml
similarity index 77%
rename from Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeText.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SynthesizeText.xaml
index cae6815967..c0465f3b72 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cpp/Scenario_SynthesizeText.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SynthesizeText.xaml
@@ -10,23 +10,21 @@
//
//*********************************************************
-->
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -50,16 +48,10 @@
MaxWidth="515"
TextWrapping="Wrap"
AcceptsReturn="True"
- Text="The quick red fox jumped over the lazy brown dog"
FontSize="16"
HorizontalAlignment="Left"/>
-
-
-
-
+
-
diff --git a/Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeSSMLScenario.xaml b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SynthesizeTextBoundaries.xaml
similarity index 59%
rename from Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeSSMLScenario.xaml
rename to Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SynthesizeTextBoundaries.xaml
index 6fd10f9099..1d077b2da5 100644
--- a/Samples/SpeechRecognitionAndSynthesis/cs/SynthesizeSSMLScenario.xaml
+++ b/Samples/SpeechRecognitionAndSynthesis/shared/xaml/Scenario_SynthesizeTextBoundaries.xaml
@@ -1,4 +1,4 @@
-
@@ -29,7 +28,7 @@
- This sample showcases speech synthesis using WinRT APIs to convert SSML to speech.
+ This sample showcases bookmarks used to interact with the UI during speech.
@@ -43,29 +42,22 @@
SelectionChanged="ListboxVoiceChooser_SelectionChanged"
HorizontalAlignment="Left"/>
-
+
+ HorizontalAlignment="Left"
+ SelectionHighlightColorWhenNotFocused="Blue"
+ Height="111"/>
+
+
+
+
-
-
-
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/App.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/App.xaml
index a419c08594..03757f5971 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/App.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/App.xaml
@@ -14,143 +14,73 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:AppUIBasics"
+ xmlns:data="using:AppUIBasics.Data"
xmlns:common="using:AppUIBasics.Common"
- xmlns:localData="using:AppUIBasics.Data"
- RequestedTheme="Dark">
-
+ xmlns:localData="using:AppUIBasics.Data">
-
-
+
+
+
+
+
- XAML controls and layout
-
-
+ All controls
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
+
+ 0
-
-
-
-
-
+
+
+ 0
+
+
+
+
+ 0
-
-
-
-
-
+
+
+ 2
-
-
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/App.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/App.xaml.cs
index a3e3e15676..1eedd981d9 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/App.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/App.xaml.cs
@@ -8,11 +8,13 @@
//
//*********************************************************
using AppUIBasics.Common;
+using AppUIBasics.Data;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
+using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
@@ -46,7 +48,28 @@ public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
+ this.Resuming += App_Resuming;
this.RequiresPointerMode = ApplicationRequiresPointerMode.WhenRequested;
+ string selectedTheme = ApplicationData.Current.LocalSettings.Values["SelectedAppTheme"]?.ToString();
+ if (selectedTheme != null)
+ {
+ Enum.TryParse(selectedTheme, out ApplicationTheme appTheme);
+ RequestedTheme = appTheme;
+ }
+ }
+
+ private void App_Resuming(object sender, object e)
+ {
+ switch (NavigationRootPage.RootFrame?.Content)
+ {
+ case ItemPage page:
+ page.SetInitialVisuals();
+ break;
+ case NewControlsPage page:
+ case MainPage mainPage:
+ NavigationRootPage.Current.NavigationView.AlwaysShowHeader = false;
+ break;
+ }
}
///
@@ -63,8 +86,7 @@ protected override async void OnLaunched(LaunchActivatedEventArgs e)
//}
#endif
await ShowWindow(e);
- this.ShowDisclaimer();
-
+ Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SetDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.UseCoreWindow);
}
private async Task ShowWindow(LaunchActivatedEventArgs e)
@@ -90,7 +112,7 @@ private async Task ShowWindow(LaunchActivatedEventArgs e)
// Set the default language
rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
-
+
rootFrame.NavigationFailed += OnNavigationFailed;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
@@ -121,6 +143,66 @@ private async Task ShowWindow(LaunchActivatedEventArgs e)
Window.Current.Activate();
}
+ protected async override void OnActivated(IActivatedEventArgs args)
+ {
+ if (args.Kind == ActivationKind.Protocol)
+ {
+ Match match;
+ Type targetPageType = typeof(MainPage);
+ string targetId = string.Empty;
+ Frame rootFrame = GetRootFrame();
+
+ switch (((ProtocolActivatedEventArgs)args).Uri?.AbsolutePath)
+ {
+ case string s when IsMatching(s, "/category/(.*)"):
+ targetId = match.Groups[1]?.ToString();
+ var groups = NavigationRootPage.Current.Groups ?? (await ControlInfoDataSource.GetGroupsAsync()).ToList();
+ if (groups.Any(g => g.UniqueId == targetId))
+ {
+ targetPageType = typeof(SectionPage);
+ }
+ break;
+
+ case string s when IsMatching(s, "/item/(.*)"):
+ targetId = match.Groups[1]?.ToString();
+ groups = NavigationRootPage.Current.Groups ?? (await ControlInfoDataSource.GetGroupsAsync()).ToList();
+ if (groups.Any(g => g.Items.Any(i => i.UniqueId == targetId)))
+ {
+ targetPageType = typeof(ItemPage);
+ }
+ break;
+ }
+ rootFrame.Navigate(targetPageType, targetId);
+
+ bool IsMatching(string parent, string expression)
+ {
+ match = Regex.Match(parent, expression);
+ return match.Success;
+ }
+ }
+ base.OnActivated(args);
+ }
+
+ private Frame GetRootFrame()
+ {
+ Frame rootFrame;
+ NavigationRootPage rootPage = Window.Current.Content as NavigationRootPage;
+ if (rootPage == null)
+ {
+ rootPage = new NavigationRootPage();
+ rootFrame = (Frame)rootPage.FindName("rootFrame");
+ rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];
+ rootFrame.NavigationFailed += OnNavigationFailed;
+ Window.Current.Content = rootPage;
+ Window.Current.Activate();
+ }
+ else
+ {
+ rootFrame = (Frame)rootPage.FindName("rootFrame");
+ }
+ return rootFrame;
+ }
+
///
/// Invoked when Navigation to a certain page fails
///
@@ -145,46 +227,5 @@ private async void OnSuspending(object sender, SuspendingEventArgs e)
await SuspensionManager.SaveAsync();
deferral.Complete();
}
-
- private async void ShowDisclaimer()
- {
- ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView();
- var roamingSettings = ApplicationData.Current.RoamingSettings;
-
- // Show disclaimer regardless of how the app has been activated
- // unless disclaimer already accepted.
- var disclaimer = (bool)(roamingSettings.Values["disclaimer"] ?? false);
-
- // If no disclaimer response, show disclaimer.
- if (!disclaimer)
- {
- // Get disclaimer resources.
- // See Globalizing your app at http://go.microsoft.com/fwlink/?LinkId=258266.
- var resDisclaimer = resourceLoader.GetString("disclaimer").Replace(@"\n", Environment.NewLine);
- if (String.IsNullOrEmpty(resDisclaimer)) resDisclaimer = "Disclaimer.";
- var resDisclaimerTitle = resourceLoader.GetString("disclaimerTitle");
- if (String.IsNullOrEmpty(resDisclaimerTitle)) resDisclaimerTitle = "Disclaimer";
- var resDisclaimerButton = resourceLoader.GetString("disclaimerButton");
- if (String.IsNullOrEmpty(resDisclaimerButton)) resDisclaimerButton = "Accept";
-
- // Create a disclaimer message dialog and set its content.
- // A message dialog can support up to three commands.
- // If no commands are specified, a close command is provided by default.
- // Note: Message dialogs should be used sparingly, and only for messages or
- // questions critical to the continued use of your app.
- // See Adding message dialogs at http://go.microsoft.com/fwlink/?LinkID=275116.
- var msg = new Windows.UI.Popups.MessageDialog(resDisclaimer, resDisclaimerTitle);
-
- // Handler for disclaimer.
- msg.Commands.Add(new Windows.UI.Popups.UICommand(resDisclaimerButton,
- _ => roamingSettings.Values["disclaimer"] = true));
-
- // If specifying your own commmands, set the command that will be invoked by default.
- // For example, msg.defaultCommandIndex = 1;
-
- // Show the message dialog
- await msg.ShowAsync();
- }
- }
}
}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/AppUIBasics.csproj b/Samples/XamlUIBasics/cs/AppUIBasics/AppUIBasics.csproj
index 82bdc37d9e..072e6e3fd4 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/AppUIBasics.csproj
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/AppUIBasics.csproj
@@ -3,15 +3,15 @@
Debug
- {DF7583F6-6030-55C4-A410-8D945FCF1411}
+ {D40690AC-37E8-5492-9D42-85042FB025E4}AppContainerExePropertiesAppUIBasicsAppUIBasicsen-USUAP
- 10.0.15063.0
- 10.0.15063.0
+ 10.0.16190.0
+ 10.0.16190.014true512
@@ -87,17 +87,122 @@
true
+
+ Properties\Default.rd.xml
+
+
+ Assets\cliff.jpg
+
+
+ Assets\fishes.wmv
+
+
+ Assets\grapes.jpg
+
+
+ Assets\ladybug.wmv
+
+
+ Assets\rainier.jpg
+
+
+ Assets\sunset.jpg
+
+
+ Assets\treetops.jpg
+
+
+ Assets\valley.jpg
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ App.xaml
+
+
+
+
+
@@ -105,12 +210,16 @@
+ ControlExample.xaml
+
+ AcrylicPage.xaml
+ AppBarButtonPage.xaml
@@ -132,6 +241,9 @@
ButtonPage.xaml
+
+ CalendarDatePickerPage.xaml
+ CalendarViewPage.xaml
@@ -141,6 +253,9 @@
CheckBoxPage.xaml
+
+ ColorPickerPage.xaml
+ ComboBoxPage.xaml
@@ -186,15 +301,27 @@
ListViewPage.xaml
+
+ MediaPlayerElementPage.xaml
+ MediaElementPage.xamlMenuFlyoutPage.xaml
+
+ NavigationViewPage.xaml
+
+
+ ParallaxViewPage.xaml
+ PasswordBoxPage.xaml
+
+ PersonPicturePage.xaml
+ PivotPage.xaml
@@ -207,12 +334,18 @@
RadioButtonPage.xaml
+
+ RatingsControlPage.xaml
+ RelativePanelPage.xamlRepeatButtonPage.xaml
+
+ RevealPage.xaml
+ RichEditBoxPage.xaml
@@ -234,6 +367,12 @@
StackPanelPage.xaml
+
+ PullToRefreshPage.xaml
+
+
+ SwipePage.xaml
+ TextBlockPage.xaml
@@ -252,12 +391,16 @@
ToolTipPage.xaml
+
+ TreeViewPage.xaml
+ VariableSizedWrapGridPage.xamlViewBoxPage.xaml
+ ItemPage.xaml
@@ -268,52 +411,50 @@
NavigationRootPage.xaml
+
+ NewControlsPage.xaml
+ PageHeader.xaml
+
+ SamplePage1.xaml
+
+
+ SamplePage2.xaml
+
+
+ SamplePage3.xaml
+
+
+ SampleSettingsPage.xaml
+ SearchResultsPage.xamlSectionPage.xaml
+
+ SettingsPage.xaml
+ Designer
-
- Properties\Default.rd.xml
-
-
- Assets\fishes.wmv
-
-
- Assets\ladybug.wmv
-
-
- Assets\SplashScreen.png
-
-
- Assets\smalltile-sdk.png
-
-
- Assets\treetops.jpg
-
-
- Assets\storelogo-sdk.png
-
+
@@ -322,30 +463,18 @@
-
-
-
-
- Assets\cliff.jpg
-
-
- Assets\grapes.jpg
-
-
- Assets\HeroImage.png
-
@@ -355,11 +484,7 @@
-
-
- Assets\rainier.jpg
-
@@ -369,24 +494,18 @@
-
- Assets\sunset.jpg
-
-
- Assets\valley.jpg
-
-
-
-
-
+
+
+
+
@@ -398,6 +517,10 @@
DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -426,6 +549,10 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -438,6 +565,10 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -498,6 +629,10 @@
MSBuild:CompileDesigner
+
+ MSBuild:Compile
+ Designer
+ DesignerMSBuild:Compile
@@ -506,10 +641,22 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
@@ -526,6 +673,10 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
@@ -534,6 +685,10 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -562,6 +717,14 @@
MSBuild:CompileDesigner
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+ MSBuild:CompileDesigner
@@ -586,6 +749,10 @@
MSBuild:CompileDesigner
+
+ MSBuild:Compile
+ Designer
+ MSBuild:CompileDesigner
@@ -606,10 +773,30 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+ DesignerMSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+ MSBuild:CompileDesigner
@@ -618,7 +805,12 @@
MSBuild:CompileDesigner
+
+ Designer
+ MSBuild:Compile
+
+ 14.0
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/AppUIBasics.sln b/Samples/XamlUIBasics/cs/AppUIBasics/AppUIBasics.sln
index 748396d7d2..87414bb09e 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/AppUIBasics.sln
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/AppUIBasics.sln
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22609.0
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppUIBasics", "AppUIBasics.csproj", "{DF7583F6-6030-55C4-A410-8D945FCF1411}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AppUIBasics", "AppUIBasics.csproj", "{D40690AC-37E8-5492-9D42-85042FB025E4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,24 +15,24 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Debug|ARM.ActiveCfg = Debug|ARM
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Debug|ARM.Build.0 = Debug|ARM
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Debug|ARM.Deploy.0 = Debug|ARM
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Debug|x64.ActiveCfg = Debug|x64
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Debug|x64.Build.0 = Debug|x64
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Debug|x64.Deploy.0 = Debug|x64
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Debug|x86.ActiveCfg = Debug|x86
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Debug|x86.Build.0 = Debug|x86
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Debug|x86.Deploy.0 = Debug|x86
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Release|ARM.ActiveCfg = Release|ARM
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Release|ARM.Build.0 = Release|ARM
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Release|ARM.Deploy.0 = Release|ARM
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Release|x64.ActiveCfg = Release|x64
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Release|x64.Build.0 = Release|x64
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Release|x64.Deploy.0 = Release|x64
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Release|x86.ActiveCfg = Release|x86
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Release|x86.Build.0 = Release|x86
- {DF7583F6-6030-55C4-A410-8D945FCF1411}.Release|x86.Deploy.0 = Release|x86
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Debug|ARM.ActiveCfg = Debug|ARM
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Debug|ARM.Build.0 = Debug|ARM
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Debug|ARM.Deploy.0 = Debug|ARM
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Debug|x64.ActiveCfg = Debug|x64
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Debug|x64.Build.0 = Debug|x64
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Debug|x64.Deploy.0 = Debug|x64
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Debug|x86.ActiveCfg = Debug|x86
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Debug|x86.Build.0 = Debug|x86
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Debug|x86.Deploy.0 = Debug|x86
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Release|ARM.ActiveCfg = Release|ARM
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Release|ARM.Build.0 = Release|ARM
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Release|ARM.Deploy.0 = Release|ARM
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Release|x64.ActiveCfg = Release|x64
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Release|x64.Build.0 = Release|x64
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Release|x64.Deploy.0 = Release|x64
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Release|x86.ActiveCfg = Release|x86
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Release|x86.Build.0 = Release|x86
+ {D40690AC-37E8-5492-9D42-85042FB025E4}.Release|x86.Deploy.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AcrylicBrush.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AcrylicBrush.png
new file mode 100644
index 0000000000..2d4f5d51d1
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AcrylicBrush.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBar.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBar.png
index 69a375269b..29a7929fe4 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBar.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBar.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarButton.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarButton.png
index e64c471c7a..b9331335a7 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarButton.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarButton.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarSeparator.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarSeparator.png
index 3671a1d173..7c8e2747c7 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarSeparator.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarSeparator.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarToggleButton.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarToggleButton.png
index 974b6d5655..885a5dbc49 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarToggleButton.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AppBarToggleButton.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AutoSuggestBox.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AutoSuggestBox.png
index 932988e70b..e21651a3a1 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AutoSuggestBox.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/AutoSuggestBox.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Border.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Border.png
index a27b12b60c..ee76fc9386 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Border.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Border.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Button.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Button.png
index 6e504647eb..a9234ef42a 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Button.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Button.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CalendarView.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CalendarView.png
index 4b97e307db..d88004f544 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CalendarView.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CalendarView.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CalenderDatePicker.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CalenderDatePicker.png
new file mode 100644
index 0000000000..282b7567ea
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CalenderDatePicker.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Canvas.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Canvas.png
index e657cab38b..78c5543a89 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Canvas.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Canvas.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CheckBox.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CheckBox.png
index 393ccb9d79..b132b4f8c6 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CheckBox.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CheckBox.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ColorPicker.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ColorPicker.png
new file mode 100644
index 0000000000..3d35f3f1c2
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ColorPicker.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ComboBox.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ComboBox.png
index 18a534a966..68a5677f43 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ComboBox.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ComboBox.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CommandBar.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CommandBar.png
index 7c8ee045e4..06712b79e8 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CommandBar.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/CommandBar.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/DatePicker.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/DatePicker.png
index f39880155f..412bed9b2f 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/DatePicker.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/DatePicker.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/DefaultIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/DefaultIcon.png
new file mode 100644
index 0000000000..e5f71dda45
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/DefaultIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/FlipView.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/FlipView.png
index 91ea618cae..84467d883a 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/FlipView.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/FlipView.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Flyout.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Flyout.png
index d3dc83c8c1..8d27f989c1 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Flyout.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Flyout.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Grid.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Grid.png
index 6b9c9b8d04..e177912d3f 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Grid.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Grid.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/GridView.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/GridView.png
index 8f94d6d270..25e8c0ac52 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/GridView.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/GridView.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Hub.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Hub.png
index 7f8661b49f..96e3eeea53 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Hub.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Hub.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/HyperlinkButton.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/HyperlinkButton.png
index 6a92253513..9fb9e46390 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/HyperlinkButton.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/HyperlinkButton.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Image.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Image.png
index 98728fad08..8b6a79c932 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Image.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Image.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/InkCanvas.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/InkCanvas.png
index 265eb73034..54ad22497b 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/InkCanvas.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/InkCanvas.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/InnerPage_Banner.jpg b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/InnerPage_Banner.jpg
new file mode 100644
index 0000000000..8568b6d27e
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/InnerPage_Banner.jpg differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ListBox.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ListBox.png
index c6bb713297..17773faa4b 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ListBox.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ListBox.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ListView.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ListView.png
index 92253d3a8c..023fea38a1 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ListView.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ListView.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MainPage_Banner.jpg b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MainPage_Banner.jpg
new file mode 100644
index 0000000000..2a6ca28eb8
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MainPage_Banner.jpg differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MapControl.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MapControl.png
new file mode 100644
index 0000000000..73d17909e0
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MapControl.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MediaElement.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MediaElement.png
index 721f6a972a..a5a03e7f38 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MediaElement.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MediaElement.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MenuFlyout.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MenuFlyout.png
index aef19bfc76..bb40a9ed3b 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MenuFlyout.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/MenuFlyout.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationView.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationView.png
new file mode 100644
index 0000000000..fa9a242f24
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationView.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/AllControlsIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/AllControlsIcon.png
new file mode 100644
index 0000000000..1731610f2c
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/AllControlsIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/ButtonsIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/ButtonsIcon.png
new file mode 100644
index 0000000000..eba5358802
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/ButtonsIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/CollectionIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/CollectionIcon.png
new file mode 100644
index 0000000000..d5b913e0d5
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/CollectionIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/CommandingIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/CommandingIcon.png
new file mode 100644
index 0000000000..2976570a76
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/CommandingIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/FlyoutIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/FlyoutIcon.png
new file mode 100644
index 0000000000..c8ffb2f228
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/FlyoutIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/LayoutIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/LayoutIcon.png
new file mode 100644
index 0000000000..09e0528502
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/LayoutIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/MediaIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/MediaIcon.png
new file mode 100644
index 0000000000..dce4f00091
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/MediaIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/NewControlsIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/NewControlsIcon.png
new file mode 100644
index 0000000000..b1cca68571
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/NewControlsIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/PickerIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/PickerIcon.png
new file mode 100644
index 0000000000..ca14b7a85a
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/PickerIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/ProgressIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/ProgressIcon.png
new file mode 100644
index 0000000000..4a7294f3eb
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/ProgressIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/TextIcon.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/TextIcon.png
new file mode 100644
index 0000000000..f1c3bfeba4
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/NavigationViewItemIcons/TextIcon.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ParallaxView.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ParallaxView.png
new file mode 100644
index 0000000000..f7ff3d06fe
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ParallaxView.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/PasswordBox.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/PasswordBox.png
index a2d472933a..007112fa2d 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/PasswordBox.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/PasswordBox.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/PersonPicture.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/PersonPicture.png
new file mode 100644
index 0000000000..c9397ba526
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/PersonPicture.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Pivot.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Pivot.png
index 48527b2cd5..0f9135d7f7 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Pivot.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Pivot.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ProgressBar.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ProgressBar.png
index c19aa86418..e1caba8a32 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ProgressBar.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ProgressBar.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ProgressRing.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ProgressRing.png
index 26110a883e..bacdd93527 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ProgressRing.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ProgressRing.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/PullToRefresh.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/PullToRefresh.png
new file mode 100644
index 0000000000..b9e38e825b
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/PullToRefresh.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RadioButton.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RadioButton.png
index 02447c89a4..fc54f055bb 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RadioButton.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RadioButton.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RatingControl.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RatingControl.png
new file mode 100644
index 0000000000..b523d3fe88
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RatingControl.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RelativePanel.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RelativePanel.png
index 28256cca29..f7751c982a 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RelativePanel.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RelativePanel.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Reveal.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Reveal.png
new file mode 100644
index 0000000000..1c035c6ee2
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Reveal.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RichEditBox.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RichEditBox.png
index d316efef5e..4d78eabf2d 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RichEditBox.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RichEditBox.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RichTextBlock.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RichTextBlock.png
index 59792f450e..f810699776 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RichTextBlock.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/RichTextBlock.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ScrollViewer.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ScrollViewer.png
index 27b3cff0a3..e0550f3b76 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ScrollViewer.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ScrollViewer.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Slices.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Slices.png
index c794fbbe09..8c793521c6 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Slices.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Slices.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Slider.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Slider.png
index ebd1bc7dc6..2c1725bb42 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Slider.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Slider.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/SplitView.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/SplitView.png
index 0142a0d9ec..4b0c4037fb 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/SplitView.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/SplitView.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/StackPanel.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/StackPanel.png
index 2dc4d5b38b..540f0c3e3d 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/StackPanel.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/StackPanel.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Swipe.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Swipe.png
new file mode 100644
index 0000000000..ed5d9db9c3
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Swipe.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TextBlock.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TextBlock.png
index 5bc7c66c90..60b8b048c4 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TextBlock.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TextBlock.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TextBox.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TextBox.png
index 1528aedfb5..ba55339621 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TextBox.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TextBox.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-100.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-100.png
new file mode 100644
index 0000000000..7cff4ca5c9
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-100.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-125.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-125.png
new file mode 100644
index 0000000000..058eaff8b2
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-125.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-150.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-150.png
new file mode 100644
index 0000000000..50f5843228
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-150.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-200.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-200.png
new file mode 100644
index 0000000000..c343058463
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-200.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-400.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-400.png
new file mode 100644
index 0000000000..1bffccfe4d
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/LargeTile.scale-400.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-16.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-16.png
new file mode 100644
index 0000000000..c95e1fd3a8
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-16.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-24.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-24.png
new file mode 100644
index 0000000000..f0d880aebc
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-24.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-256.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-256.png
new file mode 100644
index 0000000000..29bd5730d7
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-256.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-32.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-32.png
new file mode 100644
index 0000000000..50ed2b5bcd
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-32.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-48.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-48.png
new file mode 100644
index 0000000000..f466d2cbd2
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.altform-unplated_targetsize-48.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-100.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-100.png
new file mode 100644
index 0000000000..32a65d7ca1
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-100.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-125.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-125.png
new file mode 100644
index 0000000000..7f677dc7ec
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-125.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-150.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-150.png
new file mode 100644
index 0000000000..b12f5c0f24
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-150.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-200.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-200.png
new file mode 100644
index 0000000000..a3c4266438
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-200.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-400.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-400.png
new file mode 100644
index 0000000000..5d3b781850
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.scale-400.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-16.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-16.png
new file mode 100644
index 0000000000..5847aaba69
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-16.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-24.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-24.png
new file mode 100644
index 0000000000..4c18223d47
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-24.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-256.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-256.png
new file mode 100644
index 0000000000..1847eb716d
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-256.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-32.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-32.png
new file mode 100644
index 0000000000..4d79849e42
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-32.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-48.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-48.png
new file mode 100644
index 0000000000..430410dbf6
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile-sdk.targetsize-48.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-100.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-100.png
new file mode 100644
index 0000000000..bf2eb5c0cb
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-100.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-125.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-125.png
new file mode 100644
index 0000000000..2dd11dc0cf
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-125.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-150.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-150.png
new file mode 100644
index 0000000000..43b0f9b9be
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-150.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-200.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-200.png
new file mode 100644
index 0000000000..138fbd1483
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-200.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-400.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-400.png
new file mode 100644
index 0000000000..a7003b567e
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/SmallTile.scale-400.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-100.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-100.png
new file mode 100644
index 0000000000..c035bdfb9c
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-100.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-125.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-125.png
new file mode 100644
index 0000000000..81bb8f36fe
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-125.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-150.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-150.png
new file mode 100644
index 0000000000..0d11312ace
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-150.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-200.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-200.png
new file mode 100644
index 0000000000..810953281c
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-200.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-400.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-400.png
new file mode 100644
index 0000000000..49de3aeee3
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/StoreLogo-sdk.scale-400.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/Tile_General.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/Tile_General.png
new file mode 100644
index 0000000000..f963171deb
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/Tile_General.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideLogo.scale-80.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideLogo.scale-80.png
new file mode 100644
index 0000000000..b60d6f3d9e
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideLogo.scale-80.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-100.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-100.png
new file mode 100644
index 0000000000..a416d8b55e
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-100.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-125.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-125.png
new file mode 100644
index 0000000000..0eda77a651
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-125.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-150.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-150.png
new file mode 100644
index 0000000000..a6129a30e1
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-150.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-200.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-200.png
new file mode 100644
index 0000000000..52e614ab72
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-200.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-400.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-400.png
new file mode 100644
index 0000000000..0eba311618
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/WideTile.scale-400.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-100.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-100.png
new file mode 100644
index 0000000000..52e614ab72
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-100.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-125.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-125.png
new file mode 100644
index 0000000000..0db25063f4
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-125.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-150.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-150.png
new file mode 100644
index 0000000000..848b8cb065
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-150.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-200.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-200.png
new file mode 100644
index 0000000000..0eba311618
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-200.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-400.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-400.png
new file mode 100644
index 0000000000..75dece167e
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/splash-sdk.scale-400.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-100.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-100.png
new file mode 100644
index 0000000000..de9471d93e
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-100.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-125.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-125.png
new file mode 100644
index 0000000000..6d88663941
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-125.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-150.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-150.png
new file mode 100644
index 0000000000..da7c863352
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-150.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-200.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-200.png
new file mode 100644
index 0000000000..474d170cc2
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-200.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-400.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-400.png
new file mode 100644
index 0000000000..df7a66def0
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/squaretile-sdk.scale-400.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/widelogo.scale-100.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/widelogo.scale-100.png
new file mode 100644
index 0000000000..367986d157
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/widelogo.scale-100.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/widelogo.scale-140.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/widelogo.scale-140.png
new file mode 100644
index 0000000000..c9a916d1c0
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/widelogo.scale-140.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/widelogo.scale-180.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/widelogo.scale-180.png
new file mode 100644
index 0000000000..fbb038719c
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/Tiles/widelogo.scale-180.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TimePicker.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TimePicker.png
index e909b62b7a..a876f21e60 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TimePicker.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TimePicker.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToggleButton.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToggleButton.png
index e1d3c56f74..77884fb8b2 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToggleButton.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToggleButton.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToggleSwitch.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToggleSwitch.png
index 8c14722d3d..48c4607116 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToggleSwitch.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToggleSwitch.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToolTip.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToolTip.png
index 3a13221cf9..84ebcd8edc 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToolTip.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ToolTip.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TreeView.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TreeView.png
new file mode 100644
index 0000000000..56f16e075b
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/TreeView.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/VariableSizedWrapGrid.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/VariableSizedWrapGrid.png
index abd0b79362..c887481c6a 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/VariableSizedWrapGrid.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/VariableSizedWrapGrid.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ViewBox.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ViewBox.png
index e2a33bd637..842a0f0bc6 100644
Binary files a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ViewBox.png and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/ViewBox.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Assets/WebView.png b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/WebView.png
new file mode 100644
index 0000000000..d397537bee
Binary files /dev/null and b/Samples/XamlUIBasics/cs/AppUIBasics/Assets/WebView.png differ
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Behaviors/ImageScrollBehavior.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Behaviors/ImageScrollBehavior.cs
new file mode 100644
index 0000000000..d6503564b7
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Behaviors/ImageScrollBehavior.cs
@@ -0,0 +1,110 @@
+using Microsoft.Xaml.Interactivity;
+using System.Linq;
+using Windows.ApplicationModel.Core;
+using Windows.UI;
+using Windows.UI.ViewManagement;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media;
+
+namespace AppUIBasics.Behaviors
+{
+ public class ImageScrollBehavior : DependencyObject, IBehavior
+ {
+ private const int _opacityMaxValue = 250;
+ private const int _alpha = 255;
+ private const int _maxFontSize = 42;
+ private const int _minFontSize = 24;
+ private const int scrollViewerThresholdValue = 250;
+ private ScrollViewer scrollViewer;
+ private GridView gridView;
+
+ public DependencyObject AssociatedObject { get; private set; }
+
+ public Control TargetControl
+ {
+ get { return (Control)GetValue(TargetControlProperty); }
+ set { SetValue(TargetControlProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for TargetControl. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty TargetControlProperty =
+ DependencyProperty.Register("TargetControl", typeof(Control), typeof(ImageScrollBehavior), new PropertyMetadata(null));
+
+ public void Attach(DependencyObject associatedObject)
+ {
+ AssociatedObject = associatedObject;
+ if (!GetScrollViewer())
+ {
+ ((GridView)associatedObject).Loaded += GridView_Loaded;
+ }
+ }
+
+ private void GridView_Loaded(object sender, RoutedEventArgs e)
+ {
+ GetScrollViewer();
+ gridView = sender as GridView;
+ }
+
+ private bool GetScrollViewer()
+ {
+ scrollViewer = Common.UIHelper.GetDescendantsOfType(AssociatedObject).FirstOrDefault();
+ if (scrollViewer != null)
+ {
+ scrollViewer.ViewChanging += ScrollViewer_ViewChanging;
+ return true;
+ }
+ return false;
+ }
+
+ private void ScrollViewer_ViewChanging(object sender, ScrollViewerViewChangingEventArgs e)
+ {
+ double verticalOffset = ((ScrollViewer)sender).VerticalOffset;
+ var header = (PageHeader)TargetControl;
+ header.BackgroundColorOpacity = verticalOffset / _opacityMaxValue;
+ header.AcrylicOpacity = 0.3 * (1 - (verticalOffset / _opacityMaxValue));
+ if (verticalOffset == 0)
+ {
+ header.BackgroundColorOpacity = 0;
+ header.FontSize = 42;
+ header.Foreground = new SolidColorBrush(Colors.White);
+ header.AcrylicOpacity = 0.3;
+ }
+ else if (verticalOffset > scrollViewerThresholdValue)
+ {
+ TargetControl.FontSize = _minFontSize;
+ if (gridView != null)
+ {
+ gridView.Margin = Window.Current.Bounds.Width > 640 ? new Thickness(0, 70, 0, 0) : new Thickness(0, 10, 0, 0);
+ }
+ ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Colors.Black;
+ }
+ else
+ {
+ TargetControl.FontSize = -(((verticalOffset / scrollViewerThresholdValue) * (_maxFontSize - _minFontSize)) - _maxFontSize);
+ if (gridView != null)
+ {
+ gridView.Margin = new Thickness(0);
+ }
+ ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Window.Current.Bounds.Width > 640 ? Colors.White : Colors.Black;
+ }
+
+ if (App.Current.RequestedTheme != ApplicationTheme.Dark)
+ {
+ Color foreground = new Color() { A = _alpha };
+ foreground.R = foreground.G = foreground.B = (byte)((verticalOffset > _alpha) ? 0 : (_alpha - verticalOffset));
+ TargetControl.Foreground = new SolidColorBrush(foreground);
+ }
+ else
+ {
+ ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Colors.White;
+ }
+ }
+
+ public void Detach()
+ {
+ ((GridView)AssociatedObject).Loaded -= GridView_Loaded;
+ AssociatedObject = null;
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Common/BooleanToValueConverter.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Common/BooleanToValueConverter.cs
new file mode 100644
index 0000000000..9903142009
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Common/BooleanToValueConverter.cs
@@ -0,0 +1,18 @@
+using System;
+using Windows.UI.Xaml.Data;
+
+namespace AppUIBasics.Common
+{
+ public sealed class BooleanToValueConverter: IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ return ((bool)value) ? parameter : null;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Common/ColorSlideTransitionHelper.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Common/ColorSlideTransitionHelper.cs
new file mode 100644
index 0000000000..5f15c43135
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Common/ColorSlideTransitionHelper.cs
@@ -0,0 +1,180 @@
+//*********************************************************
+//
+// 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.Numerics;
+using Windows.Foundation;
+using Windows.UI.Composition;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Hosting;
+
+namespace AppUIBasics.Common
+{
+ ///
+ /// A helper class encapsulating the function and visuals for a Color Slide transition animation.
+ ///
+ public class ColorSlideTransitionHelper
+ {
+ #region Member variables
+
+ UIElement hostForVisual;
+ Compositor _compositor;
+ ContainerVisual _containerForVisuals;
+ ScalarKeyFrameAnimation _slideAnimation;
+ bool firstRun = true;
+
+ #endregion
+
+
+ #region Ctor
+
+ ///
+ /// Creates an instance of the ColorSlideTransitionHelper.
+ /// Any visuals to be later created and animated will be hosted within the specified UIElement.
+ ///
+ public ColorSlideTransitionHelper(UIElement hostForVisual)
+ {
+
+
+ this.hostForVisual = hostForVisual;
+
+ // we have an element in the XAML tree that will host our Visuals
+ var visual = ElementCompositionPreview.GetElementVisual(hostForVisual);
+ _compositor = visual.Compositor;
+
+ // create a container
+ // adding children to this container adds them to the live visual tree
+ _containerForVisuals = _compositor.CreateContainerVisual();
+
+ InitializeSlideAnimation();
+
+
+ ElementCompositionPreview.SetElementChildVisual(hostForVisual, _containerForVisuals);
+ }
+
+ #endregion
+
+
+ #region Public API surface
+
+ public delegate void ColorSlideTransitionCompletedEventHandler(object sender, EventArgs e);
+
+ ///
+ /// Indicates that the color slide transition has completed.
+ ///
+ public event ColorSlideTransitionCompletedEventHandler ColorSlideTransitionCompleted;
+
+
+ ///
+ /// Starts the color slide transition using the specified color and boundary sizes.
+ ///
+ /// The slide is achieved by creating a rectangular solid colored visual whose scale is progressively
+ /// animated to fully flood a given area.
+ ///
+ /// Using the specified color
+ /// The transition begins with a visual with these bounds and position
+ /// The transition ends when the visual has slid to an area of this bounding size
+ ///
+ public void Start(Windows.UI.Color color, Rect finalBounds)
+ {
+ var colorVisual = CreateVisualWithColorAndPosition(color, finalBounds);
+
+ // add our solid colored rectangular visual to the live visual tree via the container
+ _containerForVisuals.Children.InsertAtTop(colorVisual);
+
+ // now that we have a visual, let's run the animation
+ TriggerSlideAnimation(colorVisual);
+ }
+
+ #endregion
+
+
+ #region All the heavy lifting
+ ///
+ /// Creates a Visual using the specific color and constraints
+ ///
+ private SpriteVisual CreateVisualWithColorAndPosition(Windows.UI.Color color,
+ Windows.Foundation.Rect finalBounds)
+ {
+
+ var offset = new Vector3((float)finalBounds.Left, (float)finalBounds.Top, 0f);
+ var size = new Vector2((float)finalBounds.Width, (float)finalBounds.Height);
+
+ SpriteVisual coloredRectangle = _compositor.CreateSpriteVisual();
+ coloredRectangle.Brush = _compositor.CreateColorBrush(color);
+ coloredRectangle.Offset = offset;
+ coloredRectangle.Size = size;
+
+ return coloredRectangle;
+
+ }
+
+
+
+ ///
+ /// Creates an animation template for a "color slide" type effect on a rectangular colored visual.
+ /// This is a sub-second animation on the Scale property of the visual.
+ ///
+ private void InitializeSlideAnimation()
+ {
+ _slideAnimation = _compositor.CreateScalarKeyFrameAnimation();
+ _slideAnimation.InsertKeyFrame(1.0f, 0f);
+ _slideAnimation.Duration = TimeSpan.FromMilliseconds(800); // keeping this under a sec to not be obtrusive
+
+ }
+
+ ///
+ /// Runs the animation
+ ///
+ private void TriggerSlideAnimation(SpriteVisual colorVisual)
+ {
+
+ // animate the Scale of the visual within a scoped batch
+ // this gives us transactionality and allows us to do work once the transaction completes
+ var batchTransaction = _compositor.CreateScopedBatch(CompositionBatchTypes.Animation);
+
+ // as with all animations on Visuals, these too will run independent of the UI thread
+ // so if the UI thread is busy with app code or doing layout on state/page transition,
+ // this animation still run uninterruped and glitch free.
+ colorVisual.StartAnimation("Offset.Y", _slideAnimation);
+
+ batchTransaction.Completed += SlideAnimationCompleted;
+
+ batchTransaction.End();
+
+ }
+
+ ///
+ /// Cleans up after the slide animation has ended
+ ///
+ private void SlideAnimationCompleted(object sender, CompositionBatchCompletedEventArgs args)
+ {
+ if (!firstRun)
+ {
+ foreach (var childVisual in _containerForVisuals.Children)
+ {
+ _containerForVisuals.Children.Remove(childVisual);
+ break; // we only need to remove the first child
+ }
+ }
+ else
+ {
+ firstRun = false;
+ }
+
+ // notify interested parties
+ ColorSlideTransitionCompleted(this, EventArgs.Empty);
+ }
+
+ #endregion
+
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Common/HeaderBackgroundConverter.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Common/HeaderBackgroundConverter.cs
new file mode 100644
index 0000000000..b58289e694
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Common/HeaderBackgroundConverter.cs
@@ -0,0 +1,29 @@
+using System;
+using Windows.UI;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Media;
+
+namespace AppUIBasics.Common
+{
+ public class HeaderBackgroundConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ switch (value)
+ {
+ case SearchResultsPage page:
+ return Application.Current.Resources["HomePageBackgroundBrush"] as SolidColorBrush;
+ case SectionPage page:
+ return Application.Current.Resources["HomePageBackgroundBrush"] as SolidColorBrush;
+ default:
+ return Application.Current.Resources["ApplicationPageBackgroundThemeBrush"] as SolidColorBrush;
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Common/ImageLoader.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Common/ImageLoader.cs
new file mode 100644
index 0000000000..588b2b58a5
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Common/ImageLoader.cs
@@ -0,0 +1,40 @@
+using AppUIBasics.Data;
+using System;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Media.Imaging;
+
+namespace AppUIBasics.Common
+{
+ public class ImageLoader
+ {
+ public static string GetSource(DependencyObject obj)
+ {
+ return (string)obj.GetValue(SourceProperty);
+ }
+
+ public static void SetSource(DependencyObject obj, string value)
+ {
+ obj.SetValue(SourceProperty, value);
+ }
+
+ // Using a DependencyProperty as the backing store for Path. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty SourceProperty =
+ DependencyProperty.RegisterAttached("Source", typeof(string), typeof(ImageLoader), new PropertyMetadata(string.Empty, OnPropertyChanged));
+
+ private async static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ var image = d as Image;
+ if (image != null)
+ {
+ var item = await ControlInfoDataSource.GetItemAsync(e.NewValue?.ToString());
+ if (item?.ImagePath != null)
+ {
+ Uri imageUri = new Uri(item.ImagePath, UriKind.Absolute);
+ BitmapImage imageBitmap = new BitmapImage(imageUri);
+ image.Source = imageBitmap;
+ }
+ }
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Common/NavigationHelper.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Common/NavigationHelper.cs
index 6f62e07180..337a2b979d 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/Common/NavigationHelper.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Common/NavigationHelper.cs
@@ -20,9 +20,9 @@ namespace AppUIBasics.Common
///
/// To make use of NavigationHelper, follow these two steps or
/// start with a BasicPage or any other Page item template other than BlankPage.
- ///
+ ///
/// 1) Create an instance of the NavigationHelper somewhere such as in the
- /// constructor for the page and register a callback for the LoadState and
+ /// constructor for the page and register a callback for the LoadState and
/// SaveState events.
///
/// public MyPage()
@@ -32,22 +32,22 @@ namespace AppUIBasics.Common
/// this.navigationHelper.LoadState += navigationHelper_LoadState;
/// this.navigationHelper.SaveState += navigationHelper_SaveState;
/// }
- ///
+ ///
/// private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
/// { }
/// private void navigationHelper_SaveState(object sender, LoadStateEventArgs e)
/// { }
///
- ///
- /// 2) Register the page to call into the NavigationManager whenever the page participates
- /// in navigation by overriding the
+ ///
+ /// 2) Register the page to call into the NavigationManager whenever the page participates
+ /// in navigation by overriding the
/// and events.
///
/// protected override void OnNavigatedTo(NavigationEventArgs e)
/// {
/// navigationHelper.OnNavigatedTo(e);
/// }
- ///
+ ///
/// protected override void OnNavigatedFrom(NavigationEventArgs e)
/// {
/// navigationHelper.OnNavigatedFrom(e);
@@ -186,7 +186,6 @@ public RootFrameNavigationHelper(Frame rootFrame)
// Handle keyboard and mouse navigation requests
this.systemNavigationManager = SystemNavigationManager.GetForCurrentView();
systemNavigationManager.BackRequested += SystemNavigationManager_BackRequested;
- UpdateBackButton();
// Listen to the window directly so we will respond to hotkeys regardless
// of which element has focus.
@@ -196,7 +195,6 @@ public RootFrameNavigationHelper(Frame rootFrame)
this.CoreWindow_PointerPressed;
// Update the Back button whenever a navigation occurs.
- this.Frame.Navigated += (s, e) => UpdateBackButton();
}
private bool TryGoBack()
@@ -235,7 +233,7 @@ private void UpdateBackButton()
systemNavigationManager.AppViewBackButtonVisibility =
this.Frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
}
-
+
///
/// Invoked on every keystroke, including system keys such as Alt key combinations.
/// Used to detect keyboard navigation between pages even when the page itself
@@ -322,7 +320,7 @@ private void CoreWindow_PointerPressed(CoreWindow sender,
public class LoadStateEventArgs : EventArgs
{
///
- /// The parameter value passed to
+ /// The parameter value passed to
/// when this page was initially requested.
///
public Object NavigationParameter { get; private set; }
@@ -336,7 +334,7 @@ public class LoadStateEventArgs : EventArgs
/// Initializes a new instance of the class.
///
///
- /// The parameter value passed to
+ /// The parameter value passed to
/// when this page was initially requested.
///
///
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Common/NullToVisibilityConverter.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Common/NullToVisibilityConverter.cs
new file mode 100644
index 0000000000..a87a511f24
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Common/NullToVisibilityConverter.cs
@@ -0,0 +1,19 @@
+using System;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Data;
+
+namespace AppUIBasics.Common
+{
+ public class NullToVisibilityConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ return (value == null) ? Visibility.Collapsed : Visibility.Visible;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Common/ReadMe.txt b/Samples/XamlUIBasics/cs/AppUIBasics/Common/ReadMe.txt
index b42108c7e7..a629aa23b2 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/Common/ReadMe.txt
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Common/ReadMe.txt
@@ -4,4 +4,4 @@ Classes in the Common directory form part of your project and may be further enh
needs. Care should be taken when altering existing methods and properties as incompatible changes
will require corresponding changes to code included in a variety of Visual Studio templates. For
example, additional pages added to your project are written assuming that the original methods and
-properties in Common classes are still present and that the names of the types have not changed.
\ No newline at end of file
+properties in Common classes are still present and that the names of the types have not changed.
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Common/ShowAcrylicBehindHeaderConverter.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Common/ShowAcrylicBehindHeaderConverter.cs
new file mode 100644
index 0000000000..f03f6a0cce
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Common/ShowAcrylicBehindHeaderConverter.cs
@@ -0,0 +1,27 @@
+using System;
+using Windows.UI;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Media;
+
+namespace AppUIBasics.Common
+{
+ public class ShowAcrylicBehindHeaderConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, string language)
+ {
+ switch (value)
+ {
+ case MainPage page:
+ return Visibility.Visible;
+ default:
+ return Visibility.Collapsed;
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, string language)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Common/UIHelper.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Common/UIHelper.cs
new file mode 100644
index 0000000000..f3b3c2d94c
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Common/UIHelper.cs
@@ -0,0 +1,41 @@
+using System.Collections.Generic;
+using System.Linq;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Media;
+
+namespace AppUIBasics.Common
+{
+ public static class UIHelper
+ {
+ public static IEnumerable GetDescendantsOfType(this DependencyObject start) where T : DependencyObject
+ {
+ return start.GetDescendants().OfType();
+ }
+
+ public static IEnumerable GetDescendants(this DependencyObject start)
+ {
+ var queue = new Queue();
+ var count1 = VisualTreeHelper.GetChildrenCount(start);
+
+ for (int i = 0; i < count1; i++)
+ {
+ var child = VisualTreeHelper.GetChild(start, i);
+ yield return child;
+ queue.Enqueue(child);
+ }
+
+ while (queue.Count > 0)
+ {
+ var parent = queue.Dequeue();
+ var count2 = VisualTreeHelper.GetChildrenCount(parent);
+
+ for (int i = 0; i < count2; i++)
+ {
+ var child = VisualTreeHelper.GetChild(parent, i);
+ yield return child;
+ queue.Enqueue(child);
+ }
+ }
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Common/ValueToStringConverter.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Common/ValueToStringConverter.cs
index 940bef3d36..247632dbb5 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/Common/ValueToStringConverter.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Common/ValueToStringConverter.cs
@@ -20,7 +20,7 @@ public sealed class ValueToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
- return value.ToString();
+ return value?.ToString();
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlExample.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlExample.xaml
index 479c02e5ce..d95fd41f66 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlExample.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlExample.xaml
@@ -5,24 +5,75 @@
xmlns:local="using:AppUIBasics"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:Interactivity="using:Microsoft.Xaml.Interactivity"
+ xmlns:Core="using:Microsoft.Xaml.Interactions.Core"
+ xmlns:Media="using:Microsoft.Xaml.Interactions.Media"
mc:Ignorable="d"
d:DesignHeight="300"
- d:DesignWidth="400">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ d:DesignWidth="580"
+ x:Name="RootPanel"
+ Width="627"
+ HorizontalAlignment="Left"
+ Margin="0,0,0,24">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AcrylicPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AcrylicPage.xaml
new file mode 100644
index 0000000000..7bcf9b110c
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AcrylicPage.xaml
@@ -0,0 +1,198 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Rectangle
+ Fill="{ThemeResource SystemControlAcrylicElementBrush}" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Rectangle
+ Fill="{ThemeResource SystemControlAcrylicWindowBrush}" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Rectangle
+ Fill="{ThemeResource CustomAcrylicInAppBrush}" />
+
+
+ <ResourceDictionary x:Key="Default">
+ <media:AcrylicBrush
+ x:Key="CustomAcrylicBrush" BackgroundSource="Backdrop"
+
+ TintOpacity=""
+ TintColor=""
+ FallbackColor="" />
+
+ </ResourceDictionary>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Rectangle
+ Fill="{ThemeResource CustomAcrylicBackgroundBrush}" />
+
+
+ <ResourceDictionary x:Key="Default">
+ <media:AcrylicBrush
+ x:Key="CustomAcrylicBackgroundBrush" BackgroundSource="HostBackdrop"
+
+ TintOpacity=""
+ TintColor=""
+ FallbackColor="" />
+
+ </ResourceDictionary>
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AcrylicPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AcrylicPage.xaml.cs
new file mode 100644
index 0000000000..e8918c7f1d
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AcrylicPage.xaml.cs
@@ -0,0 +1,48 @@
+using System.Linq;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Shapes;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class AcrylicPage : Page
+ {
+ public AcrylicPage()
+ {
+ this.InitializeComponent();
+ Loaded += AcrylicPage_Loaded;
+ }
+
+ private void AcrylicPage_Loaded(object sender, RoutedEventArgs e)
+ {
+ ColorSelector.SelectedIndex = ColorSelectorInApp.SelectedIndex = 0;
+ FallbackColorSelector.SelectedIndex = FallbackColorSelectorInApp.SelectedIndex = 0;
+ OpacitySlider.Value = OpacitySliderInApp.Value = 0.8;
+ }
+
+ private void Slider_ValueChanged(object sender, RangeBaseValueChangedEventArgs e)
+ {
+ Rectangle shape = (sender == OpacitySliderInApp) ? CustomAcrylicShapeInApp : CustomAcrylicShape;
+ ((AcrylicBrush)shape.Fill).TintOpacity = e.NewValue;
+ }
+
+ private void ColorSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ Rectangle shape = (sender == ColorSelectorInApp) ? CustomAcrylicShapeInApp : CustomAcrylicShape;
+ ((AcrylicBrush)shape.Fill).TintColor = ((SolidColorBrush)e.AddedItems.First()).Color;
+ }
+
+ private void FallbackColorSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ Rectangle shape = (sender == FallbackColorSelectorInApp) ? CustomAcrylicShapeInApp : CustomAcrylicShape;
+ ((AcrylicBrush)shape.Fill).FallbackColor = ((SolidColorBrush)e.AddedItems.First()).Color;
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarButtonPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarButtonPage.xaml
index 2c01982ca8..d48e4974ed 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarButtonPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarButtonPage.xaml
@@ -9,124 +9,87 @@
//
//*********************************************************
-->
-
-
-
-
-
-
-
-
-
-
-
-
- <AppBarButton Icon="Like" Label="SymbolIcon" Click="AppBarButton_Click"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <AppBarButton Label="BitmapIcon" Click="AppBarButton_Click">
- <AppBarButton.Icon>
- <BitmapIcon UriSource="ms-appx:///Assets/Slices2.png"/>
- </AppBarButton.Icon>
- </AppBarButton>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <AppBarButton Label="FontIcon" Click="AppBarButton_Click">
- <AppBarButton.Icon>
- <FontIcon FontFamily="Candara" Glyph="Σ"/>
- </AppBarButton.Icon>
- </AppBarButton>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <AppBarButton Label="PathIcon" Click="AppBarButton_Click">
- <AppBarButton.Content>
- <Viewbox Stretch="Uniform">
- <PathIcon Data="F1 M 20,20L 24,10L 24,24L 5,24"/>
- </Viewbox>
- </AppBarButton.Content>
- </AppBarButton>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ <AppBarButton Icon="Like" Label="SymbolIcon" Click="AppBarButton_Click"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <AppBarButton Label="BitmapIcon" Click="AppBarButton_Click">
+ <AppBarButton.Icon>
+ <BitmapIcon UriSource="ms-appx:///Assets/Slices2.png"/>
+ </AppBarButton.Icon>
+ </AppBarButton>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <AppBarButton Label="FontIcon" Click="AppBarButton_Click">
+ <AppBarButton.Icon>
+ <FontIcon FontFamily="Candara" Glyph="Σ"/>
+ </AppBarButton.Icon>
+ </AppBarButton>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <AppBarButton Label="PathIcon" Click="AppBarButton_Click">
+ <AppBarButton.Content>
+ <Viewbox Stretch="Uniform">
+ <PathIcon Data="F1 M 20,20L 24,10L 24,24L 5,24"/>
+ </Viewbox>
+ </AppBarButton.Content>
+ </AppBarButton>
+
+
+
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarButtonPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarButtonPage.xaml.cs
index 40894b67d7..60b421c148 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarButtonPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarButtonPage.xaml.cs
@@ -22,48 +22,39 @@ namespace AppUIBasics.ControlPages
public sealed partial class AppBarButtonPage : Page
{
AppBarToggleButton compactButton = null;
+ AppBarSeparator separator = null;
public AppBarButtonPage()
{
this.InitializeComponent();
Loaded += AppBarButtonPage_Loaded;
+ Unloaded += AppBarButtonPage_Unloaded;
}
- protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
+ private void AppBarButtonPage_Unloaded(object sender, RoutedEventArgs e)
{
- // Remove compact button from the command bar.
- base.OnNavigatingFrom(e);
- Frame rootFrame = Window.Current.Content as Frame;
- ItemPage rootPage = rootFrame.Content as ItemPage;
-
- if (rootPage != null)
- {
- CommandBar appBar = rootPage.BottomCommandBar;
- compactButton.Click -= CompactButton_Click;
- appBar.PrimaryCommands.Remove(compactButton);
- }
+ CommandBar appBar = NavigationRootPage.Current.PageHeader.TopCommandBar;
+ compactButton.Click -= CompactButton_Click;
+ appBar.PrimaryCommands.Remove(compactButton);
+ appBar.PrimaryCommands.Remove(separator);
}
void AppBarButtonPage_Loaded(object sender, RoutedEventArgs e)
{
// Add compact button to the command bar. It provides functionality specific
// to this page, and is removed when leaving the page.
- ItemPage itemPage = NavigationRootPage.RootFrame.Content as ItemPage;
- if (itemPage != null)
- {
- CommandBar appBar = itemPage.BottomCommandBar;
-
- appBar.PrimaryCommands.Insert(0, new AppBarSeparator());
+ CommandBar appBar = NavigationRootPage.Current.PageHeader.TopCommandBar;
+ separator = new AppBarSeparator();
+ appBar.PrimaryCommands.Insert(0, separator);
compactButton = new AppBarToggleButton();
compactButton.Icon = new SymbolIcon(Symbol.FontSize);
compactButton.Label = "IsCompact";
compactButton.Click += CompactButton_Click;
appBar.PrimaryCommands.Insert(0, compactButton);
- }
}
-
+
private void CompactButton_Click(object sender, RoutedEventArgs e)
{
ToggleButton toggle = sender as ToggleButton;
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarPage.xaml
index f36254a95a..da8d11ae6d 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarPage.xaml
@@ -18,7 +18,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" NavigationCacheMode="Disabled">
-
+
+
-
-
-
+
-
-
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarPage.xaml.cs
index 74b1797771..292a5e9bce 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarPage.xaml.cs
@@ -28,23 +28,19 @@ public AppBarPage()
private void topAppBar_Opened(object sender, object e)
{
- ItemPage itemPage = NavigationRootPage.RootFrame.Content as ItemPage;
- if (itemPage != null)
- {
- CommandBar bottomAppBar = itemPage.BottomCommandBar;
- bottomAppBar.IsOpen = false;
- }
+ CommandBar headerTopAppBar = NavigationRootPage.Current.PageHeader.TopCommandBar;
+ headerTopAppBar.IsOpen = false;
}
private void OpenButton_Click(object sender, RoutedEventArgs e)
{
- this.TopAppBar.IsOpen = true;
+ topAppBar.IsOpen = true;
}
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
- this.TopAppBar.IsOpen = false;
+ topAppBar.IsOpen = false;
}
private void NavBarButton_Click(object sender, RoutedEventArgs e)
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarSeparatorPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarSeparatorPage.xaml
index ab86725fec..17a4574eac 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarSeparatorPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarSeparatorPage.xaml
@@ -20,17 +20,19 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+ <StackPanel Orientation="Horizontal"><AppBarButton Icon="AttachCamera" Label="Attach Camera"/>
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarSeparatorPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarSeparatorPage.xaml.cs
index 3bb91ea1bd..ecd853e2ba 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarSeparatorPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarSeparatorPage.xaml.cs
@@ -22,46 +22,37 @@ namespace AppUIBasics.ControlPages
public sealed partial class AppBarSeparatorPage : Page
{
AppBarToggleButton compactButton = null;
+ AppBarSeparator separator = null;
public AppBarSeparatorPage()
{
this.InitializeComponent();
Loaded += AppBarButtonPage_Loaded;
+ Unloaded += AppBarSeparatorPage_Unloaded;
}
- protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
+ private void AppBarSeparatorPage_Unloaded(object sender, RoutedEventArgs e)
{
- // Remove compact button from the command bar.
- base.OnNavigatingFrom(e);
- Frame rootFrame = Window.Current.Content as Frame;
- ItemPage rootPage = rootFrame.Content as ItemPage;
-
- if (rootPage != null)
- {
- CommandBar appBar = rootPage.BottomCommandBar;
- compactButton.Click -= CompactButton_Click;
- appBar.PrimaryCommands.Remove(compactButton);
- }
+ CommandBar appBar = NavigationRootPage.Current.PageHeader.TopCommandBar;
+ compactButton.Click -= CompactButton_Click;
+ appBar.PrimaryCommands.Remove(compactButton);
+ appBar.PrimaryCommands.Remove(separator);
}
void AppBarButtonPage_Loaded(object sender, RoutedEventArgs e)
{
// Add compact button to the command bar. It provides functionality specific
// to this page, and is removed when leaving the page.
- ItemPage itemPage = NavigationRootPage.RootFrame.Content as ItemPage;
- if (itemPage != null)
- {
- CommandBar appBar = itemPage.BottomCommandBar;
-
- appBar.PrimaryCommands.Insert(0, new AppBarSeparator());
+ CommandBar appBar = NavigationRootPage.Current.PageHeader.TopCommandBar;
+ separator = new AppBarSeparator();
+ appBar.PrimaryCommands.Insert(0, separator);
compactButton = new AppBarToggleButton();
compactButton.Icon = new SymbolIcon(Symbol.FontSize);
compactButton.Label = "IsCompact";
compactButton.Click += CompactButton_Click;
appBar.PrimaryCommands.Insert(0, compactButton);
- }
}
private void CompactButton_Click(object sender, RoutedEventArgs e)
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarToggleButtonPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarToggleButtonPage.xaml
index e89fed8357..683e6eb527 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarToggleButtonPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarToggleButtonPage.xaml
@@ -9,131 +9,94 @@
//
//*********************************************************
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <AppBarToggleButton Icon="Shuffle" Label="SymbolIcon" Click="AppBarButton_Click"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <AppBarToggleButton Label="BitmapIcon" Click="AppBarButton_Click">
- <AppBarToggleButton.Icon>
- <BitmapIcon UriSource="ms-appx:///Assets/Slices2.png"/>
- </AppBarToggleButton.Icon>
- </AppBarToggleButton>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <AppBarToggleButton Label="FontIcon" Click="AppBarButton_Click">
- <AppBarToggleButton.Icon>
- <FontIcon FontFamily="Candara" Glyph="
- "/>
-
- </AppBarToggleButton.Icon>
- </AppBarToggleButton>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <AppBarToggleButton Label="PathIcon" Click="AppBarButton_Click" IsThreeState="True">
- <AppBarToggleButton.Icon>
- <PathIcon Data="F1 M 20,20L 24,10L 24,24L 5,24"/>
- </AppBarToggleButton.Icon>
- </AppBarToggleButton>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ <AppBarToggleButton Icon="Shuffle" Label="SymbolIcon" Click="AppBarButton_Click"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <AppBarToggleButton Label="BitmapIcon" Click="AppBarButton_Click">
+ <AppBarToggleButton.Icon>
+ <BitmapIcon UriSource="ms-appx:///Assets/Slices2.png"/>
+ </AppBarToggleButton.Icon>
+ </AppBarToggleButton>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <AppBarToggleButton Label="FontIcon" Click="AppBarButton_Click">
+ <AppBarToggleButton.Icon>
+ <FontIcon FontFamily="Candara" Glyph=""/>
+
+ </AppBarToggleButton.Icon>
+ </AppBarToggleButton>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <AppBarToggleButton Label="PathIcon" Click="AppBarButton_Click" IsThreeState="True">
+ <AppBarToggleButton.Icon>
+ <PathIcon Data="F1 M 20,20L 24,10L 24,24L 5,24"/>
+ </AppBarToggleButton.Icon>
+ </AppBarToggleButton>
+
+
+
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarToggleButtonPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarToggleButtonPage.xaml.cs
index 1c79b76bc5..bca7d2710e 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarToggleButtonPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AppBarToggleButtonPage.xaml.cs
@@ -22,46 +22,37 @@ namespace AppUIBasics.ControlPages
public sealed partial class AppBarToggleButtonPage : Page
{
AppBarToggleButton compactButton = null;
+ AppBarSeparator separator = null;
public AppBarToggleButtonPage()
{
this.InitializeComponent();
Loaded += AppBarButtonPage_Loaded;
+ Unloaded += AppBarToggleButtonPage_Unloaded;
}
- protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
+ private void AppBarToggleButtonPage_Unloaded(object sender, RoutedEventArgs e)
{
- // Remove compact button from the command bar.
- base.OnNavigatingFrom(e);
- Frame rootFrame = Window.Current.Content as Frame;
- ItemPage rootPage = rootFrame.Content as ItemPage;
-
- if (rootPage != null)
- {
- CommandBar appBar = rootPage.BottomCommandBar;
- compactButton.Click -= CompactButton_Click;
- appBar.PrimaryCommands.Remove(compactButton);
- }
+ CommandBar appBar = NavigationRootPage.Current.PageHeader.TopCommandBar;
+ compactButton.Click -= CompactButton_Click;
+ appBar.PrimaryCommands.Remove(compactButton);
+ appBar.PrimaryCommands.Remove(separator);
}
void AppBarButtonPage_Loaded(object sender, RoutedEventArgs e)
{
// Add compact button to the command bar. It provides functionality specific
// to this page, and is removed when leaving the page.
- ItemPage itemPage = NavigationRootPage.RootFrame.Content as ItemPage;
- if (itemPage != null)
- {
- CommandBar appBar = itemPage.BottomCommandBar;
-
- appBar.PrimaryCommands.Insert(0, new AppBarSeparator());
+ CommandBar appBar = NavigationRootPage.Current.PageHeader.TopCommandBar;
+ separator = new AppBarSeparator();
+ appBar.PrimaryCommands.Insert(0, separator);
compactButton = new AppBarToggleButton();
compactButton.Icon = new SymbolIcon(Symbol.FontSize);
compactButton.Label = "IsCompact";
compactButton.Click += CompactButton_Click;
appBar.PrimaryCommands.Insert(0, compactButton);
- }
}
private void CompactButton_Click(object sender, RoutedEventArgs e)
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AutoSuggestBoxPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AutoSuggestBoxPage.xaml
index df62d1f49f..054b0a60d1 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AutoSuggestBoxPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/AutoSuggestBoxPage.xaml
@@ -1,20 +1,15 @@
-
-
-
+
+
-
-
+
+
@@ -24,27 +19,22 @@
-
-
+
-
-
-
-
+
+
-
-
+
+
@@ -57,29 +47,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/BorderPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/BorderPage.xaml
index edb904f011..6f301312bb 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/BorderPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/BorderPage.xaml
@@ -9,80 +9,58 @@
//
//*********************************************************
-->
-
-
-
-
-
-
-
-
+
+
+
+
+
- <Border BorderThickness=""
- BorderBrush=""
- Background="">
+ <Border BorderThickness=""
+ BorderBrush=""
+ Background="">
<TextBlock Text="Text inside a border" FontSize="18" Foreground="Black"/></Border>
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ButtonPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ButtonPage.xaml
index 24cb9fc601..41b4d49aa2 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ButtonPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ButtonPage.xaml
@@ -9,88 +9,58 @@
//
//*********************************************************
-->
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ <Button Content="Button" Click="Button_Click"/>
+
+
+
+
+
+
+
+
+
+
+
+
+ <Button Content="Button" Click="Button_Click"/>
+
+ <Image Source="/Assets/Slices.png" />
+
+ </Button>
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
- <Button Content="Button" Click="Button_Click"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
- <Button Content="Button" Click="Button_Click"/>
-
- <Image Source="/Assets/Slices.png" />
-
- </Button>
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ <Button Background="#FF42A214" Foreground="White"
+ FontFamily="Segoe Print" FontSize="22"
+ Click="Button_Click">
+
+ <Button.Resources>
+ <SolidColorBrush x:Key="ButtonBackgroundPointerOver">#FF42A214</SolidColorBrush>
+ <SolidColorBrush x:Key="ButtonBackgroundPressed">#FF359308</SolidColorBrush>
+ <SolidColorBrush x:Key="ButtonForegroundPointerOver">white</SolidColorBrush>
+ <SolidColorBrush x:Key="ButtonForegroundPressed">white</SolidColorBrush>
+ <SolidColorBrush x:Key="ButtonBorderBrushPointerOver">#FF267600</SolidColorBrush>
+ <SolidColorBrush x:Key="ButtonBorderBrushPressed">#FF267600</SolidColorBrush>
+ </Button.Resources>
+
+ <StackPanel Orientation="Horizontal">
+ <SymbolIcon Symbol="Accept" Margin="0,0,10,0"/>
+ <TextBlock Text="Custom styles"/>
+ </StackPanel>
+
+ </Button>
+
+
+
+
+
+
+
+
+
+
+
+
+ <Button Content="Button" Click="Button_Click"/>
+
+ Style="{StaticResource refreshButtonStyle}" />
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CalendarDatePickerPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CalendarDatePickerPage.xaml
new file mode 100644
index 0000000000..8bcd19c6ce
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CalendarDatePickerPage.xaml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+ <CalendarDatePicker PlaceholderText="Pick a date" Header="Calendar" />
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CalendarDatePickerPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CalendarDatePickerPage.xaml.cs
new file mode 100644
index 0000000000..fb6424c799
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CalendarDatePickerPage.xaml.cs
@@ -0,0 +1,17 @@
+using Windows.UI.Xaml.Controls;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class CalendarDatePickerPage : Page
+ {
+ public CalendarDatePickerPage()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CalendarViewPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CalendarViewPage.xaml
index 0faa2a9df5..954a588845 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CalendarViewPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CalendarViewPage.xaml
@@ -1,32 +1,28 @@
-
-
-
+
+
+ IsGroupLabelVisible="{x:Bind isGroupLabelVisible.IsChecked.Value, Mode=OneWay}"
+ IsOutOfScopeEnabled="{x:Bind isOutOfScopeEnabled.IsChecked.Value, Mode=OneWay}"
+ CalendarIdentifier="{x:Bind calendarIdentifier.SelectedValue, Mode=OneWay}" />
-
-
+
-
+ NoneSingleMultiple
-
+
@@ -34,35 +30,35 @@
- <CalendarView SelectionMode="" IsGroupLabelVisible=""
- IsOutOfScopeEnabled="" Language=""
- CalendarIdentifier="">
+ <CalendarView SelectionMode=""
+ IsGroupLabelVisible=""
+
+ IsOutOfScopeEnabled=""
+ Language=""
+
+ CalendarIdentifier="">
+
-
-
-
+
-
+
-
-
-
-
+
-
-
+
+
-
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CanvasPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CanvasPage.xaml
index fd8cd3986f..f7c0727ff3 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CanvasPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CanvasPage.xaml
@@ -9,38 +9,42 @@
//
//*********************************************************
-->
-
-
-
-
+
+
+
+
+
+
+
+
+
+ <Canvas Width="120" Height="120" Background="Gray">
- <Rectangle Fill="Red" Canvas.Left=""
- Canvas.Top=""
- Canvas.ZIndex="">
+ <Rectangle Fill="Red" Canvas.Left=""
+ Canvas.Top=""
+ Canvas.ZIndex="">
<Rectangle Fill="Blue" Canvas.Left="20" Canvas.Top="20" Canvas.ZIndex="1"/><Rectangle Fill="Green" Canvas.Left="40" Canvas.Top="40" Canvas.ZIndex="2"/>
@@ -49,39 +53,24 @@
-
-
-
-
-
-
-
-
-
+
-
-
+
-
+
-
-
-
-
+
-
-
+
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CheckBoxPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CheckBoxPage.xaml
index e610c0a039..cb1d34da65 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CheckBoxPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CheckBoxPage.xaml
@@ -9,22 +9,17 @@
//
//*********************************************************
-->
-
-
-
-
+
+
+
-
-
+
+
@@ -33,13 +28,12 @@
-
-
+
-
-
+
+
@@ -48,15 +42,18 @@
-
-
+
-
-
-
-
+
+
+
+
@@ -71,34 +68,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ColorPickerPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ColorPickerPage.xaml
new file mode 100644
index 0000000000..ff12eb27ac
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ColorPickerPage.xaml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <controls:ColorPicker
+ IsColorSliderVisible=""
+
+ IsColorChannelTextInputVisible=""
+
+ IsHexInputVisible=""
+
+ IsAlphaEnabled=""
+
+ IsAlphaSliderVisible=""
+
+ IsAlphaTextInputVisible="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ColorPickerPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ColorPickerPage.xaml.cs
new file mode 100644
index 0000000000..4ec560c442
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ColorPickerPage.xaml.cs
@@ -0,0 +1,18 @@
+using System.Linq;
+using Windows.UI.Xaml.Controls;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class ColorPickerPage : Page
+ {
+ public ColorPickerPage()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ComboBoxPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ComboBoxPage.xaml
index a1eac02c3d..eab11121bd 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ComboBoxPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ComboBoxPage.xaml
@@ -9,27 +9,22 @@
//
//*********************************************************
-->
-
-
-
-
+
+
+
-
+ BlueGreenRedYellow
-
+
@@ -43,13 +38,14 @@
-
-
+
-
-
+
+
@@ -59,29 +55,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CommandBarPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CommandBarPage.xaml
index 9cb5f147b5..cc646fd8ee 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CommandBarPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CommandBarPage.xaml
@@ -18,29 +18,36 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
+
+
-
+
@@ -51,7 +58,7 @@
- <CommandBar Background="Transparent" IsOpen="False">
+ <CommandBar Background="Transparent" IsOpen="False" DefaultLabelPosition="Right"><AppBarButton Icon="Add" Label="Add"/><AppBarButton Icon="ReShare" Label="Share"/><AppBarButton Icon="Edit" Label="Edit"/>
@@ -63,5 +70,24 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CommandBarPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CommandBarPage.xaml.cs
index 37097b8b02..52e54d1ab7 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CommandBarPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/CommandBarPage.xaml.cs
@@ -27,63 +27,44 @@ public CommandBarPage()
private void OpenButton_Click(object sender, RoutedEventArgs e)
{
- ItemPage itemPage = NavigationRootPage.RootFrame.Content as ItemPage;
-
- if (itemPage != null)
- {
- CommandBar appBar = itemPage.BottomCommandBar;
-
- appBar.IsOpen = true;
- appBar.IsSticky = true;
- }
+ PrimaryCommandBar.IsOpen = true;
+ PrimaryCommandBar.IsSticky = true;
}
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
- ItemPage itemPage = NavigationRootPage.RootFrame.Content as ItemPage;
-
- if (itemPage != null)
- {
- CommandBar commandBar = itemPage.BottomCommandBar;
-
- commandBar.IsOpen = false;
- }
+ PrimaryCommandBar.IsOpen = false;
+ PrimaryCommandBar.IsSticky = false;
}
private void AddSecondaryCommands_Click(object sender, RoutedEventArgs e)
{
// Add compact button to the command bar. It provides functionality specific
// to this page, and is removed when leaving the page.
- ItemPage itemPage = NavigationRootPage.RootFrame.Content as ItemPage;
- if (itemPage != null)
+ if (PrimaryCommandBar.SecondaryCommands.Count == 1)
{
- CommandBar commandBar = itemPage.BottomCommandBar;
-
- if (commandBar.SecondaryCommands.Count == 1)
- {
- var newButton = new AppBarButton();
- newButton.Icon = new SymbolIcon(Symbol.Add);
- newButton.Label = "Button 1";
- commandBar.SecondaryCommands.Add(newButton);
-
- newButton = new AppBarButton();
- newButton.Icon = new SymbolIcon(Symbol.Delete);
- newButton.Label = "Button 2";
- commandBar.SecondaryCommands.Add(newButton);
-
- commandBar.SecondaryCommands.Add(new AppBarSeparator());
-
- newButton = new AppBarButton();
- newButton.Icon = new SymbolIcon(Symbol.FontDecrease);
- newButton.Label = "Button 3";
- commandBar.SecondaryCommands.Add(newButton);
-
- newButton = new AppBarButton();
- newButton.Icon = new SymbolIcon(Symbol.FontIncrease);
- newButton.Label = "Button 4";
- commandBar.SecondaryCommands.Add(newButton);
- }
+ var newButton = new AppBarButton();
+ newButton.Icon = new SymbolIcon(Symbol.Add);
+ newButton.Label = "Button 1";
+ PrimaryCommandBar.SecondaryCommands.Add(newButton);
+
+ newButton = new AppBarButton();
+ newButton.Icon = new SymbolIcon(Symbol.Delete);
+ newButton.Label = "Button 2";
+ PrimaryCommandBar.SecondaryCommands.Add(newButton);
+
+ PrimaryCommandBar.SecondaryCommands.Add(new AppBarSeparator());
+
+ newButton = new AppBarButton();
+ newButton.Icon = new SymbolIcon(Symbol.FontDecrease);
+ newButton.Label = "Button 3";
+ PrimaryCommandBar.SecondaryCommands.Add(newButton);
+
+ newButton = new AppBarButton();
+ newButton.Icon = new SymbolIcon(Symbol.FontIncrease);
+ newButton.Label = "Button 4";
+ PrimaryCommandBar.SecondaryCommands.Add(newButton);
}
}
@@ -100,16 +81,9 @@ protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
private void RemoveSecondaryCommands()
{
- ItemPage itemPage = NavigationRootPage.RootFrame.Content as ItemPage;
-
- if (itemPage != null)
+ while (PrimaryCommandBar.SecondaryCommands.Count > 1)
{
- CommandBar commandBar = itemPage.BottomCommandBar;
-
- while (commandBar.SecondaryCommands.Count > 1)
- {
- commandBar.SecondaryCommands.RemoveAt(commandBar.SecondaryCommands.Count - 1);
- }
+ PrimaryCommandBar.SecondaryCommands.RemoveAt(PrimaryCommandBar.SecondaryCommands.Count - 1);
}
}
}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogExample.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogExample.xaml
index 1bcba515fc..0e0bbaf9b2 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogExample.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogExample.xaml
@@ -2,24 +2,17 @@
x:Class="AppUIBasics.ControlPages.ContentDialogExample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="using:AppUIBasics.ControlPages"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d"
- Title="SIGN IN"
- PrimaryButtonText="sign in"
- SecondaryButtonText="cancel"
- PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
- SecondaryButtonClick="ContentDialog_SecondaryButtonClick">
+ Title="Save your work?"
+ PrimaryButtonText="Save"
+ SecondaryButtonText="Don't Save"
+ CloseButtonText="Cancel"
+ DefaultButton="Primary"
+ >
-
-
-
-
-
-
-
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogExample.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogExample.xaml.cs
index 14bcf5b747..760493becb 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogExample.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogExample.xaml.cs
@@ -17,63 +17,14 @@
namespace AppUIBasics.ControlPages
{
- public enum SignInResult
- {
- SignInOK,
- SignInFail,
- SignInCancel,
- Nothing
- }
-
///
/// An empty page that can be used on its own or navigated to within a Frame.
///
public sealed partial class ContentDialogExample : ContentDialog
{
- public SignInResult Result { get; private set; }
-
public ContentDialogExample()
{
this.InitializeComponent();
-
- this.Result = SignInResult.Nothing;
- }
-
- private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
- {
- // Ensure the user name and password fields aren't empty. If a required field
- // is empty, set args.Cancel = true to keep the dialog open.
- if (string.IsNullOrEmpty(userNameTextBox.Text))
- {
- args.Cancel = true;
- errorTextBlock.Text = "User name is required.";
- }
- else if (string.IsNullOrEmpty(passwordTextBox.Password))
- {
- args.Cancel = true;
- errorTextBlock.Text = "Password is required.";
- }
-
- // If you're performing async operations in the button click handler,
- // get a deferral before you await the operation. Then, complete the
- // deferral when the async operation is complete.
-
- ContentDialogButtonClickDeferral deferral = args.GetDeferral();
- //if (await SomeAsyncSignInOperation())
- //{
- this.Result = SignInResult.SignInOK;
- //}
- //else
- //{
- // this.Result = SignInResult.SignInFail;
- //}
- deferral.Complete();
- }
-
- private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
- {
- // User clicked Cancel.
- this.Result = SignInResult.SignInCancel;
}
}
}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogPage.xaml
index f2a6a828f9..bb51f29b82 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogPage.xaml
@@ -17,27 +17,24 @@
<ContentDialog
- x:Class="AppUIBasics.ControlPages.ContentDialogExample"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="using:AppUIBasics.ControlPages"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d"
- Title="SIGN IN"
- PrimaryButtonText="sign in"
- SecondaryButtonText="cancel"
- PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
- SecondaryButtonClick="ContentDialog_SecondaryButtonClick">
+ x:Class="AppUIBasics.ControlPages.ContentDialogExample"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+
+ Title="Save your work?"
+ PrimaryButtonText="Save"
+ SecondaryButtonText="Don't Save"
+ CloseButtonText="Cancel"
+ DefaultButton="Primary">
+ <StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
- <TextBox Name="userNameTextBox" Header="User name"/>
- <PasswordBox Name="passwordTextBox" Header="Password" IsPasswordRevealButtonEnabled="True"/>
- <CheckBox Name="saveUserNameCheckBox" Content="Save user name"/>
- <TextBlock x:Name="errorTextBlock" />
- <TextBlock Text="Lorem ipsum dolor sit amet, consectetur adipisicing elit." TextWrapping="Wrap" />
+ <CheckBox Content="Upload your content to the cloud."/>
+ <TextBlock Text="Lorem ipsum dolor sit amet, adipisicing elit."
+ TextWrapping="Wrap" /></StackPanel>
+ </ContentDialog>
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogPage.xaml.cs
index bdddebae64..cf22c125f7 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ContentDialogPage.xaml.cs
@@ -30,19 +30,19 @@ public ContentDialogPage()
private async void ShowDialog_Click(object sender, RoutedEventArgs e)
{
ContentDialogExample dialog = new ContentDialogExample();
- await dialog.ShowAsync();
+ var result = await dialog.ShowAsync();
- if(dialog.Result == SignInResult.SignInOK)
+ if (result == ContentDialogResult.Primary)
{
- DialogResult.Text = "Dialog result successful.";
+ DialogResult.Text = "User saved their work";
}
- else if(dialog.Result == SignInResult.SignInCancel)
+ else if (result == ContentDialogResult.Secondary)
{
- DialogResult.Text = "Dialog result canceled.";
+ DialogResult.Text = "User did not save their work";
}
- else if(dialog.Result == SignInResult.Nothing)
+ else
{
- DialogResult.Text = "Dialog dismissed.";
+ DialogResult.Text = "User cancelled the dialog";
}
}
}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/DatePickerPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/DatePickerPage.xaml
index ca3aa9822b..9e4f5f5b9c 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/DatePickerPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/DatePickerPage.xaml
@@ -9,17 +9,13 @@
//
//*********************************************************
-->
-
-
-
-
+
+
+
@@ -29,45 +25,21 @@
-
-
+
-
-
+
+
-
- <DatePicker
+
+ <DatePicker
DayFormat="{}{day.integer} ({dayofweek.abbreviated})" YearVisible="False" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlipViewPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlipViewPage.xaml
index 0cf1fc4cc2..318bb8b899 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlipViewPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlipViewPage.xaml
@@ -9,18 +9,14 @@
//
//*********************************************************
-->
-
-
-
-
+
+
+
@@ -42,28 +38,34 @@
-
-
+
+ ItemsSource="{x:Bind Items, Mode=OneWay}">
-
+
-
-
-
+
+
+
+
+
+
+
-
+
- <FlipView MaxWidth="400" Height="180" BorderBrush="Black" BorderThickness="1" ItemsSource="{x:Bind Groups, Mode=OneWay}">
+ <FlipView MaxWidth="400" Height="180" BorderBrush="Black" BorderThickness="1" ItemsSource="{x:Bind Items, Mode=OneWay}"><FlipView.ItemTemplate>
- <DataTemplate x:DataType="data:ControlInfoDataGroup"">
+ <DataTemplate x:DataType="data:ControlInfoDataItem""><Grid><Image Height="120" Source="{x:Bind ImagePath}" Stretch="Uniform" VerticalAlignment="Top"/><Border Background="#A5FFFFFF" Height="60" VerticalAlignment="Bottom">
@@ -76,29 +78,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlipViewPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlipViewPage.xaml.cs
index 564e74b16f..5c55332470 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlipViewPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlipViewPage.xaml.cs
@@ -10,8 +10,9 @@
using AppUIBasics.Common;
using AppUIBasics.Data;
using System.Collections.Generic;
-using Windows.UI.Xaml.Navigation;
+using System.Linq;
using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
@@ -22,22 +23,30 @@ namespace AppUIBasics.ControlPages
///
public sealed partial class FlipViewPage : Page
{
- private IEnumerable _groups;
+ private List _items;
public FlipViewPage()
{
this.InitializeComponent();
}
- public IEnumerable Groups
+ public List Items
{
- get { return this._groups; }
+ get { return this._items; }
}
-
+
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
- _groups = await ControlInfoDataSource.GetGroupsAsync();
+ var groups = NavigationRootPage.Current.Groups.Any() ? NavigationRootPage.Current.Groups : await ControlInfoDataSource.GetGroupsAsync();
+ _items = new List();
+ foreach (var group in groups.Take(3))
+ {
+ foreach (var item in group.Items)
+ {
+ _items.Add(item);
+ }
+ }
}
}
}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlyoutPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlyoutPage.xaml
index 236cf45cc5..a80d3d30cf 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlyoutPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/FlyoutPage.xaml
@@ -9,31 +9,26 @@
//
//*********************************************************
-->
-
-
+
-
+
-
-
-
+
+
-
+
@@ -55,16 +50,14 @@
-
-
+
-
+
-
-
+
@@ -74,17 +67,17 @@
<TextBox x:Name="MyTextBox" Text="You can edit this text by tapping it."/></Flyout></FlyoutBase.AttachedFlyout>
- </TextBlock>
+ </TextBlock>
-
-
+
-
+
+ Text="Tap to show Flyout" FlyoutBase.AttachedFlyout="{StaticResource SharedFlyout}" />
@@ -100,31 +93,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridPage.xaml
index c1060402c8..f58c9ab8fb 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridPage.xaml
@@ -9,44 +9,39 @@
//
//*********************************************************
-->
-
+
-
+
-
-
-
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
@@ -61,7 +56,10 @@
<RowDefinition Height="Auto"/><RowDefinition/></Grid.RowDefinitions>
- <Rectangle Fill="Red" Grid.Column="" Grid.Row="">
+ <Rectangle Fill="Red" Grid.Column=""
+ Grid.Row="">
<Rectangle Fill="Blue" Grid.Row="1"/><Rectangle Fill="Green" Grid.Column="1"/>
@@ -70,38 +68,14 @@
-
-
+
+ Orientation="Vertical" IsDirectionReversed="True" TickFrequency="1" SnapsTo="Ticks" />
+ Margin="10,0,30,0" TickFrequency="1" SnapsTo="Ticks" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridViewPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridViewPage.xaml
index 91884983bb..1846498521 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridViewPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridViewPage.xaml
@@ -9,83 +9,82 @@
//
//*********************************************************
-->
-
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
-
+
-
+
-
-
-
-
-
+
+
+
+
-
-
+
+
-
+
-
-
+
-
+
-
-
-
+
+ ItemTemplate="{StaticResource ImageOverlayTemplate}"
+ CanDragItems="{x:Bind DragCheckBox.IsChecked.Value, Mode=OneWay}"
+ IsItemClickEnabled="{x:Bind ItemClickCheckBox.IsChecked.Value, Mode=OneWay}"
+ IsSwipeEnabled="{x:Bind SwipeCheckBox.IsChecked.Value, Mode=OneWay}"
+ SelectionChanged="Control1_SelectionChanged" ItemClick="Control1_ItemClick" />
-
-
+
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
-
+ NoneSingleMultiple
@@ -95,55 +94,43 @@
- <GridView ItemsSource="{x:Bind Groups}"
- ItemTemplate="{StaticResource
- ImageOverlayTemplate }"
+ <GridView ItemsSource="{x:Bind Items}"
+ ItemTemplate="{StaticResource ImageOverlayTemplate}"
- IsItemClickEnabled="
- "
+ IsItemClickEnabled=""
+ IsSwipeEnabled=""
- IsSwipeEnabled="
- "
+ CanDragItems=""
- CanDragItems="
- "
-
- SelectionMode="
- "
+ SelectionMode=""
SelectionChanged="Control1_SelectionChanged"ItemClick="Control1_ItemClick" />
-
-
+
-
-
-
+
-
+
-
-
-
-
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridViewPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridViewPage.xaml.cs
index bb5e0df507..7725f0d8d9 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridViewPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/GridViewPage.xaml.cs
@@ -10,6 +10,7 @@
using AppUIBasics.Common;
using AppUIBasics.Data;
using System.Collections.Generic;
+using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
@@ -23,22 +24,30 @@ namespace AppUIBasics.ControlPages
///
public sealed partial class GridViewPage : Page
{
- private IEnumerable _groups;
+ private List _items;
public GridViewPage()
{
this.InitializeComponent();
}
- public IEnumerable Groups
+ public List Groups
{
- get { return this._groups; }
+ get { return this._items; }
}
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
- _groups = await ControlInfoDataSource.GetGroupsAsync();
+ var groups = NavigationRootPage.Current.Groups.Any() ? NavigationRootPage.Current.Groups : await ControlInfoDataSource.GetGroupsAsync();
+ _items = new List();
+ foreach (var group in groups.Take(3))
+ {
+ foreach (var item in group.Items)
+ {
+ _items.Add(item);
+ }
+ }
}
private void ItemTemplate_Click(object sender, RoutedEventArgs e)
@@ -53,8 +62,8 @@ private void Control1_SelectionChanged(object sender, SelectionChangedEventArgs
GridView gridView = sender as GridView;
if (gridView != null)
{
- SelectionOutput.Text = string.Format("You have selected {0} item(s).", gridView.SelectedItems.Count);
- }
+ SelectionOutput.Text = string.Format("You have selected {0} item(s).", gridView.SelectedItems.Count);
+ }
}
private void Control1_ItemClick(object sender, ItemClickEventArgs e)
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/HubPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/HubPage.xaml
index c8b7f6a901..c32e5eeb97 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/HubPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/HubPage.xaml
@@ -22,11 +22,11 @@
-
-
+
+
-
@@ -48,7 +48,7 @@
-
@@ -59,7 +59,7 @@
-
@@ -70,7 +70,7 @@
-
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/HyperlinkButtonPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/HyperlinkButtonPage.xaml
index 0a128a3e6e..57141be2c6 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/HyperlinkButtonPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/HyperlinkButtonPage.xaml
@@ -49,7 +49,7 @@
-
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ImagePage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ImagePage.xaml
index 3d00e0c0af..6db8c7d75b 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ImagePage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ImagePage.xaml
@@ -1,112 +1,89 @@
-
-
-
-
-
-
-
-
-
-
- <Image Source="/Assets/treetops.jpg" Height="100" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- None
-
- <Image Height="100">
- <Image.Source>
- <BitmapImage UriSource="/Assets/treetops.jpg"
- DecodePixelHeight="100" />
- </Image.Source>
- </Image>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <Image Stretch="None" Height="100" Width="100" Source="/Assets/valley.jpg" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <Image Source="/Assets/ninegrid.gif" Height="82" />
- <Image Source="/Assets/ninegrid.gif" NineGrid="3,3,3,3" Height="164" />
- <Image Source="/Assets/ninegrid.gif" NineGrid="30,20,30,20" Height="164" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ <Image Source="/Assets/treetops.jpg" Height="100" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ None
+
+
+ <Image Height="100">
+ <Image.Source>
+ <BitmapImage UriSource="/Assets/treetops.jpg"
+ DecodePixelHeight="100" />
+ </Image.Source>
+ </Image>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Image Stretch="None" Height="100" Width="100" Source="/Assets/valley.jpg" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Image Source="/Assets/ninegrid.gif" Height="82" />
+ <Image Source="/Assets/ninegrid.gif" NineGrid="3,3,3,3" Height="164" />
+ <Image Source="/Assets/ninegrid.gif" NineGrid="30,20,30,20" Height="164" />
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/InkCanvasPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/InkCanvasPage.xaml
index d37b4c2894..350c99c633 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/InkCanvasPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/InkCanvasPage.xaml
@@ -1,31 +1,28 @@
-
-
-
-
-
+
+
+
+
-
+ SelectionChanged="penColor_SelectionChanged">
BlackRedBlueGreen
-
-
-
+
+
+
@@ -34,29 +31,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListBoxPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListBoxPage.xaml
index 304b2efbcf..863c9b77c5 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListBoxPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListBoxPage.xaml
@@ -9,47 +9,42 @@
//
//*********************************************************
-->
-
-
-
-
-
-
-
-
- Blue
- Green
- Red
- Yellow
-
-
-
-
-
-
- <ListBox SelectionChanged="ColorListBox_SelectionChanged" Width="200">
- <x:String>Blue<x:String>
- <x:String>Green<x:String>
- <x:String>Red<x:String>
- <x:String>Yellow<x:String>
- </ListBox>
-
-
-
-
-
+
+
+
-
-
+
+ Blue
+ Green
+ Red
+ Yellow
+
+
+
+
+
+
+ <ListBox SelectionChanged="ColorListBox_SelectionChanged" Width="200">
+ <x:String>Blue<x:String>
+ <x:String>Green<x:String>
+ <x:String>Red<x:String>
+ <x:String>Yellow<x:String>
+ </ListBox>
+
+
+
+
+
+
+
+
@@ -58,29 +53,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListViewPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListViewPage.xaml
index 89269deed0..e00f189a5d 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListViewPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListViewPage.xaml
@@ -9,96 +9,109 @@
//
//*********************************************************
-->
-
+
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
-
+
-
-
-
-
-
+
+
+
+
-
+
-
-
-
-
+
+
+
-
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
+
+
-
+ NoneSingleMultiple
@@ -127,35 +140,10 @@
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListViewPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListViewPage.xaml.cs
index f71d26fa0c..530cd71107 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListViewPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ListViewPage.xaml.cs
@@ -10,6 +10,7 @@
using AppUIBasics.Common;
using AppUIBasics.Data;
using System.Collections.Generic;
+using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;
@@ -23,22 +24,30 @@ namespace AppUIBasics.ControlPages
///
public sealed partial class ListViewPage : Page
{
- private IEnumerable _groups;
+ private List _items;
public ListViewPage()
{
this.InitializeComponent();
}
- public IEnumerable Groups
+ public List Items
{
- get { return this._groups; }
+ get { return this._items; }
}
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
- _groups = await ControlInfoDataSource.GetGroupsAsync();
+ var groups = NavigationRootPage.Current.Groups.Any() ? NavigationRootPage.Current.Groups : await ControlInfoDataSource.GetGroupsAsync();
+ _items = new List();
+ foreach (var group in groups.Take(3))
+ {
+ foreach (var item in group.Items)
+ {
+ _items.Add(item);
+ }
+ }
}
private void ItemTemplate_Click(object sender, RoutedEventArgs e)
@@ -54,7 +63,7 @@ private void Control1_SelectionChanged(object sender, SelectionChangedEventArgs
if (listView != null)
{
SelectionOutput.Text = string.Format("You have selected {0} item(s).", listView.SelectedItems.Count);
- }
+ }
}
private void Control1_ItemClick(object sender, ItemClickEventArgs e)
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MediaElementPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MediaElementPage.xaml
index 231091f588..8031b6d928 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MediaElementPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MediaElementPage.xaml
@@ -1,19 +1,13 @@
-
-
-
+
+
-
+
@@ -24,12 +18,9 @@
-
-
+
@@ -39,29 +30,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MediaPlayerElementPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MediaPlayerElementPage.xaml
new file mode 100644
index 0000000000..bd78643a95
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MediaPlayerElementPage.xaml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+ <MediaPlayerElement Source="/Assets/ladybug.wmv"
+ MaxWidth="400"
+ AutoPlay="False"
+ AreTransportControlsEnabled="True" />
+
+
+
+
+
+
+
+
+
+ <MediaPlayerElement Source="Assets/fishes.wmv"
+ MaxWidth="400"
+ AutoPlay="True" />
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MediaPlayerElementPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MediaPlayerElementPage.xaml.cs
new file mode 100644
index 0000000000..5e5e828085
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MediaPlayerElementPage.xaml.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class MediaPlayerElementPage : Page
+ {
+ public MediaPlayerElementPage()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MenuFlyoutPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MenuFlyoutPage.xaml
index 8d69dc1ec0..15f8a72984 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MenuFlyoutPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/MenuFlyoutPage.xaml
@@ -9,78 +9,71 @@
//
//*********************************************************
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <AppBarButton Icon="Sort" IsCompact="True">
- <AppBarButton.Flyout>
- <MenuFlyout>
- <MenuFlyoutItem Text="By rating" Click="MenuFlyoutItem_Click" Tag="rating">
- <MenuFlyoutItem Text="By match" Click="MenuFlyoutItem_Click" Tag="match">
- <MenuFlyoutItem Text="By distance" Click="MenuFlyoutItem_Click" Tag="distance>
- </MenuFlyout>
- </AppBarButton.Flyout>
- </AppBarButton>
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
-
-
-
- <Button Content="Options">
- <Button.Flyout>
- <MenuFlyout>
- <MenuFlyoutItem Text="Reset"/>
- <MenuFlyoutSeparator/>
- <MenuFlyoutItem Text="Repeat"/>
- <MenuFlyoutItem Text="Shuffle"/>
- </MenuFlyout>
- </Button.Flyout>
- </Button>
-
-
-
-
-
+
+
+
+
+
+ <AppBarButton Icon="Sort" IsCompact="True">
+ <AppBarButton.Flyout>
+ <MenuFlyout>
+ <MenuFlyoutItem Text="By rating" Click="MenuFlyoutItem_Click" Tag="rating">
+ <MenuFlyoutItem Text="By match" Click="MenuFlyoutItem_Click" Tag="match">
+ <MenuFlyoutItem Text="By distance" Click="MenuFlyoutItem_Click" Tag="distance>
+ </MenuFlyout>
+ </AppBarButton.Flyout>
+ </AppBarButton>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Button Content="Options">
+ <Button.Flyout>
+ <MenuFlyout>
+ <MenuFlyoutItem Text="Reset"/>
+ <MenuFlyoutSeparator/>
+ <ToggleMenuFlyoutItem Text="Repeat"/>
+ <ToggleMenuFlyoutItem Text="Shuffle"/>
+ </MenuFlyout>
+ </Button.Flyout>
+ </Button>
+
+
+
-
+
@@ -111,34 +104,47 @@
</MenuFlyout></Button.Flyout></Button>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Button Content="Edit Options">
+ <Button.Flyout>
+ <MenuFlyout>
+ <MenuFlyoutItem Text="Share">
+ <MenuFlyoutItem.Icon>
+ <FontIcon Glyph=""/>
+ </MenuFlyoutItem.Icon>
+ </MenuFlyoutItem>
+ <MenuFlyoutItem Text="Copy"/>
+ <MenuFlyoutItem Text="Delete"/>
+ <MenuFlyoutSeparator/>
+ <MenuFlyoutItem Text="Rename"/>
+ <MenuFlyoutItem Text="Select"/>
+ </MenuFlyout>
+ </Button.Flyout>
+ </Button>
+
+
+
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/NavigationViewPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/NavigationViewPage.xaml
new file mode 100644
index 0000000000..af4263ee47
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/NavigationViewPage.xaml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <controls:NavigationView IsSettingsVisible=""
+ Header="This is header text.">
+
+ <controls:NavigationView.MenuItems>
+ <controls:NavigationMenuItem Icon="Play" Text="Menu Item1" />
+ <controls:NavigationMenuItemSeparator/>
+ <controls:NavigationMenuItem Icon="Save" Text="Menu Item2" />
+ <controls:NavigationMenuItem Icon="Refresh" Text="Menu Item3" />
+ </controls:NavigationView.MenuItems>
+ <Frame x:Name="contentFrame" />
+ </controls:NavigationView>
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/NavigationViewPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/NavigationViewPage.xaml.cs
new file mode 100644
index 0000000000..37ec8406ed
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/NavigationViewPage.xaml.cs
@@ -0,0 +1,62 @@
+using AppUIBasics.SamplePages;
+using Windows.Foundation;
+using Windows.UI.Xaml.Controls;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class NavigationViewPage : Page
+ {
+ public NavigationViewPage()
+ {
+ this.InitializeComponent();
+
+ AddMenuItem(Symbol.Play, "Menu Item1", NavigationMenuItem_Invoked);
+ AddMenuItem(Symbol.Save, "Menu Item2", NavigationMenuItem_Invoked_1);
+ AddMenuItem(Symbol.Refresh, "Menu Item3", NavigationMenuItem_Invoked_2);
+ }
+
+ private void AddMenuItem(Symbol icon, string text, TypedEventHandler handler)
+ {
+ var item = new NavigationMenuItem() {
+ Icon = new SymbolIcon(icon),
+ Text = text };
+ item.Invoked += handler;
+ nvSample.MenuItems.Add(item);
+ }
+
+ private void NavigationMenuItem_Invoked(Windows.UI.Xaml.Controls.NavigationMenuItem sender, object args)
+ {
+ contentFrame.Navigate(typeof(SamplePage1));
+ }
+
+ private void NavigationMenuItem_Invoked_1(Windows.UI.Xaml.Controls.NavigationMenuItem sender, object args)
+ {
+ contentFrame.Navigate(typeof(SamplePage2));
+ }
+
+ private void NavigationMenuItem_Invoked_2(Windows.UI.Xaml.Controls.NavigationMenuItem sender, object args)
+ {
+ contentFrame.Navigate(typeof(SamplePage3));
+ }
+
+ private void NavigationView_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
+ {
+ contentFrame.Navigate(typeof(SamplePage1));
+ }
+
+ private void rootGrid_SizeChanged(object sender, Windows.UI.Xaml.SizeChangedEventArgs e)
+ {
+ Example1.Width = e.NewSize.Width;
+ }
+
+ private void NavigationView_SettingsInvoked(Windows.UI.Xaml.Controls.NavigationView sender, object args)
+ {
+ contentFrame.Navigate(typeof(SampleSettingsPage));
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ParallaxViewPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ParallaxViewPage.xaml
new file mode 100644
index 0000000000..1985029186
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ParallaxViewPage.xaml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Grid>
+ <controls:ParallaxView Source="{Binding ElementName=listView}" VerticalShift="500">
+ <Image Source="ms-appx:///Assets/cliff.jpg" />
+ </controls:ParallaxView>
+ <ListView x:Name="listView" ItemsSource="{x:Bind Items}">
+ <ListView.Header>
+ <Grid>
+ <controls:ParallaxView Source="{x:Bind listView}" VerticalShift="100"
+ VerticalSourceOffsetKind="Absolute" VerticalSourceStartOffset="-50"
+ VerticalSourceEndOffset="250">
+ <Image Source="ms-appx:///Assets/cliff.jpg" />
+ </controls:ParallaxView>
+ <TextBlock Text="Scroll the list to see parallaxing of images" />
+ </Grid>
+ </ListView.Header>
+ </ListView>
+ </Grid>
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ParallaxViewPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ParallaxViewPage.xaml.cs
new file mode 100644
index 0000000000..53c805ba76
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ParallaxViewPage.xaml.cs
@@ -0,0 +1,64 @@
+using AppUIBasics.Data;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class ParallaxViewPage : Page, INotifyPropertyChanged
+ {
+ private List _items;
+
+ public ParallaxViewPage()
+ {
+ this.InitializeComponent();
+ }
+
+ public List Items
+ {
+ get { return _items; }
+ set { SetProperty(ref _items, value); }
+ }
+
+ protected async override void OnNavigatedTo(NavigationEventArgs e)
+ {
+ base.OnNavigatedTo(e);
+
+ IEnumerable groups = await ControlInfoDataSource.GetGroupsAsync();
+ List items = new List();
+ foreach (ControlInfoDataGroup group in groups)
+ {
+ foreach (ControlInfoDataItem item in group.Items)
+ {
+ items.Add(item);
+ }
+ }
+ Items = items.OrderBy(item => item.Title).ToList();
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ private bool SetProperty(ref T storage, T value, [CallerMemberName] String propertyName = null)
+ {
+ if (Equals(storage, value)) return false;
+
+ storage = value;
+ this.OnPropertyChanged(propertyName);
+ return true;
+ }
+
+ private void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PersonPicturePage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PersonPicturePage.xaml
new file mode 100644
index 0000000000..79c1a6567e
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PersonPicturePage.xaml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <PersonPicture ProfilePicture="ms-appx:///Assets/grapes.jpg" />
+
+
+ <PersonPicture DisplayName="John Doe" />
+
+
+ <PersonPicture Initials="SB" />
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PersonPicturePage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PersonPicturePage.xaml.cs
new file mode 100644
index 0000000000..e9c756ad4f
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PersonPicturePage.xaml.cs
@@ -0,0 +1,17 @@
+using Windows.UI.Xaml.Controls;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class PersonPicturePage : Page
+ {
+ public PersonPicturePage()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PivotPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PivotPage.xaml
index 5598384501..251731140c 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PivotPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PivotPage.xaml
@@ -6,39 +6,40 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <Pivot Title="EMAIL">
- <PivotItem Header="All">
- <TextBlock Text="all emails go here." />
- </PivotItem>
- <PivotItem Header="Unread">
- <TextBlock Text="unread emails go here." />
- </PivotItem>
- <PivotItem Header="Flagged">
- <TextBlock Text="flagged emails go here." />
- </PivotItem>
- <PivotItem Header="Urgent">
- <TextBlock Text="urgent emails go here." />
- </PivotItem>
- </Pivot>
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Pivot Title="EMAIL">
+ <PivotItem Header="All">
+ <TextBlock Text="all emails go here." />
+ </PivotItem>
+ <PivotItem Header="Unread">
+ <TextBlock Text="unread emails go here." />
+ </PivotItem>
+ <PivotItem Header="Flagged">
+ <TextBlock Text="flagged emails go here." />
+ </PivotItem>
+ <PivotItem Header="Urgent">
+ <TextBlock Text="urgent emails go here." />
+ </PivotItem>
+ </Pivot>
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ProgressBarPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ProgressBarPage.xaml
index daaa6d9e99..38572d6be4 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ProgressBarPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ProgressBarPage.xaml
@@ -9,42 +9,38 @@
//
//*********************************************************
-->
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
- <ProgressBar Width="130" IsIndeterminate="True" ShowPaused=""
+ <ProgressBar Width="130" IsIndeterminate="True"
+ ShowPaused=""
ShowError="" />
-
-
+
-
-
-
+
+
+
@@ -53,5 +49,24 @@
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ProgressRingPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ProgressRingPage.xaml
index 9e5676b942..186ca239b1 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ProgressRingPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ProgressRingPage.xaml
@@ -17,18 +17,20 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
-
-
-
-
-
+
+
+
+
+
+
+
+
+ <ProgressRing IsActive="" />
+
+
+
+
-
-
-
- <ProgressRing IsActive="" />
-
-
-
-
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PullToRefreshPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PullToRefreshPage.xaml
new file mode 100644
index 0000000000..f59e73d96b
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PullToRefreshPage.xaml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PullToRefreshPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PullToRefreshPage.xaml.cs
new file mode 100644
index 0000000000..c8e059b8fe
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/PullToRefreshPage.xaml.cs
@@ -0,0 +1,64 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// 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 Microsoft.UI.Preview;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class PullToRefreshPage : Page
+ {
+#if false
+ private ObservableCollection items = new ObservableCollection();
+
+ public PullToRefreshPage()
+ {
+ this.InitializeComponent();
+ foreach (var c in @"AcrylicBrush ColorPicker NavigationView ParallaxView PersonPicture PullToRefresh RatingsControl RevealBrush TreeView".Split(' '))
+ items.Add(c);
+ lv.ItemsSource = items;
+ }
+
+ private void Rc_Loaded(object sender, RoutedEventArgs e)
+ {
+ rc.RefreshVisualizer.RefreshRequested += RefreshVisualizer_RefreshRequested;
+ }
+
+ private void RefreshVisualizer_RefreshRequested(Windows.UI.Xaml.Controls.RefreshVisualizer sender, Windows.UI.Xaml.Controls.RefreshRequestedEventArgs args)
+ {
+ items.Insert(0, "NewControl");
+ args.GetDeferral().Complete();
+ }
+#else
+ public PullToRefreshPage()
+ {
+ this.InitializeComponent();
+ }
+#endif
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RadioButtonPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RadioButtonPage.xaml
index cde7228b99..e302e15369 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RadioButtonPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RadioButtonPage.xaml
@@ -9,30 +9,28 @@
//
//*********************************************************
-->
-
-
+
-
+
-
-
+
+
-
-
-
-
+
+
+
+
-
+
@@ -45,28 +43,41 @@
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RatingsControlPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RatingsControlPage.xaml
new file mode 100644
index 0000000000..d2ba98579c
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RatingsControlPage.xaml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <controls:RatingsControl IsClearEnabled=""
+ IsReadOnly=" " />
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <controls:RatingsControl PlaceholderValue="" />
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RatingsControlPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RatingsControlPage.xaml.cs
new file mode 100644
index 0000000000..f31725a19b
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RatingsControlPage.xaml.cs
@@ -0,0 +1,17 @@
+using Windows.UI.Xaml.Controls;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class RatingsControlPage : Page
+ {
+ public RatingsControlPage()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RepeatButtonPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RepeatButtonPage.xaml
index e044e66a1a..6aae2113ae 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RepeatButtonPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RepeatButtonPage.xaml
@@ -17,17 +17,22 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
-
-
-
-
-
-
-
-
-
- <RepeatButton Content="Click and hold" Click="RepeatButton_Click"/>
-
-
-
+
+
+
+
+
+
+
+
+
+ <RepeatButton Content="Click and hold" Click="RepeatButton_Click"/>
+
+
+
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RevealPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RevealPage.xaml
new file mode 100644
index 0000000000..23671832c2
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RevealPage.xaml
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Button Style="{StaticResource ButtonRevealStyle}" Content="Button" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <Grid BorderThickness="3" BorderBrush="{ThemeResource SystemControlRevealBorderListMediumBrush}">
+ <TextBlock Text="SystemControlRevealBorderChromeWhiteBrush" />
+ </Grid>
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RevealPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RevealPage.xaml.cs
new file mode 100644
index 0000000000..87e4e5eac2
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RevealPage.xaml.cs
@@ -0,0 +1,17 @@
+using Windows.UI.Xaml.Controls;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class RevealPage : Page
+ {
+ public RevealPage()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RichTextBlockPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RichTextBlockPage.xaml
index c20ef5bd4f..01737c892c 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RichTextBlockPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/RichTextBlockPage.xaml
@@ -9,130 +9,91 @@
//
//*********************************************************
-->
-
-
-
-
-
-
- I am a RichTextBlock.
-
-
-
-
- <RichTextBlock>
- <Paragraph>I am a RichTextBlock.</Paragraph>
- </RichTextBlock>
-
-
-
-
-
-
-
-
- RichTextBlock provides a rich text display container that supports
- formatted text,
- hyperlinks, inline images, and other rich content.
-
- RichTextBlock also supports a built-in overflow model.
-
-
-
-
- <RichTextBlock SelectionHighlightColor="Green">
- <Paragraph>RichTextBlock provides a rich text display container that supports
- <Run FontStyle="Italic" FontWeight="Bold">formatted text</Run>,
- <Hyperlink NavigateUri="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.documents.hyperlink.aspx">hyperlinks</Hyperlink>, inline images, and other rich content.</Paragraph>
- <Paragraph>RichTextBlock also supports a built-in overflow model.</Paragraph>
- </RichTextBlock>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Linked text containers allow text which does not fit in one element to overflow into a different element on the page. Creative use of linked text containers enables basic multicolumn support and other advanced page layouts.
-
-
- Duis sed nulla metus, id hendrerit velit. Curabitur dolor purus, bibendum eu cursus lacinia, interdum vel augue. Aenean euismod eros et sapien vehicula dictum. Duis ullamcorper, turpis nec feugiat tincidunt, dui erat luctus risus, aliquam accumsan lacus est vel quam. Nunc lacus massa, varius eget accumsan id, congue sed orci. Duis dignissim hendrerit egestas. Proin ut turpis magna, sit amet porta erat. Nunc semper metus nec magna imperdiet nec vestibulum dui fringilla. Sed sed ante libero, nec porttitor mi. Ut luctus, neque vitae placerat egestas, urna leo auctor magna, sit amet ultricies ipsum felis quis sapien. Proin eleifend varius dui, at vestibulum nunc consectetur nec. Mauris nulla elit, ultrices a sodales non, aliquam ac est. Quisque sit amet risus nulla. Quisque vestibulum posuere velit, vitae vestibulum eros scelerisque sit amet. In in risus est, at laoreet dolor. Nullam aliquet pellentesque convallis. Ut vel tincidunt nulla. Mauris auctor tincidunt auctor.
- Aenean orci ante, vulputate ac sagittis sit amet, consequat at mi. Morbi elementum purus consectetur nisi adipiscing vitae blandit sapien placerat. Aliquam adipiscing tortor non sem lobortis consectetur mattis felis rhoncus. Nunc eu nunc rhoncus arcu sollicitudin ultrices. In vulputate eros in mauris aliquam id dignissim nisl laoreet.
-
-
-
-
-
-
-
-
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <Grid.ColumnDefinitions>
-
- <RichTextBlock Grid.Column="0"
- OverflowContentTarget="{x:Bind firstOverflowContainer}" TextAlignment="Justify" Margin="12,0">
-
- <Paragraph>Linked text containers allow text which does not fit in one element to overflow into a different element on the page. Creative use of linked text containers enables basic multicolumn support and other advanced page layouts.</Paragraph>
- <!-- Additional content not shown. -->
- </RichTextBlock>
-
- <RichTextBlockOverflow
- x:Name="firstOverflowContainer" OverflowContentTarget="{x:Bind secondOverflowContainer}" Grid.Column="1" Margin="12,0"/>
-
-
- <RichTextBlockOverflow
- x:Name="secondOverflowContainer" Grid.Column="2" Margin="12,0"/>
-
- </Grid>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ I am a RichTextBlock.
+
+
+
+
+ <RichTextBlock>
+ <Paragraph>I am a RichTextBlock.</Paragraph>
+ </RichTextBlock>
+
+
+
+
+
+
+ RichTextBlock provides a rich text display container that supports
+ formatted text ,
+ hyperlinks , inline images, and other rich content.
+
+ RichTextBlock also supports a built-in overflow model.
+
+
+
+
+ <RichTextBlock SelectionHighlightColor="Green">
+ <Paragraph>RichTextBlock provides a rich text display container that supports
+ <Run FontStyle="Italic" FontWeight="Bold">formatted text</Run>,
+ <Hyperlink NavigateUri="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.documents.hyperlink.aspx">hyperlinks</Hyperlink>, inline images, and other rich content.</Paragraph>
+ <Paragraph>RichTextBlock also supports a built-in overflow model.</Paragraph>
+ </RichTextBlock>
+
+
+
+
+
+
+
+
+
+
+
+
+ Linked text containers allow text which does not fit in one element to overflow into a different element on the page. Creative use of linked text containers enables basic multicolumn support and other advanced page layouts.
+ Duis sed nulla metus, id hendrerit velit. Curabitur dolor purus, bibendum eu cursus lacinia, interdum vel augue. Aenean euismod eros et sapien vehicula dictum. Duis ullamcorper, turpis nec feugiat tincidunt, dui erat luctus risus, aliquam accumsan lacus est vel quam. Nunc lacus massa, varius eget accumsan id, congue sed orci. Duis dignissim hendrerit egestas. Proin ut turpis magna, sit amet porta erat. Nunc semper metus nec magna imperdiet nec vestibulum dui fringilla. Sed sed ante libero, nec porttitor mi. Ut luctus, neque vitae placerat egestas, urna leo auctor magna, sit amet ultricies ipsum felis quis sapien. Proin eleifend varius dui, at vestibulum nunc consectetur nec. Mauris nulla elit, ultrices a sodales non, aliquam ac est. Quisque sit amet risus nulla. Quisque vestibulum posuere velit, vitae vestibulum eros scelerisque sit amet. In in risus est, at laoreet dolor. Nullam aliquet pellentesque convallis. Ut vel tincidunt nulla. Mauris auctor tincidunt auctor.
+ Aenean orci ante, vulputate ac sagittis sit amet, consequat at mi. Morbi elementum purus consectetur nisi adipiscing vitae blandit sapien placerat. Aliquam adipiscing tortor non sem lobortis consectetur mattis felis rhoncus. Nunc eu nunc rhoncus arcu sollicitudin ultrices. In vulputate eros in mauris aliquam id dignissim nisl laoreet.
+
+
+
+
+
+
+
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition/>
+ <ColumnDefinition/>
+ <ColumnDefinition/>
+ <Grid.ColumnDefinitions>
+ <RichTextBlock Grid.Column="0"
+ OverflowContentTarget="{x:Bind firstOverflowContainer}" TextAlignment="Justify" Margin="12,0">
+
+ <Paragraph>Linked text containers allow text which does not fit in one element to overflow into a different element on the page. Creative use of linked text containers enables basic multicolumn support and other advanced page layouts.</Paragraph>
+ <!-- Additional content not shown. -->
+ </RichTextBlock>
+ <RichTextBlockOverflow
+ x:Name="firstOverflowContainer" OverflowContentTarget="{x:Bind secondOverflowContainer}" Grid.Column="1" Margin="12,0"/>
+
+ <RichTextBlockOverflow
+ x:Name="secondOverflowContainer" Grid.Column="2" Margin="12,0"/>
+
+ </Grid>
+
+
+
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ScrollViewerPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ScrollViewerPage.xaml
index cfc7648add..51388711e8 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ScrollViewerPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ScrollViewerPage.xaml
@@ -9,68 +9,70 @@
//
//*********************************************************
-->
-
-
-
+
+
-
-
+
+
-
+
-
+ EnabledDisabled
+ Maximum="{x:Bind Control1.MaxZoomFactor, Mode=OneWay}"
+ Minimum="{x:Bind Control1.MinZoomFactor, Mode=OneWay}" Value="1" Width="100"
+ ValueChanged="ZoomSlider_ValueChanged" />
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+ AutoEnabledDisabled
-
+ AutoVisibleHiddenDisabled
-
-
-
+
+ AutoEnabledDisabled
-
+ AutoVisibleHidden
@@ -81,38 +83,18 @@
<ScrollViewer Height="270" ZoomMode="Disabled"
- IsVerticalScrollChainingEnabled="True"
+ IsVerticalScrollChainingEnabled="True"ManipulationCompleted="Control1_ManipulationCompleted"
- HorizonalScrollMode="" HorizontalScrollBarVisibility=""
- VerticalScrollMode="" VerticalScrollBarVisibility="" >/>
+ HorizonalScrollMode=""
+ HorizontalScrollBarVisibility=""
+
+ VerticalScrollMode=""
+ VerticalScrollBarVisibility="" >
+ <Image Source="ms-appx:///Assets/cliff.jpg" Stretch="None" HorizontalAlignment="Left" VerticalAlignment="Top"/></ScrollViewer>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SemanticZoomPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SemanticZoomPage.xaml
index bf6e2cc054..1ecbc23793 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SemanticZoomPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SemanticZoomPage.xaml
@@ -24,8 +24,8 @@
d:Source="{Binding Groups, Source={d:DesignData Source=/DataModel/ControlInfoData.json, Type=data:ControlInfoDataSource}}"/>
-
-
+
+
@@ -43,10 +43,10 @@
-
+
-
@@ -55,7 +55,7 @@
-
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SemanticZoomPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SemanticZoomPage.xaml.cs
index cdcbd788d9..49e92657e8 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SemanticZoomPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SemanticZoomPage.xaml.cs
@@ -39,5 +39,10 @@ protected async override void OnNavigatedTo(NavigationEventArgs e)
_groups = await ControlInfoDataSource.GetGroupsAsync();
}
+
+ private void List_GotFocus(object sender, Windows.UI.Xaml.RoutedEventArgs e)
+ {
+ Control1.StartBringIntoView();
+ }
}
}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SliderPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SliderPage.xaml
index cde322bad6..fddecc3d10 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SliderPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SliderPage.xaml
@@ -9,98 +9,68 @@
//
//*********************************************************
-->
-
-
-
-
-
-
-
-
-
-
-
- <Slider Width="200"/>
-
-
-
-
-
-
-
-
-
-
-
- <Slider Width="200"
- Minimum="500" Maximum="1000" StepFrequency="10"
-
-
- SmallChange="10" LargeChange="100" Value="800" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <Slider
- TickFrequency="10" TickPlacement="Outside" />
-
-
-
-
-
-
-
-
-
-
-
-
- <Slider Width="100" Orientation="Vertical" TickFrequency="10"
- TickPlacement="Outside" Maximum="50" Minimum="-50"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ <Slider Width="200"/>
+
+
+
+
+
+
+
+
+
+
+ <Slider Width="200"
+ Minimum="500" Maximum="1000" StepFrequency="10"
+
+
+ SmallChange="10" LargeChange="100" Value="800" />
+
+
+
+
+
+
+
+
+
+
+
+ <Slider
+ TickFrequency="10" TickPlacement="Outside" />
+
+
+
+
+
+
+
+
+
+
+
+ <Slider Width="100" Orientation="Vertical" TickFrequency="10"
+ TickPlacement="Outside" Maximum="50" Minimum="-50"/>
+
+
+
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SplitViewPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SplitViewPage.xaml
index def47f7379..044c560ac5 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SplitViewPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SplitViewPage.xaml
@@ -1,61 +1,63 @@
-
-
+
-
-
-
+
+
+
-
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
-
+
-
-
-
+
+
-
-
+
+
- <SplitView x:Name="splitView" PaneBackground="" IsPaneOpen="" OpenPaneLength="" CompactPaneLength="" DisplayMode="">
+ <SplitView x:Name="splitView" PaneBackground=""
+ IsPaneOpen=""
+ OpenPaneLength=""
+ CompactPaneLength=""
+ DisplayMode="">
+ <SplitView.Pane><Grid><Grid.RowDefinitions>
@@ -86,64 +88,31 @@
-
-
+
-
-
-
+
+
+ InlineCompactInlineOverlayCompactOverlay
-
+ SystemControlBackgroundChromeMediumLowBrushRedBlueGreen
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/StackPanelPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/StackPanelPage.xaml
index 3d861648c0..15c0a9a382 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/StackPanelPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/StackPanelPage.xaml
@@ -9,31 +9,25 @@
//
//*********************************************************
-->
-
-
-
+
+
-
-
-
-
+
+
+
+
@@ -48,36 +42,14 @@
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SwipePage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SwipePage.xaml
new file mode 100644
index 0000000000..7f8bb57031
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SwipePage.xaml
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SwipePage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SwipePage.xaml.cs
new file mode 100644
index 0000000000..279eabfa59
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/SwipePage.xaml.cs
@@ -0,0 +1,79 @@
+//*********************************************************
+//
+// Copyright (c) Microsoft. All rights reserved.
+// 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 Microsoft.UI.Preview;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.ControlPages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class SwipePage : Page
+ {
+#if false
+ public SwipePage()
+ {
+ this.InitializeComponent();
+
+ lv.ItemsSource = @"AcrylicBrush ColorPicker NavigationView ParallaxView PersonPicture PullToRefresh RatingsControl RevealBrush TreeView".Split(' ');
+ }
+
+ ObservableCollection
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ViewBoxPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ViewBoxPage.xaml
index 63d92c3618..7edccb04eb 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ViewBoxPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ControlPages/ViewBoxPage.xaml
@@ -9,36 +9,31 @@
//
//*********************************************************
-->
-
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
+
-
- <Viewbox Height=""
- Width="" StretchDirection="Both">
+
+ <Viewbox Height=""
+ Width="" StretchDirection="Both">
<Border BorderBrush="Gray" BorderThickness="15"><StackPanel Background="DarkGray">
@@ -56,49 +51,29 @@
-
-
+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/DataModel/ControlInfoData.json b/Samples/XamlUIBasics/cs/AppUIBasics/DataModel/ControlInfoData.json
index 75b3604af8..ad17a9bf54 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/DataModel/ControlInfoData.json
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/DataModel/ControlInfoData.json
@@ -1,907 +1,1575 @@
{
- "Groups": [
+ "Groups": [
+ {
+ "UniqueId": "AllControls",
+ "Title": "All controls",
+ "Subtitle": "",
+ "ImagePath": "ms-appx:///Assets/NavigationViewItemIcons/AllControlsIcon.png",
+ "Description": "",
+ "Items": []
+ },
+ {
+ "UniqueId": "NewControls",
+ "Title": "New controls",
+ "Subtitle": "",
+ "ImagePath": "ms-appx:///Assets/NavigationViewItemIcons/NewControlsIcon.png",
+ "Description": "",
+ "Items": []
+ },
+ {
+ "UniqueId": "Commanding",
+ "Title": "Commanding",
+ "Subtitle": "AppBar, CommandBar, AppBarButton, AppBarToggleButton, AppBarSeparator",
+ "ImagePath": "ms-appx:///Assets/NavigationViewItemIcons/CommandingIcon.png",
+ "Description": "Use app bars to present navigation, commands, and tools to users.",
+ "Items": [
+ {
+ "UniqueId": "AppBar",
+ "Title": "AppBar",
+ "Subtitle": "A toolbar for displaying application-specific commands, navigation, and tools. Use CommandBar rather than AppBar for the most up-to-date features.",
+ "ImagePath": "ms-appx:///Assets/AppBar.png",
+ "Description": "An app bar is a UI element that presents navigation, commands, and tools to the user. An app bar can appear at the top of the page, at the bottom of the page, or both. It is hidden by default, and is shown or dismissed when the user right clicks, presses Windows+Z, or swipes from the top or bottom edge of the screen.",
+ "Content": "
This page shows a simplified navigation bar to demonstrate basic AppBar usage. When you resize the page (by placing apps side-by-side, for example), the AppBar control doesn't resize it's content, so you have to manage that yourself. Look at the AppBarPage.xaml file in Visual Studio to see this simplified app bar.
This app also uses a shared AppBar in NavigationRootPage for navigation. To see an example of more complex app bar content, look at the files in the Navigation folder in Visual Studio.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "AppBar",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.appbar.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding app bars",
+ "Uri": "https://docs.microsoft.com/windows/uwp/controls-and-patterns/app-bars"
+ }
+ ],
+ "RelatedControls": [
+ "CommandBar",
+ "AppBarButton",
+ "AppBarToggleButton",
+ "AppBarSeparator"
+ ]
+ },
+ {
+ "UniqueId": "AppBarButton",
+ "Title": "AppBarButton",
+ "Subtitle": "A button that's styled for use in a CommandBar.",
+ "ImagePath": "ms-appx:///Assets/AppBarButton.png",
+ "Description": "App bar buttons differ from standard buttons in several ways:\n- Their default appearance is a transparent background with a smaller size.\n- You use the Label and Icon properties to set the content instead of the Content property. The Content property is ignored.\n- The button's IsCompact property controls its size.",
+ "Content": "
You can open the app bar and toggle the IsCompact button to see how the app bar buttons on this page change.
Use the Label and Icon properties to define the content of the app bar buttons. Set the Label property to a string to specify the text label. The label is shown by default but is hidden when the button is in its compact state, so you also need to specify a meaningful icon. To do that, set the button's Icon property to an element derived from the IconElement class. Four kinds of icon elements are provided:
FontIcon - The icon is based on a glyph from the specified font family.
BitmapIcon - The icon is based on a bitmap image file with the specified Uri.
PathIcon - The icon is based on Path data.
SymbolIcon - The icon is based on a predefined list of glyphs from the Segoe UI Symbol font.
Look at the AppBarButtonPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "AppBarButton",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.appbarbutton.aspx"
+ },
+ {
+ "Title": "SymbolIcon",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.symbolicon.aspx"
+ },
+ {
+ "Title": "FontIcon",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.fonticon.aspx"
+ },
+ {
+ "Title": "BitmapIcon",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.bitmapicon.aspx"
+ },
+ {
+ "Title": "PathIcon",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.pathicon.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding app bar buttons",
+ "Uri": "https://docs.microsoft.com/windows/uwp/controls-and-patterns/app-bars"
+ }
+ ],
+ "RelatedControls": [ "AppBarToggleButton", "AppBarSeparator", "AppBar", "CommandBar" ]
+ },
+ {
+ "UniqueId": "AppBarSeparator",
+ "Title": "AppBarSeparator",
+ "Subtitle": "A vertical line that's used to visually separate groups of commands in an app bar.",
+ "ImagePath": "ms-appx:///Assets/AppBarSeparator.png",
+ "Description": "An AppBarSeparator creates a vertical line to visually separate groups of commands in a app bar. It has a compact state with reduced padding to match the compact state of the AppBarButton and AppBarToggleButton controls.",
+ "Content": "
You can open the app bar and toggle the IsCompact button to see how the app bar buttons and separators on this page change.
When the IsCompact property is true, the padding around the AppBarSeparator is reduced.
Look at the AppBarSeparatorPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "AppBarSeparator",
+ "Uri": "https://docs.microsoft.com/uwp/api/windows.ui.xaml.controls.appbarseparator"
+ }
+ ],
+ "RelatedControls": [
+ "AppBarButton",
+ "AppBarToggleButton",
+ "AppBar",
+ "CommandBar"
+ ]
+ },
+ {
+ "UniqueId": "AppBarToggleButton",
+ "Title": "AppBarToggleButton",
+ "Subtitle": "A button that can be on, off, or indeterminate like a CheckBox, and is styled for use in an app bar or other specialized UI.",
+ "ImagePath": "ms-appx:///Assets/AppBarToggleButton.png",
+ "Description": "An AppBarToggleButton looks like an AppBarButton, but works like a CheckBox. It typically has two states, checked (on) or unchecked (off), but can be indeterminate if the IsThreeState property is true. You can determine it's state by checking the IsChecked property.",
+ "Content": "
You can open the app bar and toggle the IsCompact button to see how the app bar buttons on this page change.
Look at the AppBarToggleButtonPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "AppBarToggleButton",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.appbartogglebutton.aspx"
+ },
+ {
+ "Title": "SymbolIcon",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.symbolicon.aspx"
+ },
+ {
+ "Title": "FontIcon",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.fonticon.aspx"
+ },
+ {
+ "Title": "BitmapIcon",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.bitmapicon.aspx"
+ },
+ {
+ "Title": "PathIcon",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.pathicon.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding app bar buttons",
+ "Uri": "https://docs.microsoft.com/windows/uwp/controls-and-patterns/app-bars"
+ }
+ ],
+ "RelatedControls": [
+ "AppBarButton",
+ "AppBarSeparator",
+ "AppBar",
+ "CommandBar"
+ ]
+ },
+ {
+ "UniqueId": "Button",
+ "Title": "Button",
+ "Subtitle": "A control that responds to user input and raises a Click event.",
+ "ImagePath": "ms-appx:///Assets/Button.png",
+ "Description": "The Button control provides a Click event to respond to user input from a touch, mouse, keyboard, stylus, or other input device. You can put different kinds of content in a button, such as text or an image, or you can restyle a button to give it a new look.",
+ "Content": "
The main purpose of a Button is to make something happen when a user clicks it. There are two ways you can make something happen:
Handle the Click event.
Bind the Command property to an ICommand implementation that describes the command logic.
Buttons often have only simple string content, but you can use any object as content. You can also change the style and template to give them any look you want.
Look at the ButtonPage.xaml file in Visual Studio to see the custom button style and template definitions used on this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "Button",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.button.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding button controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/jj153346.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ToggleButton",
+ "RepeatButton",
+ "HyperlinkButton",
+ "AppBarButton"
+ ]
+ },
+ {
+ "UniqueId": "CommandBar",
+ "Title": "CommandBar",
+ "Subtitle": "A toolbar for displaying application-specific commands that handles layout and resizing of its contents.",
+ "ImagePath": "ms-appx:///Assets/CommandBar.png",
+ "Description": "The CommandBar simplifies the creation of basic app bars by providing:\n- Automatic layout of commands, with primary commands on the right and secondary commands on the left.\n- Automatic resizing of app bar commands when the app size changes.\nWhen you need an app bar that contains only AppBarButton,AppBarToggleButton , and AppBarSeparator controls, use a CommandBar. If you need more complex content, such as images, progress bars, or text blocks, use an AppBar control.",
+ "Content": "
The bottom app bar on this page is a CommandBar control.
Add secondary commands and then resize the app to see how the CommandBar automatically adapts to different widths.
This CommandBar element is in the ItemPage so it can be shared across all control pages in the app. Look at the ItemPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "CommandBar",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.commandbar.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding app bars",
+ "Uri": "https://docs.microsoft.com/windows/uwp/controls-and-patterns/app-bars"
+ }
+ ],
+ "RelatedControls": [
+ "AppBar",
+ "AppBarButton",
+ "AppBarToggleButton",
+ "AppBarSeparator"
+ ]
+ },
+ {
+ "UniqueId": "ContentDialog",
+ "Title": "ContentDialog",
+ "Subtitle": "A dialog box that can be customized to contain any XAML content.",
+ "ImagePath": "ms-appx:///Assets/DefaultIcon.png",
+ "Description": "Use a ContentDialog to show relavant information or to provide a modal dialog experience that can show any XAML content.",
+ "Content": "
Look at the ContentDialog.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "ContentDialog",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.contentdialog.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Flyout",
+ "MenuFlyout",
+ "ToolTip"
+ ]
+ },
+ {
+ "UniqueId": "HyperlinkButton",
+ "Title": "HyperlinkButton",
+ "Subtitle": "A button that appears as hyperlink text, and can navigate to a URI or handle a Click event.",
+ "ImagePath": "ms-appx:///Assets/HyperlinkButton.png",
+ "Description": "A HyperlinkButton appears as a text hyperlink. When a user clicks it, it opens the page you specify in the NavigateUri property in the default browser. Or you can handle its Click event, typically to navigate within your app.",
+ "Content": "
A HyperlinkButton looks like hyperlink text, but works like a button. You can use it in two ways:
Set the NavigateUri property. When a user clicks it, it will automatically open the URI in the default browser.
Handle the Click event. This works just like the Click event of a standard Button, and can be used to navigate within your app.
Each control page in this app has two sets of hyperlink buttons, one set to open documentation in Internet Explorer, and one set to navigate to related control pages in the app.
Look at the HyperlinkButtonPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "HyperlinkButton",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.hyperlinkbutton.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding a button",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/jj153346.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Button",
+ "ToggleButton",
+ "RepeatButton",
+ "AppBarButton"
+ ]
+ },
+ {
+ "UniqueId": "MenuFlyout",
+ "Title": "MenuFlyout",
+ "Subtitle": "Shows a contextual list of simple commands or options.",
+ "ImagePath": "ms-appx:///Assets/MenuFlyout.png",
+ "Description": "A MenuFlyout displays lightweight UI that is light dismissed by clicking or tapping off of it. Use it to let the user choose from a contextual list of simple commands or options.",
+ "Content": "
Look at the MenuFlyoutPage.xaml file in Visual Studio to see the full code.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "MenuFlyout",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.menuflyout.aspx"
+ },
+ {
+ "Title": "MenuFlyoutItem",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.menuflyoutitem.aspx"
+ },
+ {
+ "Title": "MenuFlyoutSeparator",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.menuflyoutseparator.aspx"
+ },
+ {
+ "Title": "ToggleMenuFlyoutItem",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.togglemenuflyoutitem.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding a MenuFlyout",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/dn308516.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Flyout",
+ "ContentDialog",
+ "Button",
+ "AppBarButton"
+ ]
+ },
+ {
+ "UniqueId": "RepeatButton",
+ "Title": "RepeatButton",
+ "Subtitle": "A button that raises its Click event repeatedly from the time it's pressed until it's released.",
+ "ImagePath": "ms-appx:///Assets/Button.png",
+ "Description": "The RepeatButton control is like a standard Button, except that the Click event occurs continuously while the user presses the RepeatButton.",
+ "Content": "
A RepeatButton looks just like a regular Button, but it's Click event occurs continuously while the button is pressed.
Look at the RepeatButtonPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "RepeatButton",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.primitives.repeatbutton.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding button controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/jj153346.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Button",
+ "ToggleButton",
+ "HyperlinkButton",
+ "AppBarButton"
+ ]
+ },
+ {
+ "UniqueId": "Swipe",
+ "Title": "Swipe",
+ "Subtitle": "Touch gesture for quick menu actions on items.",
+ "ImagePath": "ms-appx:///Assets/Swipe.png",
+ "Description": "Touch gesture for quick menu actions on items.",
+ "Content": "",
+ "IsNew": true,
+ "Docs": [
+ {
+ "Title": "SwipeContainer",
+ "Uri": "https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.SwipeContainer"
+ },
+ {
+ "Title": "SwipeContent",
+ "Uri": "https://docs.microsoft.com/uwp/api/windows/apps/Windows.UI.Xaml.Controls.SwipeContent"
+ }
+ ],
+ "RelatedControls": [
+ "GridView",
+ "ListView",
+ "TreeView"
+ ]
+ },
+ {
+ "UniqueId": "ToggleButton",
+ "Title": "ToggleButton",
+ "Subtitle": "A button that can be switched between two states like a CheckBox.",
+ "ImagePath": "ms-appx:///Assets/ToggleButton.png",
+ "Description": "A ToggleButton looks like a Button, but works like a CheckBox. It typically has two states, checked (on) or unchecked (off), but can be indeterminate if the IsThreeState property is true. You can determine it's state by checking the IsChecked property.",
+ "Content": "
ToggleButton is used as a base class for similar controls like CheckBox and RadioButton. It can be used on its own, but don't use it if a CheckBox, RadioButton, or ToggleSwitch would convey your intent better.
Look at the ToggleButtonPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "ToggleButton",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.primitives.togglebutton.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding button controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/jj153346.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Button",
+ "AppBarToggleButton",
+ "ToggleSwitch",
+ "CheckBox"
+ ]
+ }
+
+ ]
+ },
+ {
+ "UniqueId": "Collections",
+ "Title": "Collections",
+ "Subtitle": "FlipView, GridView, ListView, Pivot, SemanticZoom, Hub",
+ "ImagePath": "\uE292",
+ "Description": "Use collection controls to display, navigate, and interact with collections of data and media.",
+ "Items": [
{
- "UniqueId": "AppBars",
- "Title": "App bars and commands",
- "Subtitle": "AppBar, CommandBar, AppBarButton, AppBarToggleButton, AppBarSeparator",
- "ImagePath": "ms-appx:///Assets/CommandBar.png",
- "Description": "Use app bars to present navigation, commands, and tools to users.",
- "Items": [
- {
- "UniqueId": "AppBar",
- "Title": "AppBar",
- "Subtitle": "A toolbar for displaying application-specific commands, navigation, and tools.",
- "ImagePath": "ms-appx:///Assets/AppBar.png",
- "Description": "An app bar is a UI element that presents navigation, commands, and tools to the user. An app bar can appear at the top of the page, at the bottom of the page, or both. It is hidden by default, and is shown or dismissed when the user right clicks, presses Windows+Z, or swipes from the top or bottom edge of the screen.",
- "Content": "
This page shows a simplified navigation bar to demonstrate basic AppBar usage. When you resize the page (by placing apps side-by-side, for example), the AppBar control doesn't resize it's content, so you have to manage that yourself. Look at the AppBarPage.xaml file in Visual Studio to see this simplified app bar.
This app also uses a shared AppBar in NavigationRootPage for navigation. To see an example of more complex app bar content, look at the files in the Navigation folder in Visual Studio.
",
- "Docs": [
- { "Title": "AppBar", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.appbar.aspx" },
- { "Title": "Quickstart: Adding app bars", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh781232.aspx" }
- ],
- "RelatedControls": [
- "CommandBar",
- "AppBarButton",
- "AppBarToggleButton",
- "AppBarSeparator"
- ]
- },
- {
- "UniqueId": "CommandBar",
- "Title": "CommandBar",
- "Subtitle": "A toolbar for displaying application-specific commands that handles layout and resizing of its contents.",
- "ImagePath": "ms-appx:///Assets/CommandBar.png",
- "Description": "The CommandBar simplifies the creation of basic app bars by providing:\n- Automatic layout of commands, with primary commands on the right and secondary commands on the left.\n- Automatic resizing of app bar commands when the app size changes.\nWhen you need an app bar that contains only AppBarButton,AppBarToggleButton , and AppBarSeparator controls, use a CommandBar. If you need more complex content, such as images, progress bars, or text blocks, use an AppBar control.",
- "Content": "
The bottom app bar on this page is a CommandBar control.
Add secondary commands and then resize the app to see how the CommandBar automatically adapts to different widths.
This CommandBar element is in the ItemPage so it can be shared across all control pages in the app. Look at the ItemPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "CommandBar", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.commandbar.aspx" },
- { "Title": "Quickstart: Adding app bars", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh781232.aspx" }
- ],
- "RelatedControls": [
- "AppBar",
- "AppBarButton",
- "AppBarToggleButton",
- "AppBarSeparator"
- ]
- },
- {
- "UniqueId": "AppBarButton",
- "Title": "AppBarButton",
- "Subtitle": "A button that's styled for use in an app bar or other specialized UI.",
- "ImagePath": "ms-appx:///Assets/AppBarButton.png",
- "Description": "App bar buttons differ from standard buttons in several ways:\n- Their default appearance is a transparent background with a smaller size.\n- You use the Label and Icon properties to set the content instead of the Content property. The Content property is ignored.\n- The button's IsCompact property controls its size.",
- "Content": "
You can open the app bar and toggle the IsCompact button to see how the app bar buttons on this page change.
Use the Label and Icon properties to define the content of the app bar buttons. Set the Label property to a string to specify the text label. The label is shown by default but is hidden when the button is in its compact state, so you also need to specify a meaningful icon. To do that, set the button's Icon property to an element derived from the IconElement class. Four kinds of icon elements are provided:
FontIcon - The icon is based on a glyph from the specified font family.
BitmapIcon - The icon is based on a bitmap image file with the specified Uri.
PathIcon - The icon is based on Path data.
SymbolIcon - The icon is based on a predefined list of glyphs from the Segoe UI Symbol font.
Look at the AppBarButtonPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "AppBarButton", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.appbarbutton.aspx" },
- { "Title": "SymbolIcon", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.symbolicon.aspx" },
- { "Title": "FontIcon", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.fonticon.aspx" },
- { "Title": "BitmapIcon", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.bitmapicon.aspx" },
- { "Title": "PathIcon", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.pathicon.aspx" },
- { "Title": "Quickstart: Adding app bar buttons", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/jj662743.aspx" }
- ],
- "RelatedControls": [ "AppBarToggleButton", "AppBarSeparator", "AppBar", "CommandBar" ]
- },
- {
- "UniqueId": "AppBarToggleButton",
- "Title": "AppBarToggleButton",
- "Subtitle": "A button that can be on, off, or indeterminate like a CheckBox, and is styled for use in an app bar or other specialized UI.",
- "ImagePath": "ms-appx:///Assets/AppBarToggleButton.png",
- "Description": "An AppBarToggleButton looks like an AppBarButton, but works like a CheckBox. It typically has two states, checked (on) or unchecked (off), but can be indeterminate if the IsThreeState property is true. You can determine it's state by checking the IsChecked property.",
- "Content": "
You can open the app bar and toggle the IsCompact button to see how the app bar buttons on this page change.
Look at the AppBarToggleButtonPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "AppBarToggleButton", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.appbartogglebutton.aspx" },
- { "Title": "SymbolIcon", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.symbolicon.aspx" },
- { "Title": "FontIcon", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.fonticon.aspx" },
- { "Title": "BitmapIcon", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.bitmapicon.aspx" },
- { "Title": "PathIcon", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.pathicon.aspx" },
- { "Title": "Quickstart: Adding app bar buttons", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/jj662743.aspx" }
- ],
- "RelatedControls": [
- "AppBarButton",
- "AppBarSeparator",
- "AppBar",
- "CommandBar"
- ]
- },
- {
- "UniqueId": "AppBarSeparator",
- "Title": "AppBarSeparator",
- "Subtitle": "A vertical line that's used to visually separate groups of commands in an app bar.",
- "ImagePath": "ms-appx:///Assets/AppBarSeparator.png",
- "Description": "An AppBarSeparator creates a vertical line to visually separate groups of commands in a app bar. It has a compact state with reduced padding to match the compact state of the AppBarButton and AppBarToggleButton controls.",
- "Content": "
You can open the app bar and toggle the IsCompact button to see how the app bar buttons and separators on this page change.
When the IsCompact property is true, the padding around the AppBarSeparator is reduced.
Look at the AppBarSeparatorPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [ { "Title": "AppBarSeparator", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.appbarbutton.aspx" } ],
- "RelatedControls": [
- "AppBarButton",
- "AppBarToggleButton",
- "AppBar",
- "CommandBar"
- ]
- }
- ]
+ "UniqueId": "ComboBox",
+ "Title": "ComboBox",
+ "Subtitle": "A drop-down list of items a user can select from.",
+ "ImagePath": "ms-appx:///Assets/ComboBox.png",
+ "Description": "Use a ComboBox when you need to conserve on-screen space and when users select only one option at a time. A ComboBox shows only the currently selected item.",
+ "Content": "
Look at the ComboBoxPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "ComboBox",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.combobox.aspx"
+ },
+ {
+ "Title": "ComboBoxItem",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.comboboxitem.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ListBox",
+ "RadioButton",
+ "CheckBox",
+ "ListView",
+ "AutoSuggestBox",
+ "RatingsControl"
+ ]
},
{
- "UniqueId": "Buttons",
- "Title": "Buttons",
- "Subtitle": "Button, HyperlinkButton, RepeatButton, ToggleButton",
- "ImagePath": "ms-appx:///Assets/Button.png",
- "Description": "Use button controls to let users perform an action, like submitting a form or showing a menu.",
- "Items": [
- {
- "UniqueId": "Button",
- "Title": "Button",
- "Subtitle": "A control that responds to user input and raises a Click event.",
- "ImagePath": "ms-appx:///Assets/Button.png",
- "Description": "The Button control provides a Click event to respond to user input from a touch, mouse, keyboard, stylus, or other input device. You can put different kinds of content in a button, such as text or an image, or you can restyle a button to give it a new look.",
- "Content": "
The main purpose of a Button is to make something happen when a user clicks it. There are two ways you can make something happen:
Handle the Click event.
Bind the Command property to an ICommand implementation that describes the command logic.
Buttons often have only simple string content, but you can use any object as content. You can also change the style and template to give them any look you want.
Look at the ButtonPage.xaml file in Visual Studio to see the custom button style and template definitions used on this page.
",
- "Docs": [
- { "Title": "Button", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.button.aspx" },
- { "Title": "Quickstart: Adding button controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/jj153346.aspx" }
- ],
- "RelatedControls": [
- "ToggleButton",
- "RepeatButton",
- "HyperlinkButton",
- "AppBarButton"
- ]
- },
- {
- "UniqueId": "HyperlinkButton",
- "Title": "HyperlinkButton",
- "Subtitle": "A button that appears as hyperlink text, and can navigate to a URI or handle a Click event.",
- "ImagePath": "ms-appx:///Assets/HyperlinkButton.png",
- "Description": "A HyperlinkButton appears as a text hyperlink. When a user clicks it, it opens the page you specify in the NavigateUri property in the default browser. Or you can handle its Click event, typically to navigate within your app.",
- "Content": "
A HyperlinkButton looks like hyperlink text, but works like a button. You can use it in two ways:
Set the NavigateUri property. When a user clicks it, it will automatically open the URI in the default browser.
Handle the Click event. This works just like the Click event of a standard Button, and can be used to navigate within your app.
Each control page in this app has two sets of hyperlink buttons, one set to open documentation in Internet Explorer, and one set to navigate to related control pages in the app.
Look at the HyperlinkButtonPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "HyperlinkButton", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.hyperlinkbutton.aspx" },
- { "Title": "Quickstart: Adding a button", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/jj153346.aspx" }
- ],
- "RelatedControls": [
- "Button",
- "ToggleButton",
- "RepeatButton",
- "AppBarButton"
- ]
- },
- {
- "UniqueId": "RepeatButton",
- "Title": "RepeatButton",
- "Subtitle": "A button that raises its Click event repeatedly from the time it's pressed until it's released.",
- "ImagePath": "ms-appx:///Assets/Button.png",
- "Description": "The RepeatButton control is like a standard Button, except that the Click event occurs continuously while the user presses the RepeatButton.",
- "Content": "
A RepeatButton looks just like a regular Button, but it's Click event occurs continuously while the button is pressed.
Look at the RepeatButtonPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "RepeatButton", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.primitives.repeatbutton.aspx" },
- { "Title": "Quickstart: Adding button controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/jj153346.aspx" }
- ],
- "RelatedControls": [
- "Button",
- "ToggleButton",
- "HyperlinkButton",
- "AppBarButton"
- ]
- },
- {
- "UniqueId": "ToggleButton",
- "Title": "ToggleButton",
- "Subtitle": "A button that can be switched between two states like a CheckBox.",
- "ImagePath": "ms-appx:///Assets/ToggleButton.png",
- "Description": "A ToggleButton looks like a Button, but works like a CheckBox. It typically has two states, checked (on) or unchecked (off), but can be indeterminate if the IsThreeState property is true. You can determine it's state by checking the IsChecked property.",
- "Content": "
ToggleButton is used as a base class for similar controls like CheckBox and RadioButton. It can be used on its own, but don't use it if a CheckBox, RadioButton, or ToggleSwitch would convey your intent better.
Look at the ToggleButtonPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "ToggleButton", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.primitives.togglebutton.aspx" },
- { "Title": "Quickstart: Adding button controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/jj153346.aspx" }
- ],
- "RelatedControls": [
- "Button",
- "AppBarToggleButton",
- "ToggleSwitch",
- "CheckBox"
- ]
- }
- ]
+ "UniqueId": "FlipView",
+ "Title": "FlipView",
+ "Subtitle": "Presents a collection of items that the user can flip through, one item at a time.",
+ "ImagePath": "ms-appx:///Assets/FlipView.png",
+ "Description": "The FlipView lets you flip through a collection of items, one at a time. It's great for displaying images from a gallery, pages of a magazine, or similar items.",
+ "Content": "
FlipView is an ItemsControl, so it can contain a collection of items of any type. To populate the view, add items to the Items collection, or set the ItemsSource property to a data source.
Look at the FlipViewPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "FlipView",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.flipview.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding FlipView controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh781233.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "GridView",
+ "ListView",
+ "SemanticZoom",
+ "Hub"
+ ]
},
{
- "UniqueId": "Collections",
- "Title": "Collection/data controls",
- "Subtitle": "FlipView, GridView, ListView, Pivot, SemanticZoom, Hub",
- "ImagePath": "ms-appx:///Assets/GridView.png",
- "Description": "Use collection controls to display, navigate, and interact with collections of data and media.",
- "Items": [
- {
- "UniqueId": "FlipView",
- "Title": "FlipView",
- "Subtitle": "Presents a collection of items that the user can flip through, one item at a time.",
- "ImagePath": "ms-appx:///Assets/FlipView.png",
- "Description": "The FlipView lets you flip through a collection of items, one at a time. It's great for displaying images from a gallery, pages of a magazine, or similar items.",
- "Content": "
FlipView is an ItemsControl, so it can contain a collection of items of any type. To populate the view, add items to the Items collection, or set the ItemsSource property to a data source.
Look at the FlipViewPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "FlipView", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.flipview.aspx" },
- { "Title": "Quickstart: Adding FlipView controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh781233.aspx" }
- ],
- "RelatedControls": [
- "GridView",
- "ListView",
- "SemanticZoom",
- "Hub"
- ]
- },
- {
- "UniqueId": "GridView",
- "Title": "GridView",
- "Subtitle": "Presents a collection of items in rows and columns that can scroll horizontally.",
- "ImagePath": "ms-appx:///Assets/GridView.png",
- "Description": "The GridView lets you show a collection of items arranged in rows and columns that scroll horizontally.",
- "Content": "
GridView is an ItemsControl, so it can contain a collection of items of any type. To populate the view, add items to the Items collection, or set the ItemsSource property to a data source.
Set an ItemTemplate to define the look of individual items.
Look at the GridViewPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "GridView", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.gridview.aspx" },
- { "Title": "Quickstart: Adding ListView and GridView controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780650.aspx" }
- ],
- "RelatedControls": [
- "ListView",
- "FlipView",
- "SemanticZoom",
- "Hub"
- ]
- },
- {
- "UniqueId": "ListView",
- "Title": "ListView",
- "Subtitle": "Presents a collection of items in a list that can scroll vertically.",
- "ImagePath": "ms-appx:///Assets/ListView.png",
- "Description": "The ListView lets you show a collection of items in a list that scrolls vertically.",
- "Content": "
ListView is an ItemsControl, so it can contain a collection of items of any type. To populate the view, add items to the Items collection, or set the ItemsSource property to a data source.
Set an ItemTemplate to define the look of individual items.
Look at the ListViewPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "ListView", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listview.aspx" },
- { "Title": "Quickstart: Adding ListView and GridView controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780650.aspx" }
- ],
- "RelatedControls": [
- "GridView",
- "FlipView",
- "SemanticZoom",
- "Hub"
- ]
- },
- {
- "UniqueId": "Pivot",
- "Title": "Pivot",
- "Subtitle": "Presents information from different sources in a tabbed view.",
- "ImagePath": "ms-appx:///Assets/Pivot.png",
- "Description": "A Pivot allows you to show a collection of items from different sources in a tabbed view.",
- "Content": "
This page shows a simplified Pivot control with minimal content to demonstrate basic Pivot usage. Look at the PivotPage.xaml file in Visual Studio to see the full code for this page.
A Pivot control typically takes up the full page.
",
- "Docs": [
- { "Title": "Pivot", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.pivot.aspx" }
- ],
- "RelatedControls": [
- "Hub",
- "SemanticZoom",
- "ListView",
- "GridView"
- ]
- },
- {
- "UniqueId": "SemanticZoom",
- "Title": "SemanticZoom",
- "Subtitle": "Lets the user zoom between two different views of a collection, making it easier to navigate through large collections of items.",
- "ImagePath": "ms-appx:///Assets/SemanticZoom.png",
- "Description": "The SemanticZoom lets you show grouped data in two different ways, and is useful for quickly navigating through large sets of data.",
- "Content": "
Look at the SemanticZoomPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "SemanticZoom", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.semanticzoom.aspx" },
- { "Title": "Quickstart: Adding SemanticZoom controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh781234.aspx" }
- ],
- "RelatedControls": [
- "GridView",
- "ListView",
- "Hub"
- ]
- },
- {
- "UniqueId": "Hub",
- "Title": "Hub",
- "Subtitle": "Presents information from different sources in a scrollable view.",
- "ImagePath": "ms-appx:///Assets/Hub.png",
- "Description": "Use a Hub to display information from different source in a single scrollable view. Hub can also be used to show categorical information in a separated section format.",
- "Content": "
This page shows a simplified Hub control with minimal content to demonstrate basic Hub usage. Look at the HubPage.xaml file in Visual Studio to see the full code for this page.
A Hub control typically takes up the full page. The app home uses a more fully implemented Hub that demonstrates this. Look at the MainPage.xaml file in Visual Studio to see the full code for the home page Hub.
",
- "Docs": [
- { "Title": "Hub", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.hub.aspx" },
- { "Title": "HubSection", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.hubsection.aspx" }
- ],
- "RelatedControls": [
- "Pivot",
- "SemanticZoom",
- "ListView",
- "GridView"
- ]
- }
- ]
+ "UniqueId": "GridView",
+ "Title": "GridView",
+ "Subtitle": "Presents a collection of items in rows and columns that can scroll horizontally.",
+ "ImagePath": "ms-appx:///Assets/GridView.png",
+ "Description": "The GridView lets you show a collection of items arranged in rows and columns that scroll horizontally.",
+ "Content": "
GridView is an ItemsControl, so it can contain a collection of items of any type. To populate the view, add items to the Items collection, or set the ItemsSource property to a data source.
Set an ItemTemplate to define the look of individual items.
Look at the GridViewPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "GridView",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.gridview.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding ListView and GridView controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780650.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ListView",
+ "FlipView",
+ "SemanticZoom",
+ "Hub"
+ ]
},
{
- "UniqueId": "Flyouts",
- "Title": "Flyout controls",
- "Subtitle": "ContentDialog, Flyout, MenuFlyout, ToolTip",
- "ImagePath": "ms-appx:///Assets/ToolTip.png",
- "Description": "Use flyout surfaces to show or collect contextual information.",
- "Items": [
- {
- "UniqueId": "ContentDialog",
- "Title": "ContentDialog",
- "Subtitle": "A dialog box that can be customized to contain any XAML content.",
- "ImagePath": "ms-appx:///Assets/ContentDialog.png",
- "Description": "Use a ContentDialog to show relavant information or to provide a modal dialog experience that can show any XAML content.",
- "Content": "
Look at the ContentDialog.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "ContentDialog", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.contentdialog.aspx" }
- ],
- "RelatedControls": [
- "Flyout",
- "MenuFlyout",
- "ToolTip"
- ]
- },
- {
- "UniqueId": "Flyout",
- "Title": "Flyout",
- "Subtitle": "Shows contextual information and enables user interaction.",
- "ImagePath": "ms-appx:///Assets/Flyout.png",
- "Description": "A Flyout displays lightweight UI that is either information, or requires user interaction. Unlike a dialog, a Flyout can be light dismissed by clicking or tapping off of it. Use it to collect input from the user, show more details about an item, or ask the user to confirm an action.",
- "Content": "
Look at the FlyoutPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "Flyout", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.flyout.aspx" },
- { "Title": "Quickstart: Adding a Flyout", "Uri": "http://msdn.microsoft.com/library/windows/apps/dn308515.aspx" }
- ],
- "RelatedControls": [
- "ContentDialog",
- "MenuFlyout",
- "Button",
- "AppBarButton"
- ]
- },
- {
- "UniqueId": "MenuFlyout",
- "Title": "MenuFlyout",
- "Subtitle": "Shows a contextual list of simple commands or options.",
- "ImagePath": "ms-appx:///Assets/MenuFlyout.png",
- "Description": "A MenuFlyout displays lightweight UI that is light dismissed by clicking or tapping off of it. Use it to let the user choose from a contextual list of simple commands or options.",
- "Content": "
Look at the MenuFlyoutPage.xaml file in Visual Studio to see the full code.
",
- "Docs": [
- { "Title": "MenuFlyout", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.menuflyout.aspx" },
- { "Title": "MenuFlyoutItem", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.menuflyoutitem.aspx" },
- { "Title": "MenuFlyoutSeparator", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.menuflyoutseparator.aspx" },
- { "Title": "ToggleMenuFlyoutItem", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.togglemenuflyoutitem.aspx" },
- { "Title": "Quickstart: Adding a MenuFlyout", "Uri": "http://msdn.microsoft.com/library/windows/apps/dn308516.aspx" }
- ],
- "RelatedControls": [
- "Flyout",
- "ContentDialog",
- "Button",
- "AppBarButton"
- ]
- },
- {
- "UniqueId": "ToolTip",
- "Title": "ToolTip",
- "Subtitle": "Displays information for an element in a pop-up window.",
- "ImagePath": "ms-appx:///Assets/ToolTip.png",
- "Description": "A ToolTip shows more information about a UI element. You might show information about what the element does, or what the user should do. The ToolTip is shown when a user hovers over or presses and holds the UI element.",
- "Content": "
Look at the ToolTipPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [ { "Title": "ToolTip", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.tooltip.aspx" } ],
- "RelatedControls": [
- "Flyout",
- "ContentDialog"
- ]
- }
- ]
+ "UniqueId": "ListBox",
+ "Title": "ListBox",
+ "Subtitle": "A control that presents an inline list of items that the user can select from.",
+ "ImagePath": "ms-appx:///Assets/ListBox.png",
+ "Description": "Use a ListBox when you want the options to be visible all the time or when users can select more than one option at a time. ListBox controls are always open, which allows several items to be displayed to the user without user interaction.",
+ "Content": "
Look at the ListBoxPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "ListBox",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listbox.aspx"
+ },
+ {
+ "Title": "ListBoxItem",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listboxitem.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ComboBox",
+ "RadioButton",
+ "CheckBox",
+ "AutoSuggestBox"
+ ]
},
{
- "UniqueId": "Layout",
- "Title": "Layout controls",
- "Subtitle": "Border, Canvas, Grid, RelativePanel, ScrollViewer, SplitView, StackPanel, VariableSizedWrapGrid, ViewBox",
- "ImagePath": "ms-appx:///Assets/Canvas.png",
- "Description": "Use layout controls to arrange the controls and content in your app.",
- "Items": [
- {
- "UniqueId": "Border",
- "Title": "Border",
- "Subtitle": "A container control that draws a boundary line, background, or both, around another object.",
- "ImagePath": "ms-appx:///Assets/Border.png",
- "Description": "Use a Border control to draw a boundary line, background, or both, around another object. A Border can contain only one child object.",
- "Content": "
A Border can contain only one child object. If you want to put a border around multiple objects, first wrap them in a container object such as StackPanel and make the StackPanel the child of the Border.
You can change the appearance of a Border by setting basic properties:
Width/Height
BorderBrush
BorderThickness
Background
Most of the control pages in this app have XAML blocks to show basic usage. The appearance of the XAML blocks is defined by a Border control. Look at the CodeBorderStyle resource in App.xaml to see the Style that's applied to the Borders.
Look at the BorderPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "Border", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.border.aspx" },
- { "Title": "Quickstart: Adding layout controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh969155.aspx" }
- ],
- "RelatedControls": [
- "Canvas",
- "Grid",
- "StackPanel",
- "VariableSizedWrapGrid",
- "RelativePanel"
- ]
- },
- {
- "UniqueId": "Canvas",
- "Title": "Canvas",
- "Subtitle": "A layout panel that supports absolute positioning of child elements relative to the top left corner of the canvas.",
- "ImagePath": "ms-appx:///Assets/Canvas.png",
- "Description": "The Canvas provides absolute positioning of controls or content. Content is positioned relative to the Canvas using the Canvas.Top and Canvas.Left attached properties.",
- "Content": "
Items are positioned on the Canvas using the Canvas.Top and Canvas.Left attached properties. Use the sliders to change these properties for the red rectangle and see how it moves around.
To see the effect of the ZIndex attached property, make sure the red rectangle is overlapping the other rectangles.
Look at the CanvasPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "Canvas", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.canvas.aspx" },
- { "Title": "Quickstart: Adding layout controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh969155.aspx" }
- ],
- "RelatedControls": [
- "Border",
- "Grid",
- "StackPanel",
- "VariableSizedWrapGrid",
- "RelativePanel"
- ]
- },
- {
- "UniqueId": "Grid",
- "Title": "Grid",
- "Subtitle": "A layout panel that supports arranging child elements in rows and columns. ",
- "ImagePath": "ms-appx:///Assets/Grid.png",
- "Description": "The Grid is used to arrange controls and content in rows and columns. Content is positioned in the grid using Grid.Row and Grid.Column attached properties.",
- "Content": "
Look at the GridPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "Grid", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.grid.aspx" },
- { "Title": "Quickstart: Adding layout controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh969155.aspx" }
- ],
- "RelatedControls": [
- "Border",
- "Canvas",
- "StackPanel",
- "VariableSizedWrapGrid",
- "RelativePanel"
- ]
- },
- {
- "UniqueId": "RelativePanel",
- "Title": "RelativePanel",
- "Subtitle": "A panel that uses relationships between elements to define layout.",
- "ImagePath": "ms-appx:///Assets/RelativePanel.png",
- "Description": "Use a RelativePanel to layout elements by defining the relationships between elements and in relation to the panel.",
- "Content": "
Look at the RelativePanelPage.xaml file in Visual Studio to see the full code for this page.
","Docs": [
- { "Title": "RelativePanel", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.relativepanel.aspx" }
- ],
- "RelatedControls": [
- "Grid",
- "StackPanel",
- "Border",
- "Canvas",
- "Viewbox"
- ]
- },
- {
- "UniqueId": "ScrollViewer",
- "Title": "ScrollViewer",
- "Subtitle": "A container control that lets the user pan and zoom its content.",
- "ImagePath": "ms-appx:///Assets/ScrollViewer.png",
- "Description": "A ScrollViewer lets a user scroll, pan, and zoom to see content that's larger than the viewable area. Many content controls, like ListView, have ScrollViewers built into their control templates to provide automatic scrolling.",
- "Content": "
Look at the ScrollViewerPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [ { "Title": "ScrollViewer", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.scrollviewer.aspx" } ],
- "RelatedControls": [
- "Viewbox",
- "Canvas",
- "Grid",
- "StackPanel",
- "RelativePanel"
- ]
- },
- {
- "UniqueId": "SplitView",
- "Title": "SplitView",
- "Subtitle": "A container that has 2 content areas, with multiple display options for the pane.",
- "ImagePath": "ms-appx:///Assets/SplitView.png",
- "Description": "Use a SplitView to display content, such as navigation options, in a pane on the side. There are multiple options for displaying the pane, namely CompactOverlay, Compact, Overlay, Inline. If you are looking for a reference to the hamburger pattern, please see the links in the documentation below.",
- "Content": "
Look at the SplitViewPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "SplitView", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.splitview.aspx" },
- { "Title": "Hamburger pattern", "Uri": "http://go.microsoft.com/fwlink/p/?LinkId=619902&clcid=0x409" }
- ],
- "RelatedControls": [
- "StackPanel",
- "ListView",
- "GridView",
- "Grid",
- "RelativePanel"
- ]
- },
- {
- "UniqueId": "StackPanel",
- "Title": "StackPanel",
- "Subtitle": "A layout panel that arranges child elements into a single line that can be oriented horizontally or vertically.",
- "ImagePath": "ms-appx:///Assets/StackPanel.png",
- "Description": "A StackPanel is used to arrange items in a line, either horizontally or vertically.",
- "Content": "
Look at the StackPanelPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "StackPanel", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.stackpanel.aspx" },
- { "Title": "Quickstart: Adding layout controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh969155.aspx" }
- ],
- "RelatedControls": [
- "Border",
- "Canvas",
- "Grid",
- "VariableSizedWrapGrid",
- "RelativePanel"
- ]
- },
- {
- "UniqueId": "VariableSizedWrapGrid",
- "Title": "VariableSizedWrapGrid",
- "Subtitle": "A layout panel that supports arranging child elements in rows and columns. Each child element can span multiple rows and columns.",
- "ImagePath": "ms-appx:///Assets/VariableSizedWrapGrid.png",
- "Description": "A VariableSizedWrapGrip is used to create grid layouts where content can span multiple rows and columns.",
- "Content": "
Elements are arranged in rows or columns that automatically wrap to a new row or column when the MaximumRowsOrColumns value is reached.
Whether elements are arranged in rows or columns is specified by the Orientation property.
Elements can span multiple rows and columns using VariableSizedWrapGrid.RowSpan and VariableSizedWrapGrid.ColumnSpan attached properties.
Elements are sized as specified by the ItemHeight and ItemWidth properties.
Look at the VariableSizedWrapGridPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "VariableSizedWrapGrid", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.variablesizedwrapgrid.aspx" },
- { "Title": "Quickstart: Adding layout controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh969155.aspx" }
- ],
- "RelatedControls": [
- "Border",
- "Canvas",
- "Grid",
- "StackPanel",
- "RelativePanel"
- ]
- },
- {
- "UniqueId": "ViewBox",
- "Title": "ViewBox",
- "Subtitle": "A container control that scales its content to a specified size.",
- "ImagePath": "ms-appx:///Assets/ViewBox.png",
- "Description": "Use a ViewBox control scale content up or down to a specified size.",
- "Content": "
Look at the ViewBoxPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [ { "Title": "Viewbox", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.viewbox.aspx" } ],
- "RelatedControls": [
- "ScrollViewer",
- "Canvas",
- "Grid",
- "StackPanel",
- "RelativePanel"
- ]
- }
- ]
+ "UniqueId": "ListView",
+ "Title": "ListView",
+ "Subtitle": "Presents a collection of items in a list that can scroll vertically.",
+ "ImagePath": "ms-appx:///Assets/ListView.png",
+ "Description": "The ListView lets you show a collection of items in a list that scrolls vertically.",
+ "Content": "
ListView is an ItemsControl, so it can contain a collection of items of any type. To populate the view, add items to the Items collection, or set the ItemsSource property to a data source.
Set an ItemTemplate to define the look of individual items.
Look at the ListViewPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "ListView",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listview.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding ListView and GridView controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780650.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "GridView",
+ "FlipView",
+ "SemanticZoom",
+ "Hub"
+ ]
},
{
- "UniqueId": "Progress",
- "Title": "Progress controls",
- "Subtitle": "ProgressBar, ProgressRing",
- "ImagePath": "ms-appx:///Assets/ProgressBar.png",
- "Description": "Use progress controls to graphically represent ongoing activity or the progress of a task.",
- "Items": [
- {
- "UniqueId": "ProgressBar",
- "Title": "ProgressBar",
- "Subtitle": "Shows the apps progress on a task, or that the app is performing ongoing work that doesn't block user interaction.",
- "ImagePath": "ms-appx:///Assets/ProgressBar.png",
- "Description": "The ProgressBar has two different visual representations:\nIndeterminate - shows that a task is ongoing, but doesn't block user interaction.\nDeterminate - shows how much progress has been made on a known amount of work.",
- "Content": "
Look at the ProgressBarPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "ProgressBar", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.button.aspx" },
- { "Title": "Quickstart: Adding progress controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780651.aspx" },
- { "Title": "Guidelines", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780631.aspx" }
- ],
- "RelatedControls": [
- "ProgressRing"
- ]
- },
- {
- "UniqueId": "ProgressRing",
- "Title": "ProgressRing",
- "Subtitle": "Shows that the app is performing ongoing work that blocks user interaction.",
- "ImagePath": "ms-appx:///Assets/ProgressRing.png",
- "Description": "Use a ProgressRing to show that the app is performing ongoing work that blocks user interaction.",
- "Content": "
Look at the ProgressRingPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "ProgressRing", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.progressring.aspx" },
- { "Title": "Quickstart: Adding progress controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780651.aspx" },
- { "Title": "Guidelines", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780631.aspx" }
- ],
- "RelatedControls": [
- "ProgressBar"
- ]
- }
- ]
+ "UniqueId": "PullToRefresh",
+ "Title": "Pull to refresh",
+ "Subtitle": "Touch gesture for dragging down to fetch new data.",
+ "ImagePath": "ms-appx:///Assets/PullToRefresh.png",
+ "Description": "Touch gesture for dragging down to fetch new data.",
+ "Content": "",
+ "IsNew": true,
+ "Docs": [
+ {
+ "Title": "RefreshContainer",
+ "Uri": "https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.RefreshContainer"
+ },
+ {
+ "Title": "RefreshVisualizer",
+ "Uri": "https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.RefreshVisualizer"
+ }
+ ],
+ "RelatedControls": [
+ "GridView",
+ "ListView",
+ "TreeView"
+ ]
},
{
- "UniqueId": "Selection",
- "Title": "Selection and picker controls",
- "Subtitle": "CheckBox, ComboBox, DatePicker, ListBox, RadioButton, Slider, TimePicker, ToggleSwitch",
- "ImagePath": "ms-appx:///Assets/CheckBox.png",
- "Description": "Use selection controls to let a user set a value or choose between various options.",
- "Items": [
- {
- "UniqueId": "CalendarView",
- "Title": "CalendarView",
- "Subtitle": "A control that presents a calendar for a user to choose a date from.",
- "ImagePath": "ms-appx:///Assets/CalendarView.png",
- "Description": "CalendarView shows a larger view for showing and selecting dates. DatePicker by contrast has a compact view with inline selection.",
- "Content": "
Look at the CalendarView.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "CalendarView", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.calendarview.aspx" }
- ],
- "RelatedControls": [
- "DatePicker",
- "TimePicker"
- ]
- },
- {
- "UniqueId": "CheckBox",
- "Title": "CheckBox",
- "Subtitle": "A control that a user can select or clear.",
- "ImagePath": "ms-appx:///Assets/CheckBox.png",
- "Description": "CheckBox controls let the user select a combination of binary options. In contrast, RadioButton controls allow the user to select from mutually exclusive options. The indeterminate state is used to indicate that an option is set for some, but not all, child options. Don't allow users to set an indeterminate state directly to indicate a third option.",
- "Content": "
Check and uncheck these controls to see how they look in each state. The label for each CheckBox is defined by its Content property.
Use a three-state CheckBox to show that none, some, or all of an items sub-options are checked. You have to add some code to do this. Take a look at the methods in the SelectAllMethods region of CheckBoxPage.xaml.cs to see how we did it.
",
- "Docs": [ { "Title": "CheckBox", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.checkbox.aspx" } ],
- "RelatedControls": [
- "RadioButton",
- "ToggleSwitch",
- "ToggleButton"
- ]
- },
- {
- "UniqueId": "ComboBox",
- "Title": "ComboBox",
- "Subtitle": "A drop-down list of items a user can select from.",
- "ImagePath": "ms-appx:///Assets/ComboBox.png",
- "Description": "Use a ComboBox when you need to conserve on-screen space and when users select only one option at a time. A ComboBox shows only the currently selected item.",
- "Content": "
Look at the ComboBoxPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "ComboBox", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.combobox.aspx" },
- { "Title": "ComboBoxItem", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.comboboxitem.aspx" }
- ],
- "RelatedControls": [
- "ListBox",
- "RadioButton",
- "CheckBox",
- "ListView",
- "AutoSuggestBox"
- ]
- },
- {
- "UniqueId": "DatePicker",
- "Title": "DatePicker",
- "Subtitle": "A configurable control that lets a user pick a date value.",
- "ImagePath": "ms-appx:///Assets/DatePicker.png",
- "Description": "Use a DatePicker to let users set a date in your app, for example to schedule an appointment. The DatePicker displays three controls for month, date, and year. These controls are easy to use with touch or mouse, and they can be styled and configured in several different ways.",
- "Content": "
Look at the DatePickerPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "DatePicker", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.datepicker.aspx" },
- { "Title": "Quickstart: Adding a DatePicker", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/dn308514.aspx" }
- ],
- "RelatedControls": [
- "TimePicker",
- "CalendarView"
- ]
- },
- {
- "UniqueId": "ListBox",
- "Title": "ListBox",
- "Subtitle": "A control that presents an inline list of items that the user can select from.",
- "ImagePath": "ms-appx:///Assets/ListBox.png",
- "Description": "Use a ListBox when you want the options to be visible all the time or when users can select more than one option at a time. ListBox controls are always open, which allows several items to be displayed to the user without user interaction.",
- "Content": "
Look at the ListBoxPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "ListBox", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listbox.aspx" },
- { "Title": "ListBoxItem", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.listboxitem.aspx" }
- ],
- "RelatedControls": [
- "ComboBox",
- "RadioButton",
- "CheckBox",
- "AutoSuggestBox"
- ]
- },
- {
- "UniqueId": "RadioButton",
- "Title": "RadioButton",
- "Subtitle": "A control that allows a user to select a single option from a group of options. When radio buttons are grouped together they are mutually exclusive.",
- "ImagePath": "ms-appx:///Assets/RadioButton.png",
- "Description": "Use RadioButtons to let a user choose between mutually exclusive, related options.",
- "Content": "
Look at the RadioButtonPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [ { "Title": "RadioButton", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.radiobutton.aspx" } ],
- "RelatedControls": [
- "CheckBox",
- "ToggleSwitch",
- "ToggleButton"
- ]
- },
- {
- "UniqueId": "Slider",
- "Title": "Slider",
- "Subtitle": "A control that lets the user select from a range of values by moving a Thumb control along a track.",
- "ImagePath": "ms-appx:///Assets/Slider.png",
- "Description": "Use a Slider when you want your users to be able to set defined, contiguous values (such as volume or brightness) or a range of discrete values (such as screen resolution settings).",
- "Content": "
Look at the SliderPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [ { "Title": "Slider", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.slider.aspx" } ],
- "RelatedControls": [
- "ComboBox",
- "ListBox"
- ]
- },
- {
- "UniqueId": "TimePicker",
- "Title": "TimePicker",
- "Subtitle": "A configurable control that lets a user pick a time value.",
- "ImagePath": "ms-appx:///Assets/TimePicker.png",
- "Description": "Use a TimePicker to let users set a time in your app, for example to set a reminder. The TimePicker displays three controls for month, day, and and AM/PM. These controls are easy to use with touch or mouse, and they can be styled and configured in several different ways.",
- "Content": "
Look at the TimePickerPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "TimePicker", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.timepicker.aspx" },
- { "Title": "Quickstart: Adding a TimePicker", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/dn308517.aspx" }
- ],
- "RelatedControls": [
- "DatePicker",
- "CalendarView"
- ]
- },
- {
- "UniqueId": "ToggleSwitch",
- "Title": "ToggleSwitch",
- "Subtitle": "A switch that can be toggled between 2 states.",
- "ImagePath": "ms-appx:///Assets/ToggleSwitch.png",
- "Description": "Use ToggleSwitch controls to present users with exactly two mutually exclusive options (like on/off), where choosing an option results in an immediate commit. A toggle switch should have a single label.",
- "Content": "
Look at the ToggleSwitchPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [ { "Title": "ToggleSwitch", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.toggleswitch.aspx" } ],
- "RelatedControls": [
- "ToggleButton",
- "RadioButton",
- "Checkbox",
- "AppBarToggleButton"
- ]
- }
- ]
+ "UniqueId": "SemanticZoom",
+ "Title": "SemanticZoom",
+ "Subtitle": "Lets the user zoom between two different views of a collection, making it easier to navigate through large collections of items.",
+ "ImagePath": "ms-appx:///Assets/DefaultIcon.png",
+ "Description": "The SemanticZoom lets you show grouped data in two different ways, and is useful for quickly navigating through large sets of data.",
+ "Content": "
Look at the SemanticZoomPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "SemanticZoom",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.semanticzoom.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding SemanticZoom controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh781234.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "GridView",
+ "ListView",
+ "Hub"
+ ]
},
{
- "UniqueId": "Text",
- "Title": "Text controls",
- "Subtitle": "AutoSuggestBox, PasswordBox, RichEditBox, RichTextBlock, TextBlock, TextBox",
- "ImagePath": "ms-appx:///Assets/TextBox.png",
- "Description": "Use text controls to display or edit plain text and other rich content.",
- "Items": [
- {
- "UniqueId": "AutoSuggestBox",
- "Title": "AutoSuggestBox",
- "Subtitle": "A control to provide suggestions as a user is typing.",
- "ImagePath": "ms-appx:///Assets/AutoSuggestBox.png",
- "Description": "A text control that makes suggestions to users as they type. The app is notified when text has been changed by the user and is responsible for providing relevant suggestions for this control to display.",
- "Content": "
Look at the AutoSuggestBoxPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "AutoSuggestBox", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.autosuggestbox.aspx" }
- ],
- "RelatedControls": [
- "ListBox",
- "ComboBox",
- "TextBox"
- ]
- },
- {
- "UniqueId": "PasswordBox",
- "Title": "PasswordBox",
- "Subtitle": "A control for entering passwords.",
- "ImagePath": "ms-appx:///Assets/PasswordBox.png",
- "Description": "A user can enter a single line of non-wrapping text in a PasswordBox control. The text is masked by characters that you can specify by using the PasswordChar property, and you can specify the maximum number of characters that the user can enter by setting the MaxLength property.",
- "Content": "
Look at the PasswordBoxPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "PasswordBox", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.passwordbox.aspx" },
- { "Title": "Quickstart: Adding text input and editing controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh700391.aspx" }
- ],
- "RelatedControls": [
- "TextBox",
- "TextBlock",
- "RichTextBlock",
- "RichEditBox"
- ]
- },
- {
- "UniqueId": "RichEditBox",
- "Title": "RichEditBox",
- "Subtitle": "A rich text editing control that supports formatted text, hyperlinks, and other rich content.",
- "ImagePath": "ms-appx:///Assets/RichEditBox.png",
- "Description": "You can use a RichEditBox control to enter and edit rich text documents that contain formatted text, hyperlinks, and images. By default, the RichEditBox supports spell checking. You can make a RichEditBox read-only by setting its IsReadOnly property to true.",
- "Content": "
On this page, you can type into the RichTextBox control and save it as a RichTextFormat (.rtf) document, or load an existing .rtf document. You can format the text as Bold or Underlined, and change the text color.
Look at the RichEditBoxPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "RichEditBox", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.richeditbox.aspx" },
- { "Title": "Quickstart: Adding text input and editing controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh700391.aspx" }
- ],
- "RelatedControls": [
- "TextBox",
- "RichTextBlock",
- "TextBlock"
- ]
- },
- {
- "UniqueId": "RichTextBlock",
- "Title": "RichTextBlock",
- "Subtitle": "A control that displays formatted text, hyperlinks, inline images, and other rich content.",
- "ImagePath": "ms-appx:///Assets/RichTextBlock.png",
- "Description": "RichTextBlock provides more advanced formatting features than the TextBlock control. You can apply character and paragraph formatting to the text in the RichTextBlock. For example, you can apply Bold, Italic, and Underline to any portion of the text in the control. You can use linked text containers (a RichTextBlock linked to RichTextBlockOverflow elements) to create advanced page layouts.",
- "Content": "
Change the width of the app to see how the RichTextBlock overflows into additional columns as the app gets narrower.
Look at the RichTextBlockPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "RichTextBlock", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.richtextblock.aspx" },
- { "Title": "Quickstart: Displaying text", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh700392.aspx" }
- ],
- "RelatedControls": [
- "TextBlock",
- "TextBox",
- "PasswordBox",
- "RichEditBox"
- ]
- },
- {
- "UniqueId": "TextBlock",
- "Title": "TextBlock",
- "Subtitle": "A lightweight control for displaying small amounts of text.",
- "ImagePath": "ms-appx:///Assets/TextBlock.png",
- "Description": "TextBlock is the primary control for displaying read-only text in your app. You typically display text by setting the Text property to a simple string. You can also display a series of strings in Run elements and give each different formatting.",
- "Content": "
Look at the TextBlockPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "TextBlock", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.textblock.aspx" },
- { "Title": "Quickstart: Displaying text", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh700392.aspx" }
- ],
- "RelatedControls": [
- "TextBox",
- "RichTextBlock",
- "PasswordBox",
- "RichEditBox"
- ]
- },
- {
- "UniqueId": "TextBox",
- "Title": "TextBox",
- "Subtitle": "A single-line or multi-line plain text field.",
- "ImagePath": "ms-appx:///Assets/TextBox.png",
- "Description": "Use a TextBox to let a user enter simple text input in your app. You can add a header and placeholder text to let the user know what the TextBox is for, and you can customize it in other ways.",
- "Content": "
Look at the TextBoxPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "TextBox", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.textbox.aspx" },
- { "Title": "Quickstart: Adding text input and editing controls", "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh700391.aspx" }
- ],
- "RelatedControls": [
- "TextBlock",
- "RichTextBlock",
- "PasswordBox",
- "RichEditBox",
- "AutoSuggestBox"
- ]
- }
- ]
+ "UniqueId": "TreeView",
+ "Title": "TreeView",
+ "Subtitle": "A hierarchical list with expanding and collapsing nodes that contain nested items.",
+ "ImagePath": "ms-appx:///Assets/TreeView.png",
+ "Description": "A hierarchical list with expanding and collapsing nodes that contain nested items.",
+ "Content": "",
+ "IsNew": true,
+ "Docs": [
+ {
+ "Title": "TreeView",
+ "Uri": "https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.TreeView"
+ }
+ ],
+ "RelatedControls": [
+ "ListView",
+ "GridView"
+ ]
+ }
+ ]
+ },
+ {
+ "UniqueId": "DataInput",
+ "Title": "Data Input",
+ "Subtitle": "CheckBox, ComboBox, DatePicker, ListBox, RadioButton, Slider, TimePicker, ToggleSwitch",
+ "ImagePath": "ms-appx:///Assets/NavigationViewItemIcons/PickerIcon.png",
+ "Description": "Use selection controls to let a user set a value or choose between various options.",
+ "Items": [
+ {
+ "UniqueId": "CalendarDatePicker",
+ "Title": "CalendarDatePicker",
+ "Subtitle": "A control that lets users pick a date value using a calendar.",
+ "ImagePath": "ms-appx:///Assets/CalenderDatePicker.png",
+ "Description": "A control that lets users pick a date value using a calendar.",
+ "Content": "",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "CalendarDatePicker",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.calendarview.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "DatePicker",
+ "CalendarView"
+ ]
+ },
+ {
+ "UniqueId": "CalendarView",
+ "Title": "CalendarView",
+ "Subtitle": "A control that presents a calendar for a user to choose a date from.",
+ "ImagePath": "ms-appx:///Assets/CalendarView.png",
+ "Description": "CalendarView shows a larger view for showing and selecting dates. DatePicker by contrast has a compact view with inline selection.",
+ "Content": "
Look at the CalendarView.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "CalendarView",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.calendarview.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "CalendarDatePicker",
+ "DatePicker",
+ "TimePicker"
+ ]
+ },
+ {
+ "UniqueId": "CheckBox",
+ "Title": "CheckBox",
+ "Subtitle": "A control that a user can select or clear.",
+ "ImagePath": "ms-appx:///Assets/CheckBox.png",
+ "Description": "CheckBox controls let the user select a combination of binary options. In contrast, RadioButton controls allow the user to select from mutually exclusive options. The indeterminate state is used to indicate that an option is set for some, but not all, child options. Don't allow users to set an indeterminate state directly to indicate a third option.",
+ "Content": "
Check and uncheck these controls to see how they look in each state. The label for each CheckBox is defined by its Content property.
Use a three-state CheckBox to show that none, some, or all of an items sub-options are checked. You have to add some code to do this. Take a look at the methods in the SelectAllMethods region of CheckBoxPage.xaml.cs to see how we did it.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "CheckBox",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.checkbox.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "RadioButton",
+ "ToggleSwitch",
+ "ToggleButton"
+ ]
+ },
+ {
+ "UniqueId": "ColorPicker",
+ "Title": "ColorPicker",
+ "Subtitle": "A selectable color spectrum.",
+ "ImagePath": "ms-appx:///Assets/ColorPicker.png",
+ "Description": "A selectable color spectrum.",
+ "Content": "",
+ "IsNew": true,
+ "Docs": [
+ {
+ "Title": "ColorPicker",
+ "Uri": "https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.ColorPicker"
+ }
+ ],
+ "RelatedControls": [
+ "ComboBox"
+ ]
+ },
+ {
+ "UniqueId": "DatePicker",
+ "Title": "DatePicker",
+ "Subtitle": "A configurable control that lets a user pick a date value.",
+ "ImagePath": "ms-appx:///Assets/DatePicker.png",
+ "Description": "Use a DatePicker to let users set a date in your app, for example to schedule an appointment. The DatePicker displays three controls for month, date, and year. These controls are easy to use with touch or mouse, and they can be styled and configured in several different ways.",
+ "Content": "
Look at the DatePickerPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "DatePicker",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.datepicker.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding a DatePicker",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/dn308514.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "CalendarDatePicker",
+ "CalendarView",
+ "TimePicker"
+ ]
+ },
+ {
+ "UniqueId": "RadioButton",
+ "Title": "RadioButton",
+ "Subtitle": "A control that allows a user to select a single option from a group of options. When radio buttons are grouped together they are mutually exclusive.",
+ "ImagePath": "ms-appx:///Assets/RadioButton.png",
+ "Description": "Use RadioButtons to let a user choose between mutually exclusive, related options.",
+ "Content": "
Look at the RadioButtonPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "RadioButton",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.radiobutton.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "CheckBox",
+ "ToggleSwitch",
+ "ToggleButton"
+ ]
+ },
+ {
+ "UniqueId": "RatingsControl",
+ "Title": "RatingsControl",
+ "Subtitle": "Rate something 1 to 5 stars.",
+ "ImagePath": "ms-appx:///Assets/RatingControl.png",
+ "Description": "Rate something 1 to 5 stars.",
+ "Content": "",
+ "IsNew": true,
+ "Docs": [
+ {
+ "Title": "RatingsControl",
+ "Uri": "https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.RatingsControl"
+ }
+ ],
+ "RelatedControls": [
+ "Slider",
+ "ComboBox"
+ ]
+ },
+ {
+ "UniqueId": "Slider",
+ "Title": "Slider",
+ "Subtitle": "A control that lets the user select from a range of values by moving a Thumb control along a track.",
+ "ImagePath": "ms-appx:///Assets/Slider.png",
+ "Description": "Use a Slider when you want your users to be able to set defined, contiguous values (such as volume or brightness) or a range of discrete values (such as screen resolution settings).",
+ "Content": "
Look at the SliderPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "Slider",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.slider.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ComboBox",
+ "ListBox",
+ "RatingsControl"
+ ]
+ },
+ {
+ "UniqueId": "TimePicker",
+ "Title": "TimePicker",
+ "Subtitle": "A configurable control that lets a user pick a time value.",
+ "ImagePath": "ms-appx:///Assets/TimePicker.png",
+ "Description": "Use a TimePicker to let users set a time in your app, for example to set a reminder. The TimePicker displays three controls for month, day, and and AM/PM. These controls are easy to use with touch or mouse, and they can be styled and configured in several different ways.",
+ "Content": "
Look at the TimePickerPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "TimePicker",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.timepicker.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding a TimePicker",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/dn308517.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "DatePicker",
+ "CalendarView"
+ ]
+ },
+ {
+ "UniqueId": "ToggleSwitch",
+ "Title": "ToggleSwitch",
+ "Subtitle": "A switch that can be toggled between 2 states.",
+ "ImagePath": "ms-appx:///Assets/ToggleSwitch.png",
+ "Description": "Use ToggleSwitch controls to present users with exactly two mutually exclusive options (like on/off), where choosing an option results in an immediate commit. A toggle switch should have a single label.",
+ "Content": "
Look at the ToggleSwitchPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "ToggleSwitch",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.toggleswitch.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ToggleButton",
+ "RadioButton",
+ "CheckBox",
+ "AppBarToggleButton"
+ ]
+ }
+ ]
+ },
+ {
+ "UniqueId": "Indicators",
+ "Title": "Indicators",
+ "Subtitle": "ProgressBar, ProgressRing",
+ "ImagePath": "ms-appx:///Assets/NavigationViewItemIcons/ProgressIcon.png",
+ "Description": "Use progress controls to graphically represent ongoing activity or the progress of a task.",
+ "Items": [
+ {
+ "UniqueId": "ProgressBar",
+ "Title": "ProgressBar",
+ "Subtitle": "Shows the apps progress on a task, or that the app is performing ongoing work that doesn't block user interaction.",
+ "ImagePath": "ms-appx:///Assets/ProgressBar.png",
+ "Description": "The ProgressBar has two different visual representations:\nIndeterminate - shows that a task is ongoing, but doesn't block user interaction.\nDeterminate - shows how much progress has been made on a known amount of work.",
+ "Content": "
Look at the ProgressBarPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "ProgressBar",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.button.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding progress controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780651.aspx"
+ },
+ {
+ "Title": "Guidelines",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780631.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ProgressRing"
+ ]
+ },
+ {
+ "UniqueId": "ProgressRing",
+ "Title": "ProgressRing",
+ "Subtitle": "Shows that the app is performing ongoing work that blocks user interaction.",
+ "ImagePath": "ms-appx:///Assets/ProgressRing.png",
+ "Description": "Use a ProgressRing to show that the app is performing ongoing work that blocks user interaction.",
+ "Content": "
Look at the ProgressRingPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "ProgressRing",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.progressring.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding progress controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780651.aspx"
+ },
+ {
+ "Title": "Guidelines",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh780631.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ProgressBar"
+ ]
+ }
+ ]
+ },
+ {
+ "UniqueId": "Layout",
+ "Title": "Layout controls",
+ "Subtitle": "Border, Canvas, Grid, RelativePanel, ScrollViewer, SplitView, StackPanel, VariableSizedWrapGrid, ViewBox",
+ "ImagePath": "\uE80A",
+ "Description": "Use layout controls to arrange the controls and content in your app.",
+ "Items": [
+ {
+ "UniqueId": "Border",
+ "Title": "Border",
+ "Subtitle": "A container control that draws a boundary line, background, or both, around another object.",
+ "ImagePath": "ms-appx:///Assets/Border.png",
+ "Description": "Use a Border control to draw a boundary line, background, or both, around another object. A Border can contain only one child object.",
+ "Content": "
A Border can contain only one child object. If you want to put a border around multiple objects, first wrap them in a container object such as StackPanel and make the StackPanel the child of the Border.
You can change the appearance of a Border by setting basic properties:
Width/Height
BorderBrush
BorderThickness
Background
Most of the control pages in this app have XAML blocks to show basic usage. The appearance of the XAML blocks is defined by a Border control. Look at the CodeBorderStyle resource in App.xaml to see the Style that's applied to the Borders.
Look at the BorderPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "Border",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.border.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding layout controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh969155.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Canvas",
+ "Grid",
+ "StackPanel",
+ "VariableSizedWrapGrid",
+ "RelativePanel"
+ ]
+ },
+ {
+ "UniqueId": "Canvas",
+ "Title": "Canvas",
+ "Subtitle": "A layout panel that supports absolute positioning of child elements relative to the top left corner of the canvas.",
+ "ImagePath": "ms-appx:///Assets/Canvas.png",
+ "Description": "The Canvas provides absolute positioning of controls or content. Content is positioned relative to the Canvas using the Canvas.Top and Canvas.Left attached properties.",
+ "Content": "
Items are positioned on the Canvas using the Canvas.Top and Canvas.Left attached properties. Use the sliders to change these properties for the red rectangle and see how it moves around.
To see the effect of the ZIndex attached property, make sure the red rectangle is overlapping the other rectangles.
Look at the CanvasPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "Canvas",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.canvas.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding layout controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh969155.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Border",
+ "Grid",
+ "StackPanel",
+ "VariableSizedWrapGrid",
+ "RelativePanel"
+ ]
+ },
+ {
+ "UniqueId": "Flyout",
+ "Title": "Flyout",
+ "Subtitle": "Shows contextual information and enables user interaction.",
+ "ImagePath": "ms-appx:///Assets/Flyout.png",
+ "Description": "A Flyout displays lightweight UI that is either information, or requires user interaction. Unlike a dialog, a Flyout can be light dismissed by clicking or tapping off of it. Use it to collect input from the user, show more details about an item, or ask the user to confirm an action.",
+ "Content": "
Look at the FlyoutPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "Flyout",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.flyout.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding a Flyout",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/dn308515.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ContentDialog",
+ "MenuFlyout",
+ "Button",
+ "AppBarButton"
+ ]
+ },
+ {
+ "UniqueId": "Grid",
+ "Title": "Grid",
+ "Subtitle": "A layout panel that supports arranging child elements in rows and columns. ",
+ "ImagePath": "ms-appx:///Assets/Grid.png",
+ "Description": "The Grid is used to arrange controls and content in rows and columns. Content is positioned in the grid using Grid.Row and Grid.Column attached properties.",
+ "Content": "
Look at the GridPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "Grid",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.grid.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding layout controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh969155.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Border",
+ "Canvas",
+ "StackPanel",
+ "VariableSizedWrapGrid",
+ "RelativePanel"
+ ]
+ },
+ {
+ "UniqueId": "ParallaxView",
+ "Title": "ParallaxView",
+ "Subtitle": "A container control that provides the parallax effect when scrolling.",
+ "ImagePath": "ms-appx:///Assets/ParallaxView.png",
+ "Description": "A container control that provides the parallax effect when scrolling.",
+ "Content": "",
+ "IsNew": true,
+ "Docs": [
+ {
+ "Title": "ParallaxView",
+ "Uri": "https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.Parallaxview"
+ }
+ ],
+ "RelatedControls": [
+ "ScrollViewer"
+ ]
+ },
+ {
+ "UniqueId": "RelativePanel",
+ "Title": "RelativePanel",
+ "Subtitle": "A panel that uses relationships between elements to define layout.",
+ "ImagePath": "ms-appx:///Assets/RelativePanel.png",
+ "Description": "Use a RelativePanel to layout elements by defining the relationships between elements and in relation to the panel.",
+ "Content": "
Look at the RelativePanelPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "RelativePanel",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.relativepanel.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Grid",
+ "StackPanel",
+ "Border",
+ "Canvas",
+ "ViewBox"
+ ]
},
{
- "UniqueId": "MediaInk",
- "Title": "Media and ink controls",
- "Subtitle": "Image, InkCanvas, MediaElement",
- "ImagePath": "ms-appx:///Assets/Image.png",
- "Description": "Use media controls to display images and videos. Use ink to capture strokes and display them.",
- "Items": [
- {
- "UniqueId": "Image",
- "Title": "Image",
- "Subtitle": "A control to display image content.",
- "ImagePath": "ms-appx:///Assets/Image.png",
- "Description": "You can use an Image control to show and scale images.",
- "Content": "
Look at the ImagePage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "Image", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.image.aspx" },
- { "Title": "Quickstart: Image and ImageBrush", "Uri": "https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868203.aspx" }
- ],
- "RelatedControls": [
- "MediaElement"
- ]
- },
- {
- "UniqueId": "InkCanvas",
- "Title": "InkCanvas",
- "Subtitle": "A control to capture and display strokes.",
- "ImagePath": "ms-appx:///Assets/InkCanvas.png",
- "Description": "You can use an InkCanvas to capture strokes and display them. You can also change the way the strokes are displayed through the InkDrawingAttributes.",
- "Content": "
Look at the InkCanvasPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "InkCanvas", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.inkcanvas.aspx" }
- ],
- "RelatedControls": [
- "Canvas"
- ]
- },
- {
- "UniqueId": "MediaElement",
- "Title": "MediaElement",
- "Subtitle": "A control to display video and image content.",
- "ImagePath": "ms-appx:///Assets/MediaElement.png",
- "Description": "You can use a MediaElement control to playback videos and show images. You can show transport controls or make the video autoplay.",
- "Content": "
Look at the MediaElementPage.xaml file in Visual Studio to see the full code for this page.
",
- "Docs": [
- { "Title": "Image", "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.image.aspx" },
- { "Title": "Quickstart: video and audio", "Uri": "https://msdn.microsoft.com/en-us/library/windows/apps/hh465160.aspx" },
- { "Title": "Quickstart: create custom transport controls", "Uri": "https://msdn.microsoft.com/en-us/library/windows/apps/hh986967.aspx" }
- ],
- "RelatedControls": [
- "Image"
- ]
- }
+ "UniqueId": "ScrollViewer",
+ "Title": "ScrollViewer",
+ "Subtitle": "A container control that lets the user pan and zoom its content.",
+ "ImagePath": "ms-appx:///Assets/ScrollViewer.png",
+ "Description": "A ScrollViewer lets a user scroll, pan, and zoom to see content that's larger than the viewable area. Many content controls, like ListView, have ScrollViewers built into their control templates to provide automatic scrolling.",
+ "Content": "
Look at the ScrollViewerPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "ScrollViewer",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.scrollviewer.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ViewBox",
+ "Canvas",
+ "Grid",
+ "StackPanel",
+ "RelativePanel",
+ "ParallaxView"
+ ]
+ },
+ {
+ "UniqueId": "SplitView",
+ "Title": "SplitView",
+ "Subtitle": "A container that has 2 content areas, with multiple display options for the pane.",
+ "ImagePath": "ms-appx:///Assets/SplitView.png",
+ "Description": "Use a SplitView to display content, such as navigation options, in a pane on the side. There are multiple options for displaying the pane, namely CompactOverlay, Compact, Overlay, Inline. If you are looking for a reference to the hamburger pattern, please see the links in the documentation below.",
+ "Content": "
Look at the SplitViewPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "SplitView",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.splitview.aspx"
+ },
+ {
+ "Title": "Hamburger pattern",
+ "Uri": "http://go.microsoft.com/fwlink/p/?LinkId=619902&clcid=0x409"
+ }
+ ],
+ "RelatedControls": [
+ "StackPanel",
+ "ListView",
+ "GridView",
+ "Grid",
+ "RelativePanel"
+ ]
+ },
+ {
+ "UniqueId": "StackPanel",
+ "Title": "StackPanel",
+ "Subtitle": "A layout panel that arranges child elements into a single line that can be oriented horizontally or vertically.",
+ "ImagePath": "ms-appx:///Assets/StackPanel.png",
+ "Description": "A StackPanel is used to arrange items in a line, either horizontally or vertically.",
+ "Content": "
Look at the StackPanelPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "StackPanel",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.stackpanel.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding layout controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh969155.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Border",
+ "Canvas",
+ "Grid",
+ "VariableSizedWrapGrid",
+ "RelativePanel"
+ ]
+ },
+ {
+ "UniqueId": "ToolTip",
+ "Title": "ToolTip",
+ "Subtitle": "Displays information for an element in a pop-up window.",
+ "ImagePath": "ms-appx:///Assets/ToolTip.png",
+ "Description": "A ToolTip shows more information about a UI element. You might show information about what the element does, or what the user should do. The ToolTip is shown when a user hovers over or presses and holds the UI element.",
+ "Content": "
Look at the ToolTipPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "ToolTip",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.tooltip.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Flyout",
+ "ContentDialog"
+ ]
+ },
+ {
+ "UniqueId": "VariableSizedWrapGrid",
+ "Title": "VariableSizedWrapGrid",
+ "Subtitle": "A layout panel that supports arranging child elements in rows and columns. Each child element can span multiple rows and columns.",
+ "ImagePath": "ms-appx:///Assets/VariableSizedWrapGrid.png",
+ "Description": "A VariableSizedWrapGrip is used to create grid layouts where content can span multiple rows and columns.",
+ "Content": "
Elements are arranged in rows or columns that automatically wrap to a new row or column when the MaximumRowsOrColumns value is reached.
Whether elements are arranged in rows or columns is specified by the Orientation property.
Elements can span multiple rows and columns using VariableSizedWrapGrid.RowSpan and VariableSizedWrapGrid.ColumnSpan attached properties.
Elements are sized as specified by the ItemHeight and ItemWidth properties.
Look at the VariableSizedWrapGridPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "VariableSizedWrapGrid",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.variablesizedwrapgrid.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding layout controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh969155.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Border",
+ "Canvas",
+ "Grid",
+ "StackPanel",
+ "RelativePanel"
+ ]
+ },
+ {
+ "UniqueId": "ViewBox",
+ "Title": "ViewBox",
+ "Subtitle": "A container control that scales its content to a specified size.",
+ "ImagePath": "ms-appx:///Assets/ViewBox.png",
+ "Description": "Use a ViewBox control scale content up or down to a specified size.",
+ "Content": "
Look at the ViewBoxPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "Viewbox",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.viewbox.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ScrollViewer",
+ "Canvas",
+ "Grid",
+ "StackPanel",
+ "RelativePanel"
+ ]
+ }
+ ]
+ },
+ {
+ "UniqueId": "Navigation",
+ "Title": "Navigation",
+ "Subtitle": "Button, HyperlinkButton, RepeatButton, ToggleButton",
+ "ImagePath": "\uE700",
+ "Description": "Use button controls to let users perform an action, like submitting a form or showing a menu.",
+ "Items": [
+ {
+ "UniqueId": "Hub",
+ "Title": "Hub",
+ "Subtitle": "Presents information from different sources in a scrollable view.",
+ "ImagePath": "ms-appx:///Assets/Hub.png",
+ "Description": "Use a Hub to display information from different source in a single scrollable view. Hub can also be used to show categorical information in a separated section format.",
+ "Content": "
This page shows a simplified Hub control with minimal content to demonstrate basic Hub usage. Look at the HubPage.xaml file in Visual Studio to see the full code for this page.
A Hub control typically takes up the full page. The app home uses a more fully implemented Hub that demonstrates this. Look at the MainPage.xaml file in Visual Studio to see the full code for the home page Hub.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "Hub",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.hub.aspx"
+ },
+ {
+ "Title": "HubSection",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.hubsection.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Pivot",
+ "SemanticZoom",
+ "ListView",
+ "GridView"
+ ]
+ },
+ {
+ "UniqueId": "NavigationView",
+ "Title": "NavigationView",
+ "Subtitle": "Common vertical layout for top-level areas of your app via a collapsible navigation menu.",
+ "ImagePath": "ms-appx:///Assets/NavigationView.png",
+ "Description": "The navigation view control provides a common vertical layout for top-level areas of your app via a collapsible navigation menu.",
+ "Content": "",
+ "IsNew": true,
+ "Docs": [
+ {
+ "Title": "NavigationView",
+ "Uri": "https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.NavigationView"
+ }
+ ],
+ "RelatedControls": [
+ "SplitView",
+ "Pivot"
+ ]
+ },
+ {
+ "UniqueId": "Pivot",
+ "Title": "Pivot",
+ "Subtitle": "Presents information from different sources in a tabbed view.",
+ "ImagePath": "ms-appx:///Assets/Pivot.png",
+ "Description": "A Pivot allows you to show a collection of items from different sources in a tabbed view.",
+ "Content": "
This page shows a simplified Pivot control with minimal content to demonstrate basic Pivot usage. Look at the PivotPage.xaml file in Visual Studio to see the full code for this page.
A Pivot control typically takes up the full page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "Pivot",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.pivot.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Hub",
+ "SemanticZoom",
+ "ListView",
+ "GridView"
+ ]
+ }
+ ]
+ },
+ {
+ "UniqueId": "RichContent",
+ "Title": "Rich Content",
+ "Subtitle": "Image, InkCanvas, MediaElement",
+ "ImagePath": "\uE102",
+ "Description": "Use media controls to display images and videos. Use ink to capture strokes and display them.",
+ "Items": [
+ {
+ "UniqueId": "Image",
+ "Title": "Image",
+ "Subtitle": "A control to display image content.",
+ "ImagePath": "ms-appx:///Assets/Image.png",
+ "Description": "You can use an Image control to show and scale images.",
+ "Content": "
Look at the ImagePage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "Image",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.image.aspx"
+ },
+ {
+ "Title": "Quickstart: Image and ImageBrush",
+ "Uri": "https://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868203.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "MediaElement",
+ "PersonPicture"
+ ]
+ },
+ {
+ "UniqueId": "InkCanvas",
+ "Title": "InkCanvas",
+ "Subtitle": "A control to capture and display strokes.",
+ "ImagePath": "ms-appx:///Assets/InkCanvas.png",
+ "Description": "You can use an InkCanvas to capture strokes and display them. You can also change the way the strokes are displayed through the InkDrawingAttributes.",
+ "Content": "
Look at the InkCanvasPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "InkCanvas",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.inkcanvas.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Canvas",
+ "InkToolbar"
+ ]
+ },
+ {
+ "UniqueId": "InkToolbar",
+ "Title": "InkToolbar*",
+ "Subtitle": "A collection of buttons that activate features in an associated InkCanvas.",
+ "ImagePath": "ms-appx:///Assets/InkCanvas.png",
+ "Description": "A collection of buttons that activate features in an associated InkCanvas.",
+ "Content": "",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "InkToolbar",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.inktoolbar.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "Canvas",
+ "InkCanvas"
+ ]
+ },
+ {
+ "UniqueId": "MapControl",
+ "Title": "MapControl*",
+ "Subtitle": "Displays an interactive map.",
+ "ImagePath": "ms-appx:///Assets/MapControl.png",
+ "Description": "Displays an interactive map.",
+ "Content": "",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "MapControl",
+ "Uri": "https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.maps.mapcontrol"
+ }
+ ],
+ "RelatedControls": [
+ "Image"
+ ]
+ },
+ {
+ "UniqueId": "MediaElement",
+ "Title": "MediaElement",
+ "Subtitle": "A control to display video and image content.",
+ "ImagePath": "ms-appx:///Assets/MediaElement.png",
+ "Description": "You can use a MediaElement control to playback videos and show images. You can show transport controls or make the video autoplay.",
+ "Content": "
Look at the MediaElementPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "MediaElement",
+ "Uri": "https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.mediaelement"
+ },
+ {
+ "Title": "Media Playback",
+ "Uri": "http://windowsstyleguide/controls-and-patterns/media-playback/"
+ }
+ ],
+ "RelatedControls": [
+ "Image",
+ "MediaPlayerElement"
+ ]
+ },
+ {
+ "UniqueId": "MediaPlayerElement",
+ "Title": "MediaPlayerElement",
+ "Subtitle": "A control to display video and image content.",
+ "ImagePath": "ms-appx:///Assets/MediaElement.png",
+ "Description": "This control is the newer version of MediaElement.",
+ "Content": "",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "MediaPlayerElement",
+ "Uri": "https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.MediaPlayerElement"
+ },
+ {
+ "Title": "Media Playback",
+ "Uri": "http://windowsstyleguide/controls-and-patterns/media-playback/"
+ }
+ ],
+ "RelatedControls": [
+ "Image",
+ "MediaElement"
+ ]
+ },
+ {
+ "UniqueId": "PersonPicture",
+ "Title": "PersonPicture",
+ "Subtitle": "Displays the picture of a person/contact.",
+ "ImagePath": "ms-appx:///Assets/PersonPicture.png",
+ "Description": "Displays the picture of a person/contact.",
+ "Content": "",
+ "IsNew": true,
+ "Docs": [
+ {
+ "Title": "PersonPicture",
+ "Uri": "https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.PersonPicture"
+ }
+ ],
+ "RelatedControls": [
+ "Image"
+ ]
+ },
+ {
+ "UniqueId": "WebView",
+ "Title": "WebView*",
+ "Subtitle": "Hosts HTML content in an app.",
+ "ImagePath": "ms-appx:///Assets/WebView.png",
+ "Description": "Hosts HTML content in an app.",
+ "Content": "",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "WebView",
+ "Uri": "https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.webview"
+ }
+ ],
+ "RelatedControls": [
+ "RichTextBlock"
+ ]
+ }
+ ]
+ },
+ {
+ "UniqueId": "Styles",
+ "Title": "Styles",
+ "Subtitle": "Acrylic and Reveal",
+ "ImagePath": "\uE2B1",
+ "Description": "Acrylic and Reveal",
+ "Items": [
+ {
+ "UniqueId": "Acrylic",
+ "Title": "Acrylic",
+ "Subtitle": "A translucent material recommended for panel backgrounds.",
+ "ImagePath": "ms-appx:///Assets/AcrylicBrush.png",
+ "Description": "A translucent material recommended for panel backgrounds.",
+ "Content": "",
+ "IsNew": true,
+ "Docs": [
+ {
+ "Title": "Acrylic",
+ "Uri": "https://docs.microsoft.com/windows/uwp/style/"
+ }
+ ],
+ "RelatedControls": [
+ "Reveal"
+ ]
+ },
+ {
+ "UniqueId": "Reveal",
+ "Title": "Reveal",
+ "Subtitle": "A material that changes color near the mouse.",
+ "ImagePath": "ms-appx:///Assets/Reveal.png",
+ "Description": "A material that changes color near the mouse.",
+ "Content": "",
+ "IsNew": true,
+ "Docs": [
+ {
+ "Title": "Reveal",
+ "Uri": "https://docs.microsoft.com/windows/uwp/style/"
+ }
+ ],
+ "RelatedControls": [
+ "Acrylic"
]
+ }
+
+ ]
+ },
+ {
+ "UniqueId": "Text",
+ "Title": "Text controls",
+ "Subtitle": "AutoSuggestBox, PasswordBox, RichEditBox, RichTextBlock, TextBlock, TextBox",
+ "ImagePath": "ms-appx:///Assets/NavigationViewItemIcons/TextIcon.png",
+ "Description": "Use text controls to display or edit plain text and other rich content.",
+ "Items": [
+ {
+ "UniqueId": "AutoSuggestBox",
+ "Title": "AutoSuggestBox",
+ "Subtitle": "A control to provide suggestions as a user is typing.",
+ "ImagePath": "ms-appx:///Assets/AutoSuggestBox.png",
+ "Description": "A text control that makes suggestions to users as they type. The app is notified when text has been changed by the user and is responsible for providing relevant suggestions for this control to display.",
+ "Content": "
Look at the AutoSuggestBoxPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "AutoSuggestBox",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.autosuggestbox.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "ListBox",
+ "ComboBox",
+ "TextBox"
+ ]
+ },
+ {
+ "UniqueId": "PasswordBox",
+ "Title": "PasswordBox",
+ "Subtitle": "A control for entering passwords.",
+ "ImagePath": "ms-appx:///Assets/PasswordBox.png",
+ "Description": "A user can enter a single line of non-wrapping text in a PasswordBox control. The text is masked by characters that you can specify by using the PasswordChar property, and you can specify the maximum number of characters that the user can enter by setting the MaxLength property.",
+ "Content": "
Look at the PasswordBoxPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "PasswordBox",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.passwordbox.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding text input and editing controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh700391.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "TextBox",
+ "TextBlock",
+ "RichTextBlock",
+ "RichEditBox"
+ ]
+ },
+ {
+ "UniqueId": "RichEditBox",
+ "Title": "RichEditBox",
+ "Subtitle": "A rich text editing control that supports formatted text, hyperlinks, and other rich content.",
+ "ImagePath": "ms-appx:///Assets/RichEditBox.png",
+ "Description": "You can use a RichEditBox control to enter and edit rich text documents that contain formatted text, hyperlinks, and images. By default, the RichEditBox supports spell checking. You can make a RichEditBox read-only by setting its IsReadOnly property to true.",
+ "Content": "
On this page, you can type into the RichTextBox control and save it as a RichTextFormat (.rtf) document, or load an existing .rtf document. You can format the text as Bold or Underlined, and change the text color.
Look at the RichEditBoxPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "RichEditBox",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.richeditbox.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding text input and editing controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh700391.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "TextBox",
+ "RichTextBlock",
+ "TextBlock"
+ ]
+ },
+ {
+ "UniqueId": "RichTextBlock",
+ "Title": "RichTextBlock",
+ "Subtitle": "A control that displays formatted text, hyperlinks, inline images, and other rich content.",
+ "ImagePath": "ms-appx:///Assets/RichTextBlock.png",
+ "Description": "RichTextBlock provides more advanced formatting features than the TextBlock control. You can apply character and paragraph formatting to the text in the RichTextBlock. For example, you can apply Bold, Italic, and Underline to any portion of the text in the control. You can use linked text containers (a RichTextBlock linked to RichTextBlockOverflow elements) to create advanced page layouts.",
+ "Content": "
Change the width of the app to see how the RichTextBlock overflows into additional columns as the app gets narrower.
Look at the RichTextBlockPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "RichTextBlock",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.richtextblock.aspx"
+ },
+ {
+ "Title": "Quickstart: Displaying text",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh700392.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "TextBlock",
+ "TextBox",
+ "PasswordBox",
+ "RichEditBox",
+ "WebView"
+ ]
+ },
+ {
+ "UniqueId": "TextBlock",
+ "Title": "TextBlock",
+ "Subtitle": "A lightweight control for displaying small amounts of text.",
+ "ImagePath": "ms-appx:///Assets/TextBlock.png",
+ "Description": "TextBlock is the primary control for displaying read-only text in your app. You typically display text by setting the Text property to a simple string. You can also display a series of strings in Run elements and give each different formatting.",
+ "Content": "
Look at the TextBlockPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "TextBlock",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.textblock.aspx"
+ },
+ {
+ "Title": "Quickstart: Displaying text",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh700392.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "TextBox",
+ "RichTextBlock",
+ "PasswordBox",
+ "RichEditBox"
+ ]
+ },
+ {
+ "UniqueId": "TextBox",
+ "Title": "TextBox",
+ "Subtitle": "A single-line or multi-line plain text field.",
+ "ImagePath": "ms-appx:///Assets/TextBox.png",
+ "Description": "Use a TextBox to let a user enter simple text input in your app. You can add a header and placeholder text to let the user know what the TextBox is for, and you can customize it in other ways.",
+ "Content": "
Look at the TextBoxPage.xaml file in Visual Studio to see the full code for this page.
",
+ "IsNew": false,
+ "Docs": [
+ {
+ "Title": "TextBox",
+ "Uri": "http://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.textbox.aspx"
+ },
+ {
+ "Title": "Quickstart: Adding text input and editing controls",
+ "Uri": "http://msdn.microsoft.com/en-us/library/windows/apps/hh700391.aspx"
+ }
+ ],
+ "RelatedControls": [
+ "TextBlock",
+ "RichTextBlock",
+ "PasswordBox",
+ "RichEditBox",
+ "AutoSuggestBox"
+ ]
}
- ]
+ ]
+ }
+ ]
}
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/DataModel/ControlInfoDataSource.cs b/Samples/XamlUIBasics/cs/AppUIBasics/DataModel/ControlInfoDataSource.cs
index 8ac2fd08fe..d2eaf60058 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/DataModel/ControlInfoDataSource.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/DataModel/ControlInfoDataSource.cs
@@ -21,8 +21,8 @@
// model. The property names chosen coincide with data bindings in the standard item templates.
//
// Applications may use this model as a starting point and build on it, or discard it entirely and
-// replace it with something appropriate to their needs. If using this model, you might improve app
-// responsiveness by initiating the data loading task in the code behind for App.xaml when the app
+// replace it with something appropriate to their needs. If using this model, you might improve app
+// responsiveness by initiating the data loading task in the code behind for App.xaml when the app
// is first launched.
namespace AppUIBasics.Data
@@ -32,7 +32,7 @@ namespace AppUIBasics.Data
///
public class ControlInfoDataItem
{
- public ControlInfoDataItem(String uniqueId, String title, String subtitle, String imagePath, String description, String content)
+ public ControlInfoDataItem(String uniqueId, String title, String subtitle, String imagePath, String description, String content, bool isNew)
{
this.UniqueId = uniqueId;
this.Title = title;
@@ -40,6 +40,7 @@ public ControlInfoDataItem(String uniqueId, String title, String subtitle, Strin
this.Description = description;
this.ImagePath = imagePath;
this.Content = content;
+ this.IsNew = isNew;
this.Docs = new ObservableCollection();
this.RelatedControls = new ObservableCollection();
}
@@ -50,6 +51,7 @@ public ControlInfoDataItem(String uniqueId, String title, String subtitle, Strin
public string Description { get; private set; }
public string ImagePath { get; private set; }
public string Content { get; private set; }
+ public bool IsNew { get; private set; }
public ObservableCollection Docs { get; private set; }
public ObservableCollection RelatedControls { get; private set; }
@@ -101,8 +103,8 @@ public override string ToString()
///
/// Creates a collection of groups and items with content read from a static json file.
- ///
- /// ControlInfoSource initializes with data read from a static json file included in the
+ ///
+ /// ControlInfoSource initializes with data read from a static json file included in the
/// project. This provides sample data at both design-time and run-time.
///
public sealed class ControlInfoDataSource
@@ -141,6 +143,14 @@ public static async Task GetItemAsync(string uniqueId)
return null;
}
+ public static async Task GetGroupFromItemAsync(string uniqueId)
+ {
+ await _controlInfoDataSource.GetControlInfoDataAsync();
+ var matches = _controlInfoDataSource.Groups.Where((group) => group.Items.FirstOrDefault(item => item.UniqueId.Equals(uniqueId)) != null);
+ if (matches.Count() == 1) return matches.First();
+ return null;
+ }
+
private async Task GetControlInfoDataAsync()
{
lock (_lock)
@@ -177,7 +187,8 @@ private async Task GetControlInfoDataAsync()
itemObject["Subtitle"].GetString(),
itemObject["ImagePath"].GetString(),
itemObject["Description"].GetString(),
- itemObject["Content"].GetString());
+ itemObject["Content"].GetString(),
+ itemObject["IsNew"].GetBoolean());
if (itemObject.ContainsKey("Docs"))
{
foreach (JsonValue docValue in itemObject["Docs"].GetArray())
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ItemPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/ItemPage.xaml
index d7ca547735..7f1ec31ef0 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ItemPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ItemPage.xaml
@@ -9,129 +9,166 @@
//
//*********************************************************
-->
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
+
-
+
+
+
-
-
+
+
-
+
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/ItemPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/ItemPage.xaml.cs
index 85dc2c2868..a64d062cb6 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/ItemPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/ItemPage.xaml.cs
@@ -8,14 +8,21 @@
//
//*********************************************************
using AppUIBasics.Common;
-using AppUIBasics.ControlPages;
using AppUIBasics.Data;
using System;
+using System.Collections.Generic;
+using System.Linq;
+using Windows.ApplicationModel.Core;
using Windows.Foundation;
+using Windows.System;
+using Windows.UI.Composition;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Hosting;
using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media.Animation;
+using Windows.UI.Xaml.Media.Imaging;
using Windows.UI.Xaml.Navigation;
// The Item Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234232
@@ -28,10 +35,11 @@ namespace AppUIBasics
public partial class ItemPage : Page
{
private NavigationHelper navigationHelper;
+ Compositor _compositor;
private ControlInfoDataItem item;
///
- /// NavigationHelper is used on each page to aid in navigation and
+ /// NavigationHelper is used on each page to aid in navigation and
/// process lifetime management
///
public NavigationHelper NavigationHelper
@@ -45,16 +53,44 @@ public ControlInfoDataItem Item
set { item = value; }
}
- public CommandBar BottomCommandBar
- {
- get { return bottomCommandBar; }
- }
public ItemPage()
{
this.InitializeComponent();
this.navigationHelper = new NavigationHelper(this);
this.navigationHelper.LoadState += navigationHelper_LoadState;
+ _compositor = ElementCompositionPreview.GetElementVisual(this).Compositor;
+ Loaded += ItemPage_Loaded;
+ CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
+ coreTitleBar.IsVisibleChanged += CoreTitleBar_IsVisibleChanged;
+ }
+
+ private void ItemPage_Loaded(object sender, RoutedEventArgs e)
+ {
+ SetInitialVisuals();
+ }
+
+ private void CoreTitleBar_IsVisibleChanged(CoreApplicationViewTitleBar sender, object args)
+ {
+ svPanel.Margin = NavigationRootPage.Current.DeviceFamily == DeviceType.Xbox ? new Thickness(0, 0, 48, 0) : new Thickness(0);
+ }
+
+ public void SetInitialVisuals()
+ {
+ NavigationRootPage.Current.PageHeader.TopCommandBar.Visibility = Visibility.Visible;
+ IEnumerable buttons = NavigationRootPage.Current.PageHeader.ThemeFlyout.Content.GetDescendantsOfType();
+ foreach (var button in buttons)
+ {
+ var selectedTheme = (this.RequestedTheme == ElementTheme.Default) ? App.Current.RequestedTheme.ToString() : this.RequestedTheme.ToString();
+ button.IsChecked = (button.Tag.ToString() == selectedTheme);
+ button.Checked += RadioButton_Checked;
+ }
+ NavigationRootPage.Current.PageHeader.IconUri = new BitmapImage(new Uri(item?.ImagePath, UriKind.RelativeOrAbsolute));
+ if (NavigationRootPage.Current.IsFocusSupported)
+ {
+ this.Focus(FocusState.Programmatic);
+ }
+ svPanel.Margin = NavigationRootPage.Current.DeviceFamily == DeviceType.Xbox ? new Thickness(0, 0, 48, 0) : new Thickness(0);
}
///
@@ -89,22 +125,19 @@ private async void navigationHelper_LoadState(object sender, LoadStateEventArgs
this.contentFrame.Navigate(pageType);
}
- if(item.Title == "AppBar")
+ NavigationRootPage.Current.NavigationView.Header = item?.Title;
+ if (item.IsNew && NavigationRootPage.Current.CheckNewControlSelected())
{
- //Child pages don't follow the visible bounds, so we need to add margin to account for this
- header.Margin = new Thickness(0, 24, 0, 0);
+ return;
}
- }
- }
- private void ThemeToggleButton_Checked(object sender, RoutedEventArgs e)
- {
- this.RequestedTheme = ElementTheme.Light;
- }
-
- private void ThemeToggleButton_Unchecked(object sender, RoutedEventArgs e)
- {
- this.RequestedTheme = ElementTheme.Dark;
+ ControlInfoDataGroup group = await ControlInfoDataSource.GetGroupFromItemAsync((String)e.NavigationParameter);
+ var menuItem = ((NavigationMenuItem)NavigationRootPage.Current.NavigationView.MenuItems.FirstOrDefault(m => m.Tag?.ToString() == group.UniqueId));
+ if (menuItem != null)
+ {
+ menuItem.IsSelected = true;
+ }
+ }
}
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
@@ -118,39 +151,11 @@ private void SearchButton_Click(object sender, RoutedEventArgs e)
this.Frame.Navigate(typeof(SearchResultsPage));
}
- private void HelpButton_Click(object sender, RoutedEventArgs e)
- {
- ShowHelp();
- bottomCommandBar.IsOpen = false;
- }
-
- private void AppBarButton_GotFocus(object sender, RoutedEventArgs e)
- {
- // The default gamepad navigation is awkward in this app due to the way the app lays
- // out its pages. It is common for users to overshoot when navigating with the gamepad.
- // If users press Down too many times, they end up on the command bar buttons in
- // the bottom right corner of the page. Pressing Up doesn't return focus anywhere
- // close to where it came from because pressing Up puts focus on the search box
- // because that's the next control in the upward direction.
- //
- // Ideally, we would revise the page layout so that there is a clear next control
- // in each direction. Here, we programmatically set the XYFocusUp property
- // to the control that is closest to the command bar, which is usually the
- // bottom-most control in the content frame.
-
- var transform = bottomCommandBar.TransformToVisual(null);
- // Calculate the rectangle that describes the top edge of the bottom command bar.
- var rect = new Rect(0, 0, bottomCommandBar.ActualWidth, 0);
- rect = transform.TransformBounds(rect);
- var destinationElement = FocusManager.FindNextFocusableElement(FocusNavigationDirection.Up, rect);
- searchButton.XYFocusUp = destinationElement;
- }
-
protected void RelatedControl_Click(object sender, RoutedEventArgs e)
{
ButtonBase b = (ButtonBase)sender;
- NavigationRootPage.RootFrame.Navigate(typeof(ItemPage), b.Content.ToString());
+ NavigationRootPage.RootFrame.Navigate(typeof(ItemPage), b.DataContext.ToString());
}
private void ShowHelp()
@@ -159,47 +164,137 @@ private void ShowHelp()
string HTMLOpenTags = loader.GetString("HTMLOpenTags");
string HTMLCloseTags = loader.GetString("HTMLCloseTags");
-
- contentWebView.NavigateToString(HTMLOpenTags + Item.Content + HTMLCloseTags);
- if (!helpPopup.IsOpen)
- {
- rootPopupBorder.Width = 346;
- rootPopupBorder.Height = this.ActualHeight;
- helpPopup.HorizontalOffset = Window.Current.Bounds.Width - 346;
- helpPopup.IsOpen = true;
- }
}
-
private void SearchBox_QuerySubmitted(SearchBox sender, SearchBoxQuerySubmittedEventArgs args)
{
-
this.Frame.Navigate(typeof(SearchResultsPage), args.QueryText);
-
}
#region NavigationHelper registration
/// The methods provided in this section are simply used to allow
/// NavigationHelper to respond to the page's navigation methods.
- ///
- /// Page specific logic should be placed in event handlers for the
+ ///
+ /// Page specific logic should be placed in event handlers for the
///
/// and .
- /// The navigation parameter is available in the LoadState method
+ /// The navigation parameter is available in the LoadState method
/// in addition to page state preserved during an earlier session.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
+
+ //Connected Animation
+
+ PopOutStoryboard.Begin();
+ PopOutStoryboard.Completed += (sender1_, e1_) =>
+ {
+ PopInStoryboard.Begin();
+ };
+ if (NavigationRootPage.Current.PageHeader != null)
+ {
+ var connectedAnimationService = ConnectedAnimationService.GetForCurrentView();
+ ConnectedAnimation connectedAnimation = connectedAnimationService.GetAnimation("controlAnimation");
+ RelativePanel relativePanel = NavigationRootPage.Current.PageHeader.Content.GetDescendantsOfType().FirstOrDefault();
+ if (connectedAnimation != null)
+ {
+ connectedAnimation.TryStart(relativePanel, new UIElement[] { subTitleText });
+ }
+ }
navigationHelper.OnNavigatedTo(e);
}
+
+ private void RadioButton_Checked(object sender, RoutedEventArgs e)
+ {
+ this.RequestedTheme = (ElementTheme)((RadioButton)(sender)).Tag;
+ }
+
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
+ NavigationRootPage.Current.PageHeader.TopCommandBar.Visibility = Visibility.Collapsed;
+ IEnumerable buttons = NavigationRootPage.Current.PageHeader.TopCommandBar.GetDescendantsOfType();
+ foreach (var button in buttons)
+ {
+ button.Checked -= RadioButton_Checked;
+ }
+ NavigationRootPage.Current.PageHeader.IconUri = null;
+ //Reverse Connected Animation
+ if (e.SourcePageType == typeof(MainPage) || e.SourcePageType == typeof(NewControlsPage))
+ {
+ RelativePanel relativePanel = NavigationRootPage.Current.PageHeader.Content.GetDescendantsOfType().FirstOrDefault();
+ ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("controlAnimation", relativePanel);
+ }
navigationHelper.OnNavigatedFrom(e);
}
#endregion
+
+ private void svPanel_Loaded(object sender, RoutedEventArgs e)
+ {
+ svPanel.XYFocusDown = contentFrame.GetDescendantsOfType().FirstOrDefault(c => c.IsTabStop) ?? svPanel.GetDescendantsOfType().FirstOrDefault(c => c.IsTabStop);
+ }
+
+ private void List_Loaded(object sender, RoutedEventArgs e)
+ {
+ ListView listview = sender as ListView;
+ ListViewItem item = (ListViewItem)listview.ContainerFromItem(listview.Items.LastOrDefault());
+ if (item != null)
+ item.XYFocusDown = item;
+ }
+
+ private async void DocsList_ItemClick(object sender, ItemClickEventArgs e)
+ {
+ await Launcher.LaunchUriAsync(new Uri(((ControlInfoDocLink)e.ClickedItem).Uri));
+ }
+
+ private void ListView_ItemClick(object sender, ItemClickEventArgs e)
+ {
+ NavigationRootPage.RootFrame.Navigate(typeof(ItemPage), e.ClickedItem?.ToString());
+ }
+
+ private void svPanel_GotFocus(object sender, RoutedEventArgs e)
+ {
+ if (e.OriginalSource == sender && NavigationRootPage.Current.IsFocusSupported)
+ {
+ bool isElementFound = false;
+ var elements = contentFrame.GetDescendantsOfType().Where(c => c.IsTabStop);
+ foreach (var element in elements)
+ {
+ Rect elementRect = element.TransformToVisual(svPanel).TransformBounds(new Rect(0.0, 0.0, element.ActualWidth, element.ActualHeight));
+ Rect panelRect = new Rect(0.0, 70.0, svPanel.ActualWidth, svPanel.ActualHeight);
+
+ if (elementRect.Top < panelRect.Bottom)
+ {
+ element.Focus(FocusState.Programmatic);
+ isElementFound = true;
+ break;
+ }
+ }
+ if (!isElementFound)
+ {
+ svPanel.UseSystemFocusVisuals = true;
+ }
+ }
+ }
+
+ private void svPanel_KeyDown(object sender, KeyRoutedEventArgs e)
+ {
+ if (e.Key == VirtualKey.Up)
+ {
+ var nextElement = FocusManager.FindNextElement(FocusNavigationDirection.Up);
+ if (nextElement.GetType() == typeof(NavigationMenuItem))
+ {
+ NavigationRootPage.Current.PageHeader.Focus(FocusState.Programmatic);
+ }
+ else
+ {
+ FocusManager.TryMoveFocus(FocusNavigationDirection.Up);
+ }
+ }
+
+ }
}
}
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/MainPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/MainPage.xaml
index 8ad93c6e85..b659d8d76e 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/MainPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/MainPage.xaml
@@ -9,180 +9,113 @@
//
//*********************************************************
-->
-
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This app is a companion to the
- Windows Store app UI, start to finish topic on the
- Windows Dev Center . It demonstrates basic usage of various controls in isolation, but it also demonstrates real use of the controls and layout techniques in the app itself. To get the most out of it, browse the full code in Visual Studio and see how the app works. Each control page has a help pane where we'll point out where you can look in the app to see the feature in use.
-
-
- Each control has a dark theme and a light theme. On each control page, you can open the bottom app bar to toggle between each theme and see how it looks.
-
-
- Most control pages show the basic control usage in XAML, but you can view the complete XAML and code for each example in Visual Studio. Each control has its own page in the ControlPages folder.
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
-
-
+
-
-
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/MainPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/MainPage.xaml.cs
index bdf4bb60ae..1781111525 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/MainPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/MainPage.xaml.cs
@@ -11,15 +11,14 @@
using AppUIBasics.Data;
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
-using Windows.Foundation;
-using Windows.Foundation.Metadata;
-using Windows.System;
+using System.Runtime.CompilerServices;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Navigation;
-using System.ComponentModel;
-using System.Runtime.CompilerServices;
// The Hub Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=??????
@@ -33,9 +32,9 @@ public sealed partial class MainPage : Page, INotifyPropertyChanged
private NavigationHelper navigationHelper;
private IEnumerable _groups;
private List _items;
-
+ private string itemId;
///
- /// NavigationHelper is used on each page to aid in navigation and
+ /// NavigationHelper is used on each page to aid in navigation and
/// process lifetime management
///
public NavigationHelper NavigationHelper
@@ -73,9 +72,8 @@ public MainPage()
this.navigationHelper.LoadState += navigationHelper_LoadState;
this.DataContext = this; //We have to set the DataContext to itself here to ensure the bindings get hooked up correctly in the Hub.
}
-
///
- /// Handler for after the groups load. Since NavigationRootPage and MainPage get constructed at very similar times, there's a
+ /// Handler for after the groups load. Since NavigationRootPage and MainPage get constructed at very similar times, there's a
/// possibility of a race condition, so we only get the groups on the NavigationRootPage and listen for it to finish on the MainPage.
///
/// The NavigationRootPage that has loaded the groups.
@@ -113,6 +111,7 @@ private void RootPage_GroupsLoaded(object sender, EventArgs e)
/// session. The state will be null the first time a page is visited.
private void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
{
+ NavigationRootPage.Current.NavigationView.Header = "All controls";
}
///
@@ -135,12 +134,14 @@ void Hub_SectionHeaderClick(object sender, HubSectionHeaderClickEventArgs e)
/// Event data that describes the item clicked.
void ItemView_ItemClick(object sender, ItemClickEventArgs e)
{
- // Navigate to the appropriate destination page, configuring the new page
- // by passing required information as a navigation parameter
- var itemId = ((ControlInfoDataItem)e.ClickedItem).UniqueId;
+ itemId = ((ControlInfoDataItem)e.ClickedItem).UniqueId;
+ var container = itemGridView.ContainerFromItem(e.ClickedItem) as GridViewItem;
+ if (container != null)
+ {
+ itemGridView.PrepareConnectedAnimation("controlAnimation", (ControlInfoDataItem)e.ClickedItem, "controlRoot");
+ }
this.Frame.Navigate(typeof(ItemPage), itemId);
}
-
void GroupView_ItemClick(object sender, ItemClickEventArgs e)
{
// Navigate to the appropriate destination page, configuring the new page
@@ -158,20 +159,27 @@ private void SearchButton_Click(object sender, RoutedEventArgs e)
/// The methods provided in this section are simply used to allow
/// NavigationHelper to respond to the page's navigation methods.
- ///
- /// Page specific logic should be placed in event handlers for the
+ ///
+ /// Page specific logic should be placed in event handlers for the
///
/// and .
- /// The navigation parameter is available in the LoadState method
+ /// The navigation parameter is available in the LoadState method
/// in addition to page state preserved during an earlier session.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
navigationHelper.OnNavigatedTo(e);
+
+ var firstMenuItem = (NavigationMenuItem)NavigationRootPage.Current.NavigationView.MenuItems.FirstOrDefault();
+ if (firstMenuItem != null)
+ firstMenuItem.IsSelected = true;
+
+ NavigationRootPage.Current.NavigationView.AlwaysShowHeader = false;
}
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
+ NavigationRootPage.Current.NavigationView.AlwaysShowHeader = true;
navigationHelper.OnNavigatedFrom(e);
}
@@ -212,5 +220,40 @@ private void OnPropertyChanged([CallerMemberName] string propertyName = null)
eventHandler(this, new PropertyChangedEventArgs(propertyName));
}
}
+
+ async private void itemGridView_Loaded(object sender, RoutedEventArgs e)
+ {
+ if (itemId != null)
+ {
+ var item = Items.First(s => s.UniqueId == itemId);
+ itemGridView.ScrollIntoView(item);
+ if (NavigationRootPage.Current.IsFocusSupported)
+ {
+ ((GridViewItem)itemGridView.ContainerFromItem(item))?.Focus(FocusState.Programmatic);
+ }
+ ConnectedAnimation animation =
+ ConnectedAnimationService.GetForCurrentView().GetAnimation("controlAnimation");
+ if (animation != null)
+ {
+ await itemGridView.TryStartConnectedAnimationAsync(
+ animation, item, "controlRoot");
+ }
+ }
+ }
+
+ private void itemGridView_ContainerContentChanging(ListViewBase sender, ContainerContentChangingEventArgs args)
+ {
+ var container = itemGridView.ContainerFromItem(itemGridView.Items.LastOrDefault()) as GridViewItem;
+ if (container != null)
+ container.XYFocusDown = container;
+ }
+
+ private void itemGridView_KeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
+ {
+ if (e.Key == Windows.System.VirtualKey.Up)
+ {
+ FocusManager.TryMoveFocus(FocusNavigationDirection.Up);
+ }
+ }
}
}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Navigation/NavigationRootPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/Navigation/NavigationRootPage.xaml
index ddf573bcb7..9caa78464a 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/Navigation/NavigationRootPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Navigation/NavigationRootPage.xaml
@@ -9,220 +9,45 @@
//
//*********************************************************
-->
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Navigation/NavigationRootPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/Navigation/NavigationRootPage.xaml.cs
index 70cbc92a65..03faed9ba9 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/Navigation/NavigationRootPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Navigation/NavigationRootPage.xaml.cs
@@ -12,19 +12,18 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
-using System.IO;
using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
+using Windows.ApplicationModel.Core;
+using Windows.Devices.Input;
using Windows.Foundation.Metadata;
+using Windows.Gaming.Input;
+using Windows.UI;
+using Windows.UI.Core;
+using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
+using Windows.UI.Xaml.Automation;
using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
-using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Navigation;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
@@ -37,22 +36,63 @@ public sealed partial class NavigationRootPage : Page
{
public static NavigationRootPage Current;
public static Frame RootFrame = null;
+ private PageHeader header;
+ private bool allnewControlsPage = false;
+ private bool isGamePadConnected;
+ private bool isKeyboardConnected;
- private IEnumerable _groups;
- public IEnumerable Groups
+ private IList _groups;
+ public IList Groups
{
get { return _groups; }
}
- public event EventHandler GroupsLoaded;
+ public string CurrentGroupTitle
+ {
+ get
+ {
+ return Groups.First().Title;
+ }
+ }
+
+ public NavigationView NavigationView
+ {
+ get
+ {
+ return NavigationViewControl;
+ }
+ }
- public static SplitView RootSplitView
+
+ public DeviceType DeviceFamily
{
- get { return Current.rootSplitView; }
+ get; set;
+
}
+ public bool IsFocusSupported
+ {
+ get
+ {
+ return DeviceFamily == DeviceType.Xbox || isGamePadConnected || isKeyboardConnected;
+ }
+ }
+
+ public PageHeader PageHeader
+ {
+ get
+ {
+ return header ?? (header = UIHelper.GetDescendantsOfType(NavigationViewControl).FirstOrDefault());
+ }
+ }
+
+ public event EventHandler GroupsLoaded;
+
private RootFrameNavigationHelper rootFrameNavigationHelper;
+ private NavigationMenuItem AllControlsMenuItem;
+ public NavigationMenuItem NewControlsMenuItem;
+
public NavigationRootPage()
{
this.InitializeComponent();
@@ -61,6 +101,8 @@ public NavigationRootPage()
Current = this;
RootFrame = rootFrame;
+ this.KeyDown += NavigationRootPage_KeyDown;
+ this.SizeChanged += NavigationRootPage_SizeChanged;
this.GotFocus += (object sender, RoutedEventArgs e) =>
{
// helpful for debugging focus problems w/ keyboard & gamepad
@@ -68,39 +110,239 @@ public NavigationRootPage()
if (focus != null)
Debug.WriteLine("got focus: " + focus.Name + " (" + focus.GetType().ToString() + ")");
};
+ this.Loaded += (sender, args) =>
+ {
+ NavigationViewControl.GetDescendantsOfType().Where(c => c.Name == "TogglePaneButton").First().VerticalAlignment = VerticalAlignment.Bottom;
+ NavigationViewControl.GetDescendantsOfType().Where(c => c.Name == "PaneContentGrid").First().RowDefinitions[0].Height = new GridLength(88);
+ Grid g = NavigationViewControl.GetDescendantsOfType().Where(b => b.Name == "TogglePaneButton").First().Parent as Grid;
+ g.Width = 80;
+ g.Height = 80;
+ ContentControl headerControl = NavigationViewControl.GetDescendantsOfType().Where(c => c.Name == "HeaderContent").First();
+ headerControl.HorizontalContentAlignment = HorizontalAlignment.Stretch;
+ headerControl.Height = 70;
+ headerControl.IsTabStop = false;
+ };
+
+ CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
+ SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
+ coreTitleBar.IsVisibleChanged += CoreTitleBar_IsVisibleChanged;
+ Gamepad.GamepadAdded += Gamepad_GamepadAdded;
+ Gamepad.GamepadRemoved += Gamepad_GamepadRemoved;
+ isKeyboardConnected = Convert.ToBoolean(new KeyboardCapabilities().KeyboardPresent);
+ }
+
+ private void Gamepad_GamepadRemoved(object sender, Gamepad e)
+ {
+ isGamePadConnected = Gamepad.Gamepads.Any();
+ }
+
+ private void Gamepad_GamepadAdded(object sender, Gamepad e)
+ {
+ isGamePadConnected = Gamepad.Gamepads.Any();
+ }
+
+ private void NavigationRootPage_SizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ UpdateControlButtonForeground();
+ }
+
+ private void AddNavigationMenuItems()
+ {
+ foreach (var g in Groups)
+ {
+ var item = new NavigationMenuItem() { Text = g.Title, Tag = g.UniqueId, DataContext = g };
+ AutomationProperties.SetName(item, g.Title);
+ item.Invoked += NavigationMenuItem_Invoked;
+ if (g.ImagePath.ToLowerInvariant().EndsWith(".png"))
+ {
+ item.Icon = new BitmapIcon() { UriSource = new Uri(g.ImagePath, UriKind.RelativeOrAbsolute) };
+ }
+ else
+ {
+ item.Icon = new FontIcon()
+ {
+ FontFamily = new Windows.UI.Xaml.Media.FontFamily("Segoe MDL2 Assets"),
+ Glyph = g.ImagePath
+ };
+ }
+ NavigationViewControl.MenuItems.Add(item);
+ }
+ this.AllControlsMenuItem = (NavigationMenuItem)NavigationViewControl.MenuItems[0];
+ AllControlsMenuItem.Loaded += AllControlsMenuItem_Loaded;
+
+ this.NewControlsMenuItem = (NavigationMenuItem)NavigationViewControl.MenuItems[1];
+ }
+
+ private void NavigationRootPage_KeyDown(object sender, KeyRoutedEventArgs e)
+ {
+ if (!e.Handled && e.Key == Windows.System.VirtualKey.E)
+ {
+ AutoSuggestBox box = this.GetDescendantsOfType().First().controlsSearchBox;
+ var f = box.Focus(FocusState.Programmatic);
+ }
+ }
+
+ private void CoreTitleBar_IsVisibleChanged(CoreApplicationViewTitleBar sender, object args)
+ {
+ //desktop
+ CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;
+ ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
+ titleBar.ButtonBackgroundColor = Colors.Transparent;
+ titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
+ BackButtonGrid.Visibility = Visibility.Visible;
+ DeviceFamily = DeviceType.Desktop;
+ XboxContentSafeRect.Visibility = Visibility.Collapsed;
+ NavigationViewControl.GetDescendantsOfType().Where(c => c.Name == "SettingsNavPaneItem").First().Margin = new Thickness(0);
+
+ }
+
+ void updateTitleBar()
+ {
+ //phone
+ if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
+ {
+ DeviceFamily = DeviceType.Mobile;
+ BackButtonGrid.Visibility = Visibility.Collapsed;
+ XboxContentSafeRect.Visibility = Visibility.Collapsed;
+ NavigationViewControl.GetDescendantsOfType().Where(c => c.Name == "SettingsNavPaneItem").First().Margin = new Thickness(0);
+
+ }
+ //xbox
+ else
+ {
+ DeviceFamily = DeviceType.Xbox;
+ BackButtonGrid.Visibility = Visibility.Collapsed;
+ XboxContentSafeRect.Visibility = Visibility.Visible;
+ NavigationViewControl.GetDescendantsOfType().Where(c => c.Name == "SettingsNavPaneItem").First().Margin = new Thickness(0, 0, 0, 40);
+
+ }
}
private async void LoadGroups()
{
- _groups = await ControlInfoDataSource.GetGroupsAsync();
+ _groups = (await ControlInfoDataSource.GetGroupsAsync()).ToList();
+
+ AddNavigationMenuItems(); // Currently due to a Windows bug this can only be done in code not markup
+
+ if (NavigationRootPage.Current != null)
+ {
+ var menuItem = (NavigationMenuItem)NavigationRootPage.Current.NavigationView.MenuItems.FirstOrDefault();
+ if (menuItem != null)
+ menuItem.IsSelected = true;
+ }
+
if (GroupsLoaded != null)
GroupsLoaded(this, new EventArgs());
}
- private void ControlGroupItems_ItemClick(object sender, ItemClickEventArgs e)
+ private void NavigationView_SettingsInvoked(NavigationView sender, object args)
+ {
+ rootFrame.Navigate(typeof(SettingsPage));
+ }
+
+ private void NavigationMenuItem_Invoked(NavigationMenuItem sender, object args)
{
- foreach (var item in groupsItemControl.Items)
+ if (sender == AllControlsMenuItem)
+ {
+ rootFrame.Navigate(typeof(MainPage));
+ }
+ else if (sender == NewControlsMenuItem)
+ {
+ rootFrame.Navigate(typeof(NewControlsPage));
+ }
+ else
{
- var container = groupsItemControl.ContainerFromItem(item);
- var panel = VisualTreeHelper.GetChild(container, 0) as StackPanel;
- if (panel != null)
+ var itemId = ((ControlInfoDataGroup)sender.DataContext).UniqueId;
+ rootFrame.Navigate(typeof(SectionPage), itemId);
+ }
+ }
+ private void rootFrame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
+ {
+ SetCustomBackButtonVisibility();
+ if (e.SourcePageType == typeof(MainPage) || e.SourcePageType == typeof(NewControlsPage))
+ {
+ allnewControlsPage = true;
+ UpdateControlButtonForeground();
+
+ }
+ else
+ {
+ allnewControlsPage = false;
+ if (App.Current.RequestedTheme != ApplicationTheme.Dark)
{
- var button = panel.Children[0] as ToggleButton;
- if (button.IsChecked.Value)
- {
- var finished = VisualStateManager.GoToState(button, "Normal", true);
- button.IsChecked = false;
- }
+ ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = rootFrame.CanGoBack ? Colors.Black : Colors.White;
+ }
+ else
+ {
+ ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = rootFrame.CanGoBack ? Colors.White : Colors.Black;
}
}
- this.rootFrame.Navigate(typeof(ItemPage), (e.ClickedItem as ControlInfoDataItem).UniqueId);
- rootSplitView.IsPaneOpen = false;
}
- private void homeButton_Click(object sender, RoutedEventArgs e)
+ private void Button_Click(object sender, RoutedEventArgs e)
{
- this.rootFrame.Navigate(typeof(MainPage));
- rootSplitView.IsPaneOpen = false;
+ if (rootFrame != null && rootFrame.CanGoBack)
+ {
+ rootFrame.GoBack();
+ }
}
+
+ private void SetCustomBackButtonVisibility()
+ {
+ if (rootFrame != null)
+ {
+ CustomBackButton.Visibility = rootFrame.CanGoBack ? Visibility.Visible : Visibility.Collapsed;
+ }
+ }
+
+ private void AllControlsMenuItem_Loaded(object sender, RoutedEventArgs e)
+ {
+ if (IsFocusSupported)
+ {
+ AllControlsMenuItem.Focus(FocusState.Keyboard);
+ }
+ }
+
+ private void UpdateControlButtonForeground()
+ {
+ if (App.Current.RequestedTheme != ApplicationTheme.Dark)
+ {
+ if (allnewControlsPage)
+ {
+ ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Window.Current.Bounds.Width > 640 ? Colors.White : Colors.Black;
+ }
+ else
+ {
+ ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Colors.Black;
+ }
+ }
+
+ else
+ {
+ ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Colors.White;
+ }
+ }
+ private void NavigationViewControl_Loaded(object sender, RoutedEventArgs e)
+ {
+ updateTitleBar();
+ }
+
+ private void BackButtonGrid_Loaded(object sender, RoutedEventArgs e)
+ {
+ CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
+ Window.Current.SetTitleBar(CustomTitleGrid);
+ }
+
+ public bool CheckNewControlSelected()
+ {
+ return NewControlsMenuItem.IsSelected;
+ }
+ }
+
+ public enum DeviceType
+ {
+ Desktop,
+ Mobile,
+ Xbox
}
}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/NewControlsPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/NewControlsPage.xaml
new file mode 100644
index 0000000000..bbd091e308
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/NewControlsPage.xaml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/NewControlsPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/NewControlsPage.xaml.cs
new file mode 100644
index 0000000000..9f02643977
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/NewControlsPage.xaml.cs
@@ -0,0 +1,137 @@
+using AppUIBasics.Common;
+using AppUIBasics.Data;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Runtime.CompilerServices;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media.Animation;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class NewControlsPage : Page, INotifyPropertyChanged
+ {
+ private List _items;
+ private string itemId;
+
+ public List Items
+ {
+ get { return _items; }
+ set { SetProperty(ref _items, value); }
+ }
+
+ public NewControlsPage()
+ {
+ if (NavigationRootPage.Current.Groups == null || NavigationRootPage.Current.Groups.Count() == 0)
+ {
+ NavigationRootPage.Current.GroupsLoaded += RootPage_GroupsLoaded;
+ }
+ else
+ {
+ RootPage_GroupsLoaded(NavigationRootPage.Current, new EventArgs());
+ }
+ this.InitializeComponent();
+ }
+
+ private void RootPage_GroupsLoaded(object sender, EventArgs e)
+ {
+ var controlInfoDataGroups = NavigationRootPage.Current.Groups;
+
+ List items = new List();
+ foreach (ControlInfoDataGroup group in controlInfoDataGroups)
+ {
+ foreach (ControlInfoDataItem item in group.Items.Where(i => i.IsNew))
+ {
+ items.Add(item);
+ }
+ }
+
+ Items = items.OrderBy(item => item.Title).ToList();
+ }
+
+ void ItemView_ItemClick(object sender, ItemClickEventArgs e)
+ {
+ itemId = ((ControlInfoDataItem)e.ClickedItem).UniqueId;
+ var container = itemGridView.ContainerFromItem(e.ClickedItem) as GridViewItem;
+ if (container != null)
+ {
+ itemGridView.PrepareConnectedAnimation("controlAnimation", (ControlInfoDataItem)e.ClickedItem, "controlRoot");
+ }
+ this.Frame.Navigate(typeof(ItemPage), itemId);
+ }
+
+ protected override void OnNavigatedTo(NavigationEventArgs e)
+ {
+ base.OnNavigatedTo(e);
+ NavigationRootPage.Current.NavigationView.AlwaysShowHeader = false;
+ NavigationRootPage.Current.NavigationView.Header = "New controls";
+ NavigationRootPage.Current.NewControlsMenuItem.IsSelected = true;
+ }
+
+ protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
+ {
+ NavigationRootPage.Current.NavigationView.AlwaysShowHeader = true;
+ base.OnNavigatingFrom(e);
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ private bool SetProperty(ref T storage, T value, [CallerMemberName] String propertyName = null)
+ {
+ if (object.Equals(storage, value)) return false;
+
+ storage = value;
+ this.OnPropertyChanged(propertyName);
+ return true;
+ }
+
+ private void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ async private void itemGridView_Loaded(object sender, RoutedEventArgs e)
+ {
+ if (itemId != null)
+ {
+ var item = Items.First(s => s.UniqueId == itemId);
+ itemGridView.ScrollIntoView(item);
+ if (NavigationRootPage.Current.IsFocusSupported)
+ {
+ ((GridViewItem)itemGridView.ContainerFromItem(item))?.Focus(FocusState.Programmatic);
+ }
+ ConnectedAnimation animation =
+ ConnectedAnimationService.GetForCurrentView().GetAnimation("controlAnimation");
+ if (animation != null)
+ {
+ await itemGridView.TryStartConnectedAnimationAsync(
+ animation, item, "controlRoot");
+ }
+ }
+ }
+
+ private void itemGridView_KeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
+ {
+ if (e.Key == Windows.System.VirtualKey.Up)
+ {
+ var nextElement = FocusManager.FindNextElement(FocusNavigationDirection.Up);
+ if (nextElement.GetType() == typeof(NavigationMenuItem))
+ {
+ pageHeader.Focus(FocusState.Programmatic);
+ }
+ else
+ {
+ FocusManager.TryMoveFocus(FocusNavigationDirection.Up);
+ }
+ }
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Package.appxmanifest b/Samples/XamlUIBasics/cs/AppUIBasics/Package.appxmanifest
index 39fdf80af0..f410cdf3b6 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/Package.appxmanifest
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Package.appxmanifest
@@ -1,28 +1,41 @@
-
+App UI Basics C# SampleMicrosoft Corporation
- Assets\StoreLogo-sdk.png
+ Assets\Tiles\StoreLogo-sdk.png
-
+
-
-
-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/PageHeader.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/PageHeader.xaml
index 5f5558e5f2..078c978cd6 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/PageHeader.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/PageHeader.xaml
@@ -1,36 +1,487 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Visible
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Light
+
+
+
+
+ Dark
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
@@ -39,9 +490,16 @@
+
+
+
+
+
+
+
-
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/PageHeader.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/PageHeader.xaml.cs
index e844295ada..4501782e47 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/PageHeader.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/PageHeader.xaml.cs
@@ -2,20 +2,15 @@
using AppUIBasics.Data;
using System;
using System.Collections.Generic;
-using System.IO;
using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using System.Windows.Input;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.Foundation.Metadata;
+using Windows.ApplicationModel.Core;
+using Windows.UI;
+using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
-using Windows.UI.Xaml.Navigation;
+
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
@@ -30,6 +25,49 @@ public object Title
set { SetValue(TitleProperty, value); }
}
+ public ImageSource IconUri
+ {
+ get { return (ImageSource)GetValue(IconUriProperty); }
+ set { SetValue(IconUriProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for IconUri. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty IconUriProperty =
+ DependencyProperty.Register("IconUri", typeof(ImageSource), typeof(PageHeader), new PropertyMetadata(null));
+
+
+ public double BackgroundColorOpacity
+ {
+ get { return (double)GetValue(BackgroundColorOpacityProperty); }
+ set { SetValue(BackgroundColorOpacityProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for BackgroundColorOpacity. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty BackgroundColorOpacityProperty =
+ DependencyProperty.Register("BackgroundColorOpacity", typeof(double), typeof(PageHeader), new PropertyMetadata(0.0));
+
+ public double AcrylicOpacity
+ {
+ get { return (double)GetValue(AcrylicOpacityProperty); }
+ set { SetValue(AcrylicOpacityProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for BackgroundColorOpacity. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty AcrylicOpacityProperty =
+ DependencyProperty.Register("AcrylicOpacity", typeof(double), typeof(PageHeader), new PropertyMetadata(0.3));
+
+
+ public bool ShowAcrylicBehindHeader
+ {
+ get { return (bool)GetValue(ShowAcrylicBehindHeaderProperty); }
+ set { SetValue(ShowAcrylicBehindHeaderProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for BackgroundColorOpacity. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty ShowAcrylicBehindHeaderProperty =
+ DependencyProperty.Register("ShowAcrylicBehindHeader", typeof(Visibility), typeof(PageHeader), new PropertyMetadata(Visibility.Visible));
+
+
public static readonly DependencyProperty WideLayoutThresholdProperty = DependencyProperty.Register("WideLayoutThreshold", typeof(double), typeof(PageHeader), new PropertyMetadata(600));
public double WideLayoutThreshold
{
@@ -41,6 +79,34 @@ public double WideLayoutThreshold
}
}
+
+ public SolidColorBrush BackgroundBrush
+ {
+ get { return (SolidColorBrush)GetValue(BackgroundBrushProperty); }
+ set { SetValue(BackgroundBrushProperty, value); }
+ }
+
+ // Using a DependencyProperty as the backing store for BackgroundBrush. This enables animation, styling, binding, etc...
+ public static readonly DependencyProperty BackgroundBrushProperty =
+ DependencyProperty.Register("BackgroundBrush", typeof(SolidColorBrush), typeof(PageHeader), new PropertyMetadata(new SolidColorBrush(Colors.White)));
+
+
+ public CommandBar TopCommandBar
+ {
+ get
+ {
+ return topCommandBar;
+ }
+ }
+
+ public Flyout ThemeFlyout
+ {
+ get
+ {
+ return themeFlyout;
+ }
+ }
+
public PageHeader()
{
this.InitializeComponent();
@@ -83,9 +149,57 @@ private void controlsSearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggest
}
}
- private void splitViewToggle_Click(object sender, RoutedEventArgs e)
+ private void searchButton_Click(object sender, RoutedEventArgs e)
{
- NavigationRootPage.RootSplitView.IsPaneOpen = !NavigationRootPage.RootSplitView.IsPaneOpen;
+ controlsSearchBox.Visibility = Visibility.Visible;
+ bool isFocused = controlsSearchBox.Focus(FocusState.Programmatic);
+ if (!isFocused)
+ {
+ controlsSearchBox.UpdateLayout();
+ controlsSearchBox.Focus(FocusState.Programmatic);
+ }
+ searchButton.Visibility = Visibility.Collapsed;
+ commandBarBorder.Visibility = Visibility.Collapsed;
+ }
+
+ private void controlsSearchBox_LostFocus(object sender, RoutedEventArgs e)
+ {
+ if (Window.Current.Bounds.Width <= 640)
+ {
+ controlsSearchBox.Visibility = Visibility.Collapsed;
+ commandBarBorder.Visibility = Visibility.Visible;
+ searchButton.Visibility = Visibility.Visible;
+ }
+ }
+
+ private void headerControl_Loaded(object sender, RoutedEventArgs e)
+ {
+ CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
+ if (NavigationRootPage.Current.DeviceFamily == DeviceType.Desktop)
+ {
+ MainTitleBar.Visibility = Visibility.Visible;
+ }
+ coreTitleBar.IsVisibleChanged += CoreTitleBar_IsVisibleChanged;
+ this.Padding = NavigationRootPage.Current.DeviceFamily == DeviceType.Xbox ? new Thickness(24, 28, 48, 0) : NavigationRootPage.Current.DeviceFamily == DeviceType.Desktop ? new Thickness(24, 0, 12, 0) : new Thickness(14, 0, 14, 0);
+ }
+
+ private void CoreTitleBar_IsVisibleChanged(CoreApplicationViewTitleBar sender, object args)
+ {
+ MainTitleBar.Visibility = Visibility.Visible;
+
+ this.Padding = NavigationRootPage.Current.DeviceFamily == DeviceType.Xbox ? new Thickness(24, 28, 48, 0) : NavigationRootPage.Current.DeviceFamily == DeviceType.Desktop ? new Thickness(24, 0, 12, 0) : new Thickness(14, 0, 14, 0);
+ }
+
+ private void ThemeButton_KeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
+ {
+ if (e.Key == Windows.System.VirtualKey.Right)
+ {
+ var nextElement = FocusManager.FindNextElement(FocusNavigationDirection.Right);
+ if (nextElement == null)
+ {
+ controlsSearchBox.Focus(FocusState.Programmatic);
+ }
+ }
}
}
}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage1.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage1.xaml
new file mode 100644
index 0000000000..852a01bee0
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage1.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage1.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage1.xaml.cs
new file mode 100644
index 0000000000..c03d723f1f
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage1.xaml.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.SamplePages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class SamplePage1 : Page
+ {
+ public SamplePage1()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage2.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage2.xaml
new file mode 100644
index 0000000000..128647fb70
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage2.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage2.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage2.xaml.cs
new file mode 100644
index 0000000000..ce87b0f5d6
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage2.xaml.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.SamplePages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class SamplePage2 : Page
+ {
+ public SamplePage2()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage3.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage3.xaml
new file mode 100644
index 0000000000..129a0f8554
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage3.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage3.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage3.xaml.cs
new file mode 100644
index 0000000000..d647c2ae65
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SamplePage3.xaml.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.SamplePages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class SamplePage3 : Page
+ {
+ public SamplePage3()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SampleSettingsPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SampleSettingsPage.xaml
new file mode 100644
index 0000000000..c7f616b1ea
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SampleSettingsPage.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SampleSettingsPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SampleSettingsPage.xaml.cs
new file mode 100644
index 0000000000..5770fdb6aa
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SamplePages/SampleSettingsPage.xaml.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics.SamplePages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class SampleSettingsPage : Page
+ {
+ public SampleSettingsPage()
+ {
+ this.InitializeComponent();
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SearchResultsPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/SearchResultsPage.xaml
index f6b16a9f4a..38c63dd86f 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/SearchResultsPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SearchResultsPage.xaml
@@ -1,124 +1,69 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
-
+
@@ -126,24 +71,18 @@
-
+
-
-
-
-
-
-
+
-
-
-
-
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SearchResultsPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/SearchResultsPage.xaml.cs
index b6bb40367a..e010a89c11 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/SearchResultsPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SearchResultsPage.xaml.cs
@@ -1,13 +1,13 @@
using AppUIBasics.Common;
using AppUIBasics.Data;
using System;
-using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Navigation;
// The Search Results Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234240
@@ -24,7 +24,7 @@ public sealed partial class SearchResultsPage : Page, INotifyPropertyChanged
private List _filters;
private bool _showFilters;
private List _results;
-
+ private int? pivotIndex;
public string QueryText
{
@@ -51,7 +51,7 @@ public List Results
}
///
- /// NavigationHelper is used on each page to aid in navigation and
+ /// NavigationHelper is used on each page to aid in navigation and
/// process lifetime management
///
public NavigationHelper NavigationHelper
@@ -104,12 +104,12 @@ private async void navigationHelper_LoadState(object sender, LoadStateEventArgs
if (numberOfMatchingItems > 0)
{
FullResults.Add(group.Title, matchingItems);
- filterList.Add(new Filter(group.Title, numberOfMatchingItems));
+ filterList.Add(new Filter(group.Title, numberOfMatchingItems, GetItemsByFilterName(group.Title)));
}
totalMatchingItems += numberOfMatchingItems;
}
- filterList.Insert(0, new Filter("All", totalMatchingItems, true));
+ filterList.Insert(0, new Filter("All", totalMatchingItems, filterList.SelectMany(s => s.Items).ToList(), true));
// Communicate results through the view model
QueryText = '\u201c' + queryText + '\u201d';
@@ -119,12 +119,24 @@ private async void navigationHelper_LoadState(object sender, LoadStateEventArgs
{
// Display informational text when there are no search results.
VisualStateManager.GoToState(this, "NoResultsFound", true);
+ var textbox = NavigationRootPage.Current.PageHeader.GetDescendantsOfType().FirstOrDefault();
+ textbox?.Focus(FocusState.Programmatic);
+ }
+ else
+ {
+ VisualStateManager.GoToState(this, "ResultsFound", true);
}
}
else
{
- var isFocused = query.Focus(FocusState.Programmatic);
+ //var isFocused = query.Focus(FocusState.Programmatic);
}
+ NavigationRootPage.Current.NavigationView.Header = "Search";
+ }
+
+ private List GetItemsByFilterName(string title)
+ {
+ return FullResults.FirstOrDefault(s => s.Key == title).Value.ToList();
}
///
@@ -143,7 +155,7 @@ void Filter_Checked(object sender, RoutedEventArgs e)
// Mirror the results into the corresponding Filter object to allow the
// RadioButton representation used when not snapped to reflect the change
selectedFilter.Active = true;
-
+
if (selectedFilter.Name.Equals("All"))
{
var tempResults = new List();
@@ -175,7 +187,7 @@ void Filter_Checked(object sender, RoutedEventArgs e)
public async static void SearchBox_SuggestionsRequested(SearchBox sender, SearchBoxSuggestionsRequestedEventArgs args)
{
- // This object lets us edit the SearchSuggestionCollection asynchronously.
+ // This object lets us edit the SearchSuggestionCollection asynchronously.
var deferral = args.Request.GetDeferral();
try
{
@@ -211,42 +223,15 @@ public async static void SearchBox_SuggestionsRequested(SearchBox sender, Search
}
- private async void query_TextChanged(object sender, TextChangedEventArgs e)
- {
- var filterList = new List();
- var totalMatchingItems = 0;
- var groups = await AppUIBasics.Data.ControlInfoDataSource.GetGroupsAsync();
- FullResults = new Dictionary>();
-
- foreach (var group in groups)
- {
- var matchingItems = group.Items.Where(
- item => item.Title.IndexOf(query.Text, StringComparison.CurrentCultureIgnoreCase) >= 0
- || item.Subtitle.IndexOf(query.Text, StringComparison.CurrentCultureIgnoreCase) >= 0);
- int numberOfMatchingItems = matchingItems.Count();
- if (numberOfMatchingItems > 0)
- {
- FullResults.Add(group.Title, matchingItems);
- filterList.Add(new Filter(group.Title, numberOfMatchingItems));
- }
- totalMatchingItems += numberOfMatchingItems;
- }
-
- filterList.Insert(0, new Filter("All", totalMatchingItems, true));
-
- // Communicate results through the view model
- QueryText = '\u201c' + query.Text + '\u201d';
- Filters = filterList;
- ShowFilters = filterList.Count > 1;
- if (FullResults.Count() < 1)
- {
- // Display informational text when there are no search results.
- VisualStateManager.GoToState(this, "NoResultsFound", true);
- }
- }
private void resultsGridView_ItemClick(object sender, ItemClickEventArgs e)
{
+ var container = (sender as GridView).ContainerFromItem(e.ClickedItem) as GridViewItem;
+ if (container != null)
+ {
+ (sender as GridView).PrepareConnectedAnimation("controlAnimation", (ControlInfoDataItem)e.ClickedItem, "controlRoot");
+ pivotIndex = resultsPivot.SelectedIndex;
+ }
this.Frame.Navigate(
typeof(ItemPage),
((AppUIBasics.Data.ControlInfoDataItem)e.ClickedItem).UniqueId);
@@ -261,11 +246,11 @@ private void SearchBox_QuerySubmitted(SearchBox sender, SearchBoxQuerySubmittedE
/// The methods provided in this section are simply used to allow
/// NavigationHelper to respond to the page's navigation methods.
- ///
- /// Page specific logic should be placed in event handlers for the
+ ///
+ /// Page specific logic should be placed in event handlers for the
///
/// and .
- /// The navigation parameter is available in the LoadState method
+ /// The navigation parameter is available in the LoadState method
/// in addition to page state preserved during an earlier session.
protected override void OnNavigatedTo(NavigationEventArgs e)
@@ -317,6 +302,31 @@ private void OnPropertyChanged([CallerMemberName] string propertyName = null)
eventHandler(this, new PropertyChangedEventArgs(propertyName));
}
}
+
+ private void resultsPivot_Loaded(object sender, RoutedEventArgs e)
+ {
+ if (NavigationRootPage.Current.DeviceFamily == DeviceType.Xbox)
+ {
+ resultsPivot.IsHeaderItemsCarouselEnabled = false;
+ if (pivotIndex != null)
+ {
+ resultsPivot.SelectedIndex = pivotIndex.Value;
+ }
+ resultsPivot.Focus(FocusState.Programmatic);
+ }
+ }
+
+ private void resultsPivot_KeyDown(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
+ {
+ if (e.Key == Windows.System.VirtualKey.Up)
+ {
+ var nextElement = FocusManager.FindNextElement(FocusNavigationDirection.Up);
+ if (nextElement.GetType() != typeof(TextBox))
+ {
+ NavigationRootPage.Current.PageHeader.Focus(FocusState.Programmatic);
+ }
+ }
+ }
}
///
@@ -327,12 +337,14 @@ public sealed class Filter : INotifyPropertyChanged
private String _name;
private int _count;
private bool? _active;
+ private List items;
- public Filter(String name, int count, bool active = false)
+ public Filter(String name, int count, List controlInfoList, bool active = false)
{
this.Name = name;
this.Count = count;
this.Active = active;
+ this.Items = controlInfoList;
}
public override String ToString()
@@ -340,6 +352,12 @@ public override String ToString()
return Description;
}
+ public List Items
+ {
+ get { return items; }
+ set { if (this.SetProperty(ref items, value)) this.OnPropertyChanged("Items"); }
+ }
+
public String Name
{
get { return _name; }
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SectionPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/SectionPage.xaml
index 100b776ded..cb719977ed 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/SectionPage.xaml
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SectionPage.xaml
@@ -9,90 +9,79 @@
//
//*********************************************************
-->
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
-
-
+
-
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SectionPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/SectionPage.xaml.cs
index 7d153cfb03..47ff03ae45 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/SectionPage.xaml.cs
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SectionPage.xaml.cs
@@ -10,20 +10,13 @@
using AppUIBasics.Common;
using AppUIBasics.Data;
using System;
-using System.Collections.Generic;
-using System.IO;
using System.Linq;
-using System.Runtime.InteropServices.WindowsRuntime;
-using System.Windows.Input;
-using Windows.Foundation;
-using Windows.Foundation.Collections;
-using Windows.Foundation.Metadata;
+using Windows.UI;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Controls.Primitives;
-using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Navigation;
@@ -39,10 +32,11 @@ public sealed partial class SectionPage : Page
{
private NavigationHelper navigationHelper;
private ObservableDictionary defaultViewModel = new ObservableDictionary();
+ private string itemId;
ControlInfoDataGroup group;
///
- /// NavigationHelper is used on each page to aid in navigation and
+ /// NavigationHelper is used on each page to aid in navigation and
/// process lifetime management
///
public NavigationHelper NavigationHelper
@@ -70,34 +64,9 @@ public SectionPage()
this.InitializeComponent();
this.navigationHelper = new NavigationHelper(this);
this.navigationHelper.LoadState += navigationHelper_LoadState;
- //controlsSearchBox.SuggestionsRequested += SearchResultsPage.SearchBox_SuggestionsRequested;
}
- //private async void controlsSearchBox_TextChanged(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
- //{
- // var groups = await AppUIBasics.Data.ControlInfoDataSource.GetGroupsAsync();
- // var suggestions = new List();
-
- // foreach (var group in groups)
- // {
- // var matchingItems = group.Items.Where(
- // item => item.Title.Contains(sender.Text));
-
- // foreach (var item in matchingItems)
- // {
- // suggestions.Add(item);
- // }
- // }
- // controlsSearchBox.ItemsSource = suggestions;
- //}
-
- //private void controlsSearchBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args)
- //{
- // var itemId = (args.SelectedItem as ControlInfoDataItem).UniqueId;
- // this.Frame.Navigate(typeof(ItemPage), itemId);
-
- //}
///
/// Populates the page with content passed during navigation. Any saved state is also
@@ -114,6 +83,9 @@ private async void navigationHelper_LoadState(object sender, LoadStateEventArgs
{
var group = await ControlInfoDataSource.GetGroupAsync((String)e.NavigationParameter);
Group = group;
+ Bindings.Update();
+ ((NavigationMenuItem)NavigationRootPage.Current.NavigationView.MenuItems.FirstOrDefault(m => m.Tag?.ToString() == group.UniqueId)).IsSelected = true;
+ NavigationRootPage.Current.NavigationView.Header = group?.Title;
}
///
@@ -125,7 +97,12 @@ void ItemView_ItemClick(object sender, ItemClickEventArgs e)
{
// Navigate to the appropriate destination page, configuring the new page
// by passing required information as a navigation parameter
- var itemId = ((ControlInfoDataItem)e.ClickedItem).UniqueId;
+ itemId = ((ControlInfoDataItem)e.ClickedItem).UniqueId;
+ var container = itemGridView.ContainerFromItem(e.ClickedItem) as GridViewItem;
+ if (container != null)
+ {
+ itemGridView.PrepareConnectedAnimation("controlAnimation", (ControlInfoDataItem)e.ClickedItem, "controlRoot");
+ }
this.Frame.Navigate(typeof(ItemPage), itemId);
}
@@ -140,23 +117,55 @@ private void SearchBox_QuerySubmitted(SearchBox sender, SearchBoxQuerySubmittedE
/// The methods provided in this section are simply used to allow
/// NavigationHelper to respond to the page's navigation methods.
- ///
- /// Page specific logic should be placed in event handlers for the
+ ///
+ /// Page specific logic should be placed in event handlers for the
///
/// and .
- /// The navigation parameter is available in the LoadState method
+ /// The navigation parameter is available in the LoadState method
/// in addition to page state preserved during an earlier session.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
navigationHelper.OnNavigatedTo(e);
}
-
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
navigationHelper.OnNavigatedFrom(e);
}
-
+ async private void itemGridView_Loaded(object sender, RoutedEventArgs e)
+ {
+ if (itemId != null)
+ {
+ var item = this.Group.Items.FirstOrDefault(s => s.UniqueId == itemId);
+ if (item != null)
+ {
+ itemGridView.ScrollIntoView(item);
+ if (NavigationRootPage.Current.IsFocusSupported)
+ {
+ ((GridViewItem)itemGridView.ContainerFromItem(item))?.Focus(FocusState.Programmatic);
+ }
+ ConnectedAnimation animation =
+ ConnectedAnimationService.GetForCurrentView().GetAnimation("controlAnimation");
+ if (animation != null)
+ {
+ await itemGridView.TryStartConnectedAnimationAsync(
+ animation, item, "controlRoot");
+ }
+ }
+ }
+ }
#endregion
+
+ private void itemGridView_KeyDown(object sender, KeyRoutedEventArgs e)
+ {
+ if (e.Key == Windows.System.VirtualKey.Up)
+ {
+ var nextElement = FocusManager.FindNextElement(FocusNavigationDirection.Up);
+ if (nextElement.GetType() != typeof(TextBox))
+ {
+ NavigationRootPage.Current.PageHeader.Focus(FocusState.Programmatic);
+ }
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SettingsPage.xaml b/Samples/XamlUIBasics/cs/AppUIBasics/SettingsPage.xaml
new file mode 100644
index 0000000000..693926044d
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SettingsPage.xaml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Light
+
+
+
+
+ Dark
+
+
+
+
+
+
+
+ This app is a companion to the
+ Windows Store app UI, start to finish topic on the
+ Windows Dev Center . It demonstrates basic usage of various controls in isolation, but it also demonstrates real use of the controls and layout techniques in the app itself. To get the most out of it, browse the full code in Visual Studio and see how the app works.
+
+
+ Each control has a dark theme and a light theme. On each control page, you can open the top app bar to toggle between each theme and see how it looks.
+
+
+ Most control pages show the basic control usage in XAML, but you can view the complete XAML and code for each example in Visual Studio. Each control has its own page in the ControlPages folder.
+
+
+
+
+ THIS CODE AND INFORMATION IS PROVIDED ‘AS IS’ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/SettingsPage.xaml.cs b/Samples/XamlUIBasics/cs/AppUIBasics/SettingsPage.xaml.cs
new file mode 100644
index 0000000000..bc3578c11f
--- /dev/null
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/SettingsPage.xaml.cs
@@ -0,0 +1,50 @@
+using AppUIBasics.Common;
+using System;
+using System.Linq;
+using Windows.Storage;
+using Windows.System;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Input;
+
+// The Settings Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace AppUIBasics
+{
+ ///
+ /// A page that displays the app's settings.
+ ///
+ public sealed partial class SettingsPage : Page
+ {
+ public SettingsPage()
+ {
+ this.InitializeComponent();
+ Loaded += SettingsPage_Loaded;
+ }
+
+ private void SettingsPage_Loaded(object sender, RoutedEventArgs e)
+ {
+ string selectedTheme = ApplicationData.Current.LocalSettings.Values["SelectedAppTheme"]?.ToString();
+ ((RadioButton)ThemePanel.Children.FirstOrDefault(c => ((RadioButton)c)?.Tag?.ToString() == selectedTheme)).IsChecked = true;
+ NavigationRootPage.Current.NavigationView.Header = "Settings";
+ }
+
+ private void RadioButton_Checked(object sender, RoutedEventArgs e)
+ {
+ ApplicationData.Current.LocalSettings.Values["SelectedAppTheme"] = ((RadioButton)sender)?.Tag?.ToString();
+ }
+
+ private async void Button_Click(object sender, RoutedEventArgs e)
+ {
+ await Launcher.LaunchUriAsync(new System.Uri("feedback-hub:"));
+ }
+
+ private void RadioButton_KeyDown(object sender, KeyRoutedEventArgs e)
+ {
+ if (e.Key == VirtualKey.Up)
+ {
+ NavigationRootPage.Current.PageHeader.Focus(FocusState.Programmatic);
+ }
+ }
+ }
+}
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/Strings/en-US/Resources.resw b/Samples/XamlUIBasics/cs/AppUIBasics/Strings/en-US/Resources.resw
index f2b0f11536..fe6a795b60 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/Strings/en-US/Resources.resw
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/Strings/en-US/Resources.resw
@@ -126,18 +126,6 @@
Controls by name
-
- THIS CODE AND INFORMATION IS PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.\n\nCopyright (c) Microsoft Corporation. All rights reserved
- Usage disclaimer.
-
-
- Accept
- Usage disclaimer button.
-
-
- Disclaimer
- Usage disclaimer title.
-
Documentation
@@ -154,7 +142,7 @@
Path to control pages. Used to load frame in ItemsPage.
- Related controls
+ Related controls From any control page, open the help panel from the bottom app bar to see custom help content for that control.
diff --git a/Samples/XamlUIBasics/cs/AppUIBasics/project.json b/Samples/XamlUIBasics/cs/AppUIBasics/project.json
index c594939270..1ed658cdd2 100644
--- a/Samples/XamlUIBasics/cs/AppUIBasics/project.json
+++ b/Samples/XamlUIBasics/cs/AppUIBasics/project.json
@@ -1,6 +1,7 @@
{
"dependencies": {
- "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0"
+ "Microsoft.NETCore.UniversalWindowsPlatform": "5.0.0",
+ "Microsoft.Xaml.Behaviors.Uwp.Managed": "2.0.0"
},
"frameworks": {
"uap10.0": {}
diff --git a/SharedContent/cpp/App.xaml.cpp b/SharedContent/cpp/App.xaml.cpp
index 813559a2f1..1abebcb3f1 100644
--- a/SharedContent/cpp/App.xaml.cpp
+++ b/SharedContent/cpp/App.xaml.cpp
@@ -30,6 +30,12 @@ using namespace Windows::UI::Xaml::Navigation;
// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=402347&clcid=0x409
+// These placeholder functions are used if the sample does not
+// implement the corresponding methods. This allows us to simulate
+// C# partial methods in C++.
+
+static void Partial_Construct() { }
+
///
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
@@ -37,6 +43,7 @@ using namespace Windows::UI::Xaml::Navigation;
App::App()
{
InitializeComponent();
+ Partial_Construct();
Suspending += ref new Windows::UI::Xaml::SuspendingEventHandler(this, &SDKTemplate::App::OnSuspending);
}
diff --git a/SharedContent/js/Microsoft.WinJS/css/ui-dark.css b/SharedContent/js/Microsoft.WinJS/css/ui-dark.css
index 991c9316d3..5181beee18 100644
--- a/SharedContent/js/Microsoft.WinJS/css/ui-dark.css
+++ b/SharedContent/js/Microsoft.WinJS/css/ui-dark.css
@@ -5546,11 +5546,11 @@ select[multiple].win-dropdown option:checked {
background-color: rgba(0, 0, 0, 0.6);
border-color: rgba(255, 255, 255, 0.6);
}
-.win-textbox:focus,
-.win-textarea:focus {
- color: #000000;
- background-color: #ffffff;
-}
+ .win-textbox:focus,
+ .win-textarea:focus {
+ color: #ffffff;
+ background-color: #000000;
+ }
.win-textbox::-ms-clear,
.win-textbox::-ms-reveal {
display: block;