3. The Windows Runtime (WinRT) is the
shared runtime and API space used
by store apps across the Windows
platform (phone and client)
3
Common
WinRT APIs
Phone-specific
WinRT APIs
Windows-specific
WinRT APIs
Dramatic convergence in 8.1
• Goal is 100% convergence for dev scenarios
• In 8.0, we had ~30% API convergence
• With 8.1, we move well past 90%+ convergence
4. HTML XAML XAML
HTML
JavaScript Code
WinJS .NET for Windows
Win32
Windows Runtime XAML
C++ Code C#/VB Code
WinRT
Store
Silverlight XAML
Windows Phone
Silverlight XAML
C#/VB Code
Silverlight .NET
5.
6.
7. Windows Phone 8.1 App Windows 8.1 App
XAML View
Phone UI
XAML View
Windows UI
Shared Code, Images, Files
WinRT
8. Windows Phone 8.1 App Windows 8.1 App
XAML View
XAML UI
XAML View
XAML UI
Logic Logic
Logic
Data Data
Data
11. Decouple UI from logic
plus platform specific API sets (some geolocation, media, sensors)
plus XAML components that “make sense”
12. Windows 8.1 Windows Phone 8.1
Windows Only
WinRT
e.g. search contract
e.g. multiple windows
e.g. resizable windows
e.g. printing support
Phone Only
WinRT
e.g. action center
e.g. status bar
e.g. back key handling
some common APIs may have different behaviour across Windows/Phone
14. //Create
the
picker
object
FileOpenPicker
openPicker
=
new
FileOpenPicker();
openPicker.ViewMode
=
PickerViewMode.Thumbnail;
openPicker.SuggestedStartLocation
=
PickerLocationId.PicturesLibrary;
//
Users
expect
to
have
a
filtered
view
of
their
folders
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".png");
//
Open
the
picker
for
the
user
to
pick
a
file
StorageFile
file
=
await
openPicker.PickSingleFileAsync();
if
(file
!=
null)
{
//
Do
something
with
the
file...
}
//Create
the
picker
object
FileOpenPicker
openPicker
=
new
FileOpenPicker();
//
On
Windows
Phone,
setting
Filtering
to
image
types
//
causes
Picker
to
show
Camera
Roll
openPicker.FileTypeFilter.Add(".jpg");
openPicker.FileTypeFilter.Add(".png");
//
Open
the
picker
for
the
user
to
pick
a
file
openPicker.PickSingleFileAndContinue();
15. 100%
100%
No: Location (Windows) vs. Geopoint (WP)
No: Bing Maps (Windows) vs. WinRT Map control (WP)