SlideShare a Scribd company logo
WinRT App
29 April 2014
Building Apps for Windows Phone 8.1 Jump Start
Getting started building Windows Runtime XAML apps…
02   getting started building windows runtime apps
02   getting started building windows runtime apps
02   getting started building windows runtime apps
02   getting started building windows runtime apps
02   getting started building windows runtime apps
02   getting started building windows runtime apps
02   getting started building windows runtime apps
02   getting started building windows runtime apps
StackPanel
TextBlock
Rectangle
HorizontalAlignment="Center"
Rectangle
Margin="-20,-10,0,0"
TextBlock
TextBox
Button
StackPanel Orientation="Horizontal"
Button
Button
Button
Button
StackPanel
StackPanel
Nested
StackPanel
Margins
and
Alignment
Grid
Grid.ColumnDefinitions
ColumnDefinition Width="Auto"
ColumnDefinition Width="120"
ColumnDefinition Width="*"
Grid.ColumnDefinitions
Grid.RowDefinitions
RowDefinition Height="Auto"
RowDefinition Height="*"
RowDefinition Height="2*"
RowDefinition Height="0.5*"
Grid.RowDefinitions
Rectangle Grid.Row="0" Grid.Column="0"
Rectangle Grid.Row="0" Grid.Column="1"
Rectangle Grid.Row="0" Grid.Column="2"
TextBlock
TextBlock Grid.Column="1"
TextBlock Grid.Column="2"
HorizontalAlignment="Right"
RectanglesRowandColumnDefinitionsLabels
Rectangle Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2"
Rectangle
TextBox Grid.Row="2" Grid.Column="2"
StackPanel Grid.Row="3" Grid.Column="2"
StackPanel.Resources
Style
Setter
Setter
Style
StackPanel.Resources
TextBlock
TextBlock
TextBlock
TextBlock
TextBlock
StackPanel
NestedStackPanel
02   getting started building windows runtime apps
15
80% exact same XAML 20% custom
Common SignatureOptimized
DatePicker
TimePicker
CommandBar
Button
CheckBox
RadioButton ProgressBar
Slider
ToggleSwitch
Hub
Pivot
ListView
GridView
SysTray
02   getting started building windows runtime apps
02   getting started building windows runtime apps
<TextBox InputScope=
"EmailSmtpAddress"/>
<TextBox InputScope=
"CurrencyAmountAndSymbol"/>
<TextBox
InputScope="Number"/>
ButtonContent
Button
Button
Button
Grid
Grid.ColumnDefinitions
ColumnDefinition
ColumnDefinition
Grid.ColumnDefinitions
Image
StackPanel
TextBlock
TextBlock
StackPanel
Grid
Button
HyperlinkButton
XAMLCode-Behind
Button
Click="SimpleButton_Click"
private async void SimpleButton_Click
var new
await
The click event provides a simple way to handle button interaction
directly from the code-behind.
Double-click the button on the designer or use Intellisense in the XAML editor to generate the handler.
Handlers may also be wired up from code using the += syntax in C# and equivalent in VB or C++.
{x:Null}
TextBlock
ProgressRing IsActive="True"
TextBlock
ProgressBar Minimum="0" Maximum="250" Value="50"
TextBlock
ProgressBar
IsIndeterminate="True"
Important!
You must deactivate progress rings and progress bars when not visible.
There’s a performance penalty if you do not.
02   getting started building windows runtime apps
02   getting started building windows runtime apps
02   getting started building windows runtime apps
Button
<Button.Flyout>
<Flyout>
StackPanel
TextBlock
TextBlock
Button
StackPanel
</Flyout>
</Button.Flyout>
Button
Button
<Button.Flyout>
<MenuFlyout>
MenuFlyoutItem
MenuFlyoutItem
MenuFlyoutSeparator
ToggleMenuFlyoutItem
ToggleMenuFlyoutItem
</MenuFlyout>
</Button.Flyout>
Button
02   getting started building windows runtime apps
private async void ShowContentDialog()
{
ContentDialog dialog = new ContentDialog()
{
Title = "Download updates?",
Content = "This update will clean the slate for Iron Man",
PrimaryButtonText = "Yes, clean it",
SecondaryButtonText = "No, Dont!"
};
dialog.SecondaryButtonClick += dialog_SecondaryButtonClick;
ContentDialogResult result = await dialog.ShowAsync();
if (result == ContentDialogResult.Primary) { /* do some more Primary logic */ }
else if (result == ContentDialogResult.Secondary) { /* else do Secondary logic */ }
}
void dialog_SecondaryButtonClick(ContentDialog sender, object args)
{ /* you can also hook up to a button event handler */ }
AboutMessage myDialog =
new AboutMessage();
ContentDialogResult result =
await myDialog.ShowAsync();
02   getting started building windows runtime apps
02   getting started building windows runtime apps
02   getting started building windows runtime apps
<Page.BottomAppBar>
<CommandBar x:Name="commandBar">
<CommandBar.PrimaryCommands>
<AppBarButton Label="edit" Icon="Edit" />
<AppBarButton Label="favorite" Icon="Favorite" />
<AppBarSeparator />
<AppBarToggleButton Label="play" Icon="Play" />
</CommandBar.PrimaryCommands>
<CommandBar.SecondaryCommands>
<AppBarButton Label="help" Icon="Question" />
</CommandBar.SecondaryCommands>
</CommandBar>
</Page.BottomAppBar>
34
35
Windows Phone
Windows
02   getting started building windows runtime apps
Icon Class Icon contents
SymbolIcon Named Segoe UI
Symbol symbol
BitmapIcon A bitmap (PNG, etc.)
image
FontIcon A custom font
PathIcon A XAML path
<CommandBar.SecondaryCommands>
<AppBarButton Label="Add Item">
<AppBarButton.Icon>
<SymbolIcon Symbol="Add" />
</AppBarButton.Icon>
</AppBarButton>
<AppBarButton Label="Block">
<AppBarButton.Icon>
<BitmapIcon UriSource="assets/foo.png"/>
</AppBarButton.Icon>
</AppBarButton>
</CommandBar.SecondaryCommands>
<Page.BottomAppBar>
<CommandBar>
<AppBarButton x:Name="btnBrag" Icon="Camera" Label="brag">
<AppBarButton.Flyout>
<MenuFlyout>
<MenuFlyoutItem x:Name="menuPhoto" Text="Photo"
Click="menuPhoto_Click"/>
<MenuFlyoutItem x:Name="menuVideo" Text="Video"
Click="menuVideo_Click"/>
</MenuFlyout>
</AppBarButton.Flyout>
</AppBarButton>
<AppBarButton x:Name="btnPinToStart" Icon="Pin"
Click="btnPinToStart_Click" Label="Like"/>
</CommandBar>
</Page.BottomAppBar>
By default, Status Bar is visible and displays with a transparent background
The background color that displays is that of the containing Page
Can program the BackgroundColor and BackgroundOpacity
There is no way to control the Status Bar in XAML – code only
StatusBar
StatusBar
StatusBar
StatusBar
StatusBar
StatusBar
var StatusBar
ApplicationView.GetForCurrentView().SetLayoutBounds(
ApplicationViewLayoutBounds.CoreWindowBounds);
• Soft buttons are hidden
• Any touch on the screen brings up the soft buttons and transport controls
02   getting started building windows runtime apps
02   getting started building windows runtime apps
02   getting started building windows runtime apps
Color="{ThemeResource SystemColorControlAccentColor}"
"{StaticResource PhoneAccentBrush}"
SystemColorControlAccentColor
02   getting started building windows runtime apps
Light/dark resources update on app resume
02   getting started building windows runtime apps
<StackPanel RequestedTheme="Light"> … </StackPanel>
02   getting started building windows runtime apps
©2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the
U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft
must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after
the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

PDF
05.Blend Expression, Transformation & Animation
PDF
WPF L02-Graphics, Binding and Animation
PPTX
19 programming sq lite on windows phone 8.1
PPTX
04 lists and lists items in windows runtime apps
PPTX
21 app packaging, monetization and publication
PPTX
16 interacting with user data contacts and appointments
PPTX
07 windows runtime app lifecycle
PPTX
17 camera, media, and audio in windows phone 8.1
05.Blend Expression, Transformation & Animation
WPF L02-Graphics, Binding and Animation
19 programming sq lite on windows phone 8.1
04 lists and lists items in windows runtime apps
21 app packaging, monetization and publication
16 interacting with user data contacts and appointments
07 windows runtime app lifecycle
17 camera, media, and audio in windows phone 8.1

Viewers also liked (18)

PPTX
20 tooling and diagnostics
PPTX
22 universal apps for windows
PPTX
09 data storage, backup and roaming
PPTX
05 programming page controls and page transitions animations
PPTX
03 page navigation and data binding in windows runtime apps
PPTX
12 maps, geolocation, and geofencing
PPTX
08 localization and globalization in windows runtime apps
PPTX
11 background tasks and multitasking
PPTX
13 networking, mobile services, and authentication
PPTX
23 silverlight apps on windows phone 8.1
PPTX
15 sensors and proximity nfc and bluetooth
PPTX
14 tiles, notifications, and action center
PDF
Making money with apps
PDF
Designing XAML apps using Blend for Visual Studio 2013
PPTX
18 windows phone 8.1 for the enterprise developer
PPTX
01 introducing the windows phone 8.1
PDF
Building & Designing Windows 10 Universal Windows Apps using XAML and C#
PPTX
Introducing Windows Phone 8 Development
20 tooling and diagnostics
22 universal apps for windows
09 data storage, backup and roaming
05 programming page controls and page transitions animations
03 page navigation and data binding in windows runtime apps
12 maps, geolocation, and geofencing
08 localization and globalization in windows runtime apps
11 background tasks and multitasking
13 networking, mobile services, and authentication
23 silverlight apps on windows phone 8.1
15 sensors and proximity nfc and bluetooth
14 tiles, notifications, and action center
Making money with apps
Designing XAML apps using Blend for Visual Studio 2013
18 windows phone 8.1 for the enterprise developer
01 introducing the windows phone 8.1
Building & Designing Windows 10 Universal Windows Apps using XAML and C#
Introducing Windows Phone 8 Development
Ad

Similar to 02 getting started building windows runtime apps (20)

PPTX
Introduction to Silverlight
PPTX
Introduction to Silverlight for Windows Phone
PDF
follow-app BOOTCAMP 2: Introduction to silverlight
PDF
What's new in Xamarin.Forms?
PDF
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
PPTX
Session 5#
PDF
The Ring programming language version 1.2 book - Part 31 of 84
PDF
The Ring programming language version 1.4 book - Part 12 of 30
PDF
Writing videogames with titanium appcelerator
PPTX
WPF - An introduction
PPTX
Unique features of windows 8
PPTX
Windows8 lightningtalk
PDF
The Ring programming language version 1.7 book - Part 46 of 196
PPTX
ADF Mobile - an intro for Developers
PDF
Silverlight 2 For Developers
PPTX
Windows 8 app bar and live tiles
PDF
20150812 4시간만에 따라해보는 windows 10 앱 개발
PPTX
XAML and WPF - Dinko Jakovljević
PDF
Introduction to Xamarin.Forms
PDF
MOPCON 2014 - Best software architecture in app development
Introduction to Silverlight
Introduction to Silverlight for Windows Phone
follow-app BOOTCAMP 2: Introduction to silverlight
What's new in Xamarin.Forms?
netmind - Primer Contacto con el Desarrollo de Aplicaciones para Windows 8
Session 5#
The Ring programming language version 1.2 book - Part 31 of 84
The Ring programming language version 1.4 book - Part 12 of 30
Writing videogames with titanium appcelerator
WPF - An introduction
Unique features of windows 8
Windows8 lightningtalk
The Ring programming language version 1.7 book - Part 46 of 196
ADF Mobile - an intro for Developers
Silverlight 2 For Developers
Windows 8 app bar and live tiles
20150812 4시간만에 따라해보는 windows 10 앱 개발
XAML and WPF - Dinko Jakovljević
Introduction to Xamarin.Forms
MOPCON 2014 - Best software architecture in app development
Ad

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Cloud computing and distributed systems.
PPT
Teaching material agriculture food technology
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
Chapter 3 Spatial Domain Image Processing.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Spectral efficient network and resource selection model in 5G networks
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Building Integrated photovoltaic BIPV_UPV.pdf
cuic standard and advanced reporting.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Big Data Technologies - Introduction.pptx
Cloud computing and distributed systems.
Teaching material agriculture food technology
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation_ Review paper, used for researhc scholars
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Machine learning based COVID-19 study performance prediction
Dropbox Q2 2025 Financial Results & Investor Presentation

02 getting started building windows runtime apps