Developer's Guide to Windows 10 Extend your app to multiple device families and use new capabilities by targeting the UWP.

Download Report

Transcript Developer's Guide to Windows 10 Extend your app to multiple device families and use new capabilities by targeting the UWP.

Developer's Guide to Windows 10
Extend your app to multiple device
families and use new capabilities by
targeting the UWP
Minimal code update required
Responsive UX
Design/Implementation
Windows 8.0
Windows 10
Windows Phone 8.1
Windows 10
Minor code updates for UWP APIs
Design UX for multiple form
factors
Merge UX
Refactor to single code-base & to
target UAP APIs
Windows 8.1
Windows Phone 8.1
Windows 10
Port the UI Silverlight -> Windows
XAML
Rewrite code to target UWP APIs*
Design UX for multiple form factors
Windows Phone 7.5/7.8
Windows Phone 8.0
Windows Phone 8.1*
*Silverlight on Windows Phone 8.1 can be a mix of Silverlight and WinRT APIs
Windows 10
https://github.com/Win10DevGuideMVA/ProjectUpgradeUtility/
• Automates most of the upgrade steps – doesn’t do everything!
• Converts .csproj to UWP, updates package.appxmanifest
• Run directly in Powershell (needs script execute allowed), or execute
Run_Upgrade_to_UWP.bat at cmd prompt
Scale
Factors
100 125 150
200
250
300
400
ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(320, 320));
See MSDN documentation for guidance on
how to Move from Windows Runtime 8 to
UWP:
http://aka.ms/movefrom8touwp
this.Page.Loaded += (sender, e) =>
{
#if WINDOWS_PHONE_APP
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
#else
// Keyboard and mouse navigation only apply when occupying the entire window
if (this.Page.ActualHeight == Window.Current.Bounds.Height &&
this.Page.ActualWidth == Window.Current.Bounds.Width)
{
// Listen to the window directly so focus isn't required
Window.Current.CoreWindow.Dispatcher.AcceleratorKeyActivated +=
CoreDispatcher_AcceleratorKeyActivated;
Window.Current.CoreWindow.PointerPressed +=
this.CoreWindow_PointerPressed;
}
#endif
};
Example:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var frame = Window.Current.Content as Frame;
if (frame.CanGoBack)
{
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
AppViewBackButtonVisibility.Visible;
}
else
{
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
AppViewBackButtonVisibility.Collapsed;
}
SystemNavigationManager.GetForCurrentView().BackRequested += Page_BackRequested;
}
var api = "Windows.Phone.UI.Input.HardwareButtons";
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent(api))
{
Windows.Phone.UI.Input.HardwareButtons.CameraPressed
+= CameraButtonPressed;
}
small
landscape
view
Phone/narrow view
large landscape view
1. Choose one head to port
2. Merge UI from other head into adaptive UI
3. Choose what to do with Shared
Shared or merged
You can keep your Shared project
1. WINDOWS_APP
2. WINDOWS_PHONE_APP
3. WINDOWS_UWP (new)
Windows.Foundation.Metadata.ApiInformation