SlideShare a Scribd company logo
1 of 67
Download to read offline
Fons Sonnemans
Reflection IT
Building & Designing Windows 10
Universal Windows Apps using
XAML and C#
@fonssonnemans
www.storeappsug.nl
@StoreAppsUG
Topics
• Universal Windows Apps
• Blend 2015
• Layout Controls
• Adaptive UI
• Resources
• Animations & Behaviors
• Styling & Templating
• Data Binding
Fons Sonnemans
• Software Development Consultant
• Programming Languages
• Clipper, Smalltalk, Visual Basic, C#
• Platforms
• Windows Forms, ASP.NET (Web Forms, MVC), XAML (WPF, Silverlight, Windows
Phone, Windows 8 & 10)
• Databases
• MS SQL Server, Oracle
• Role
• Trainer, Coach, Advisor, Architect, Designer, App Developer
• More info: www.reflectionit.nl
My Apps
4
http://reflectionit.nl/apps
Universal Windows Apps
Introducing the Universal Windows Platform (UWP)
Easy for users to get
& stay current
Unified core
and app platform
The convergence journey
Windows 10
Converged
OS kernel
Converged
app model
Phone Small Tablet
2-in-1s
(Tablet or Laptop)
Desktops
& All-in-OnesPhablet Large Tablet
Classic
Laptop
Xbox IoTSurface Hub Holographic
Windows 10
One Store +
One Dev Center
Reuse Existing
Code
One SDK +
Tooling
Adaptive
User Interface
Natural
User Inputs
One Universal Windows Platform
Universal Windows Platform
• A single API surface
• A guaranteed API surface
• The same on all devices
Phone
Device
Xbox
Device
Desktop
Device
Windows Core
Universal Windows Platform
Universal Windows Platform
• One Operating System
• One Windows core for all devices
• One App Platform
• Apps run across every family
• One Dev Center
• Single submission flow and dashboard
• One Store
• Global reach, local monetization
Consumers, Business & Education
Adaptive code
• A compatible binary across devices
• Universal API with device-specific implementation
• Light up our app with capabilities
• Testing for capabilities and namespaces
UAP
Windows Core Windows Core Windows Core Windows Core
UAP UAP UAP
Desktop Mobile Xbox More…
Adaptive codePlatform extensions (capabilities)
Platform extensions (capabilities)
• Device-specific API
• Family-specific capabilities
• Compatible across devices
• Unique update cadence
Phone
Device
Xbox
Device
Desktop
Device
Windows Core
Universal Windows Platform
Windows App
Phone
extension
Xbox
extension
Desktop
extension
Test capabilities at runtime
• Use Adaptive Code to light-up your app on specific devices
var api = "Windows.Phone.UI.Input.HardwareButtons";
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent(api))
{
Windows.Phone.UI.Input.HardwareButtons.CameraPressed
+= CameraButtonPressed;
}
Blend 2015
What’s new
Pre Blend 2015
• Blend is a tool for creating great user experiences, with deep
focus on best-in-class UI design capabilities.
• Visual Studio is a tool for creating great apps, with focus on
best-in-class code editing and debugging capabilities.
• Supports
• WPF, Silverlight (Phone), Windows 8 & 8.1
Feedback themes
• No XAML or C# IntelliSense
• File reload experiences when switching between VS and
Blend
• Inconsistent shell & project system experiences with VS
• Git and TFS
• Expand/collapse of project nodes
• Performance and scalability of large solutions
Blend for Visual Studio 2015
• Adds Windows 10 support
• Rebuilt from the ground up using VS technologies
• IntelliSense, GoTo Definition, Peek, Debugging, Window Layouts,
Reloading, Customizing
• Retains almost all of the unique Blend capabilities
• SketchFlow is killed
Blend 2015
UI Debugging for XAML
• Visual tree inspection and manipulation
• Live tracking of tree and property changes
• Fully integrated into debugging
• Upcoming
• Serializing edits back into source
• Edit-n-continue
• Data debugging visualizations
Live Visual Tree
Layout Controls
Panels
Layout Controls
• Canvas
• Simplest, placement relative to the top left edge
• Not scalable
• StackPanel
• Horizontal or vertical stacking
• RelativePanel
• You arrange child elements by specifying how they should be arranged in relationships to
each other, and how they should position relative to their content and/or their parent
• Grid
• Uses rows and columns
• Flexible Positioning (similar to <TABLE /> in HTML)
• More
• Border (“Obsolete”), ScrollViewer, Viewbox, VariableSizedWrapGrid
Canvas
• Is a Drawing Surface
• Children have fixed positions relative to top-left-corner
<Canvas Width="250" Height="200" Background="Gray">
<Rectangle Canvas.Top="25" Canvas.Left="25"
Width="200" Height="150" Fill="Yellow" />
</Canvas>
The Canvas
The Rectangle
XAML - Attached Properties
• Top & Left properties only make sense inside a Canvas
<Canvas Width="250" Height="200" Background="Gray">
<Rectangle Canvas.Top="25" Canvas.Left="25"
Width="200" Height="150" Fill="Yellow" />
</Canvas>
StackPanel
• The StackPanel will place its children in either a column
(default) or row. This is controlled by the Orientation
property.
<StackPanel Orientation="Horizontal"
BorderBrush="#FF0B77FD"
BorderThickness="2"
Padding="5">
<Button Content="Button1" FontSize="30" />
<Button Content="Button2" FontSize="30" Margin="5,0" />
<Button Content="Button3" FontSize="30" />
</StackPanel>
New Properties in Win10
Makes ‘Border’ obsolete
Nested Stackpanels
<StackPanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" Margin="0,0,0,12">
<TextBlock Text="Username" FontSize="26.667" Width="240"
TextAlignment="Right" Margin="0,0,20,0"/>
<TextBox FontSize="26.667" Width="300"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0,0,0,12">
<TextBlock Text="Password" Margin="0,0,20,0" FontSize="26.667"
Width="240" TextAlignment="Right"/>
<PasswordBox Margin="0" FontSize="26.667" Width="300"/>
</StackPanel>
<Button Content="Login" HorizontalAlignment="Left"
Margin="260,0,0,0" FontSize="26.667"/>
</StackPanel>
RelativePanel
• Decrease Tree size
<RelativePanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock x:Name="labelUsername"
Text="Username"
RelativePanel.LeftOf="inputUsername"
TextAlignment="Right"
Margin="0,0,20,0"
FontSize="26.667" />
<TextBox x:Name="inputUsername"
RelativePanel.AlignRightWithPanel="True"
Width="300"
FontSize="26.667" />
<TextBlock x:Name="labelPassword“
Text="Password"
RelativePanel.LeftOf="inputPassword"
RelativePanel.AlignVerticalCenterWith="inputPassword"
TextAlignment="Right"
Margin="0,0,20,0"
FontSize="26.667" />
<PasswordBox x:Name="inputPassword"
RelativePanel.Below="inputUsername"
RelativePanel.AlignRightWithPanel="True"
Width="300"
Margin="0,10"
FontSize="26.667" />
<Button x:Name="buttonLogin"
Content="Login"
RelativePanel.Below="inputPassword"
RelativePanel.AlignLeftWith="inputPassword"
FontSize="26.667" />
</RelativePanel>
RelativePanel
• Vertical layout
<RelativePanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock x:Name="labelUsername“
Text="Username“
Margin="0,0,20,0"
FontSize="26.667" />
<TextBox x:Name="inputUsername"
RelativePanel.Below="labelUsername"
Width="300"
Margin="0,0,0,10"
FontSize="26.667" />
<TextBlock x:Name="labelPassword"
Text="Password"
RelativePanel.Below="inputUsername"
Margin="0,0,20,0"
FontSize="26.667" />
<PasswordBox x:Name="inputPassword"
RelativePanel.Below="labelPassword"
Width="300"
Margin="0,0,0,10"
FontSize="26.667" />
<Button x:Name="buttonLogin"
Content="Login"
RelativePanel.Below="inputPassword"
RelativePanel.AlignLeftWith="inputPassword"
FontSize="26.667" />
</RelativePanel>
Grid
• The Grid is a powerful layout container.
• It acts as a placeholder for visual elements
• You specify the rows and columns, and those define the cells.
• The placement of an element in the Grid is specified using attached properties
that are set on the children of the Grid:
• Supports different types of row and column sizes in one Grid:
• Pixel size: Fixed value in pixels
• Auto size: The cell has the size of it’s contents
• Star size: whatever space is left over from fixed- and auto-sized columns is
allocated to all of the columns with star-sizing
<Image Grid.Column="3" Source="demo.png" Stretch="None"/>
Layout Properties
IsTextScaleFactorEnabled
<StackPanel Margin="10">
<Button Content="Button 1" />
<TextBlock Text="Hello World 1"
FontSize="20" Margin="0,10" />
<TextBox Text="TextBox 1" />
<Button Content="Button 2"
IsTextScaleFactorEnabled="False"
Margin="0,40,0,0" />
<TextBlock Text="Hello World 2"
IsTextScaleFactorEnabled="False"
FontSize="20" Margin="0,10" />
<TextBox Text="TextBox 2"
IsTextScaleFactorEnabled="False" />
</StackPanel>
33
Adaptive UI
Responsive Design
Adaptive UI
<RelativePanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock x:Name="labelUsername"
Text="Username"
RelativePanel.LeftOf="inputUsername"
TextAlignment="Right"
Margin="0,0,20,0"
FontSize="26.667" />
<TextBox x:Name="inputUsername"
RelativePanel.AlignRightWithPanel="True"
Width="300"
FontSize="26.667" />
<TextBlock x:Name="labelPassword“
Text="Password"
RelativePanel.LeftOf="inputPassword"
RelativePanel.AlignVerticalCenterWith="inputPassword"
TextAlignment="Right"
Margin="0,0,20,0"
FontSize="26.667" />
<PasswordBox x:Name="inputPassword"
RelativePanel.AlignRightWithPanel="True“
RelativePanel.Below="inputUsername"
Margin="0,10"
Width="300"
FontSize="26.667" />
<Button x:Name="buttonLogin"
Content="Login"
RelativePanel.Below="inputPassword"
RelativePanel.AlignLeftWith="inputPassword"
FontSize="26.667" />
</RelativePanel>
<RelativePanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock x:Name="labelUsername“
Text="Username“
Margin="0,0,20,0"
FontSize="26.667" />
<TextBox x:Name="inputUsername"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.Below="labelUsername"
Margin="0,0,0,10"
Width="300"
FontSize="26.667" />
<TextBlock x:Name="labelPassword"
Text="Password"
RelativePanel.Below="inputUsername"
Margin="0,0,20,0"
FontSize="26.667" />
<PasswordBox x:Name="inputPassword"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.Below="labelPassword"
Margin="0,0,0,10"
Width="300"
FontSize="26.667" />
<Button x:Name="buttonLogin"
Content="Login"
RelativePanel.Below="inputPassword"
RelativePanel.AlignLeftWith="inputPassword"
FontSize="26.667" />
</RelativePanel>
Adaptive UI
<RelativePanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock x:Name="labelUsername"
Text="Username"
RelativePanel.LeftOf="inputUsername"
TextAlignment="Right"
Margin="0,0,20,0"
FontSize="26.667" />
<TextBox x:Name="inputUsername"
RelativePanel.AlignRightWithPanel="True"
Width="300"
FontSize="26.667" />
<TextBlock x:Name="labelPassword“
Text="Password"
RelativePanel.LeftOf="inputPassword"
RelativePanel.AlignVerticalCenterWith="inputPassword"
TextAlignment="Right"
Margin="0,0,20,0"
FontSize="26.667" />
<PasswordBox x:Name="inputPassword"
RelativePanel.AlignRightWithPanel="True“
RelativePanel.Below="inputUsername"
Margin="0,10"
Width="300"
FontSize="26.667" />
<Button x:Name="buttonLogin"
Content="Login"
RelativePanel.Below="inputPassword"
RelativePanel.AlignLeftWith="inputPassword"
FontSize="26.667" />
</RelativePanel>
<RelativePanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock x:Name="labelUsername“
Text="Username“
Margin="0,0,20,0"
FontSize="26.667" />
<TextBox x:Name="inputUsername"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.Below="labelUsername"
Margin="0,0,0,10"
Width="300"
FontSize="26.667" />
<TextBlock x:Name="labelPassword"
Text="Password"
RelativePanel.Below="inputUsername"
Margin="0,0,20,0"
FontSize="26.667" />
<PasswordBox x:Name="inputPassword"
RelativePanel.AlignRightWithPanel="True"
RelativePanel.Below="labelPassword"
Margin="0,0,0,10"
Width="300"
FontSize="26.667" />
<Button x:Name="buttonLogin"
Content="Login"
RelativePanel.Below="inputPassword"
RelativePanel.AlignLeftWith="inputPassword"
FontSize="26.667" />
</RelativePanel>
Visual States – Setters & StateTriggers
Visual States – Setters & StateTriggers
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="VisualStateGroup">
<VisualState x:Name="Horizontal">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="600" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="labelUsername.(RelativePanel.LeftOf)" Value="inputUsername" />
<Setter Target="labelUsername.(TextBlock.TextAlignment)" Value="Right" />
<Setter Target="inputUsername.(RelativePanel.Below)" Value="" />
<Setter Target="inputUsername.(FrameworkElement.Margin)" Value="0" />
<Setter Target="labelPassword.(RelativePanel.Below)" Value="" />
<Setter Target="labelPassword.(RelativePanel.LeftOf)" Value="inputPassword" />
<Setter Target="labelPassword.(RelativePanel.AlignVerticalCenterWith)" Value="inputPassword" />
<Setter Target="labelPassword.(TextBlock.TextAlignment)" Value="Right" />
<Setter Target="inputPassword.(RelativePanel.Below)" Value="inputUsername" />
<Setter Target="inputPassword.(FrameworkElement.Margin)" Value="0,10" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
WindowsStateTriggers
WindowsStateTriggers
Adaptive design
Phone (portrait)
Tablet (landscape) / Desktop
Tailored design
Phone (portrait)
Tablet (landscape) / Desktop
DeviceFamily specific XAML
Resources
Reusable objects such as data, styles and templates
Resources
• Reusable objects such as data, styles and templates.
• Assigned a unique key (x:Key) so you can reference to it.
• Every element has a Resources property.
• Nesting Support
• All static resources are loaded on page load
• Resource is loaded even if not used
45
Convert to New Resource…
Resources in Blend
• Menu Window - Resources
• Shows all resources of all open XAML documents
• Link to Resource Dictionary
• Edit Resource
• Rename Resource
• Move Resource
• Delete Resource
• Apply Resource by Drag & Drop
47
Windows 10 - SystemAccentColor
• Reduces the need for a custom Theme
Animations & Behaviors
Storyboards & Transitions
Interactivity without Code
Key Frame Concept
• XAML supports key frames
• A key frame defines an objects target value on a moment in
an animation.
• A key frame has an interpolation method.
• A Key Frame target can be a:
• Double (X, Y, Height, Width, Opacity, Angle, etc.)
• Color (Fill, Stroke, etc.)
• Object (Visibility, Text, etc)
Storyboards
51
Record Storyboard animations
Storyboards
• The Storyboard object has interactive methods to Begin,
Pause, Resume, and Stop an animation.
public void ButtonStart_Click(object sender, MouseEventArgs e) {
if (myStoryboard.GetCurrentState() == ClockState.Stopped) {
myStoryboard.Begin();
}
}
public void ButtonPause_Click(object sender, MouseEventArgs e) {
myStoryboard.Pause();
}
public void ButtonResume_Click(object sender, MouseEventArgs e) {
myStoryboard.Resume();
}
public void ButtonStop_Click(object sender, MouseEventArgs e) {
myStoryboard.Stop();
}
Behaviors
Animation Library Transitions
<ItemsControl>
<Rectangle Fill="Red" Margin="10" />
<Rectangle Fill="Red" Margin="10"/>
<Rectangle Fill="Red" Margin="10"/>
<Rectangle Fill="Red" Margin="10"/>
<Rectangle Fill="Red" Margin="10"/>
<Rectangle Fill="Red" Margin="10"/>
<Rectangle Fill="Red" Margin="10"/>
<Rectangle Fill="Red" Margin="10"/>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid ItemHeight="150" ItemWidth="150"
Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerTransitions>
<TransitionCollection>
<ReorderThemeTransition />
</TransitionCollection>
</ItemsControl.ItemContainerTransitions>
</ItemsControl>
ShowMessageBox Action
public class ShowMessageAction : DependencyObject, IAction {
public string Text { get; set; }
public object Execute(object sender, object parameter) {
new MessageDialog(this.Text).ShowAsync();
return null;
}
}
Open Source Behaviors SDK XAML
• https://visualstudio.uservoice.com/forums/121579-visual-
studio/suggestions/5282131-open-source-behaviors-sdk-xaml-
for-visual-studio
Styling and Templating
Customize the look of an application without changing
it’s behavior
Styling and Templating
• Styling = Small Visual Changes on an Element (Font,
Background Color, etc.)
• Templating = Replacing Element’s entire Visual Tree
Styling
<Page.Resources>
<Style x:Key="HollandButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#FFFF9E00"/>
<Setter Property="FontSize" Value="40"/>
<Setter Property="FontStyle" Value="Italic"/>
</Style>
</Page.Resources>
<Grid>
<Button Content="Button"
Style="{StaticResource HollandButtonStyle}"/>
</Grid>
Implicit Styling
• If you omit the Style’s Key and specify only the TargetType,
then the Style is automatically applied to all elements of
that target type within the same scope (it is implicitly
applied).
• This is typically called a typed style as opposed to a named
style.
<Style TargetType="TextBox">
<Setter Property="FontFamily" Value="Arial Black"/>
<Setter Property="FontSize" Value="16"/>
</Style>
BasedOn Styling
<Page.Resources>
<Style x:Key="HollandButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#FFFF9E00"/>
<Setter Property="FontSize" Value="24"/>
<Setter Property="FontStyle" Value="Italic"/>
</Style>
<Style x:Key="GermanButtonStyle"
TargetType="Button"
BasedOn="{StaticResource HollandButtonStyle}">
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="BorderBrush" Value="Black"/>
</Style>
</Page.Resources>
<Grid>
<Button Content="Button"
Style="{StaticResource GermanButtonStyle}"/>
<Button Content="Button"
Style="{StaticResource HollandButtonStyle}"/>
</Grid>
Templating - CombinedStates
DataBinding
Data Binding
• Data binding is the process that establishes a connection, or binding,
between the UI and the business object which allows data to flow
between the two
• Enable clean view/model separation and binding
• Change UI presentation without code-behind modifications
• Every binding has a source and a target
• Source is the business object or another UI element
• Target is the UI element
• Binding Expressions can be one way or two way and supports
converters
Element to Element Binding
• Element binding is performed in the same manner as Data Binding
with one addition: the ElementName property. ElementName defines
the name of the binding source element.
<RelativePanel HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock Text="{Binding ElementName=mySlider, Path=Value}"
RelativePanel.RightOf="mySlider"
FontSize="32" Margin="20,0,0,0" />
<Slider x:Name="mySlider"
Maximum="10"
Value="6"
Width="400" />
</RelativePanel>
Compiled Binding {x:Bind}
• DataBind to a Property or Field of the Code Behind
• Databinding code is generated in the .g.cs file
• Up to 5x faster
• Default Mode = OneTime !!!
• Not tooling support yet!
• Use IntelliSense
<TextBlock Text="{x:Bind mySlider.Value, Mode=OneWay}"
RelativePanel.LeftOf=""
RelativePanel.RightOf="mySlider"
FontSize="32"
Margin="20,0,0,0" />
Data Window – Sample Data
@fonssonnemans
fons.sonnemans@reflectionit.nl
fonssonnemans
reflectionit.nl/blog

More Related Content

What's hot

Introduction to XAML and WPF
Introduction to XAML and WPFIntroduction to XAML and WPF
Introduction to XAML and WPF
Doncho Minkov
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
SPTechCon
 
Windows 8 app bar and live tiles
Windows 8 app bar and live tilesWindows 8 app bar and live tiles
Windows 8 app bar and live tiles
Amr Abulnaga
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjsCodemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
Fabio Franzini
 
MSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF DemystifiedMSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF Demystified
Dave Bost
 
Windows phone app development overview
Windows phone app development overviewWindows phone app development overview
Windows phone app development overview
Alan Mendelevich
 

What's hot (19)

Introduction to XAML and WPF
Introduction to XAML and WPFIntroduction to XAML and WPF
Introduction to XAML and WPF
 
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
The Magic Revealed: Four Real-World Examples of Using the Client Object Model...
 
SPCA2013 - Building Windows Client Applications for SharePoint 2013
SPCA2013 - Building Windows Client Applications for SharePoint 2013SPCA2013 - Building Windows Client Applications for SharePoint 2013
SPCA2013 - Building Windows Client Applications for SharePoint 2013
 
Cape Town MS Developer User Group: Xamarin Community Toolkit
Cape Town MS Developer User Group: Xamarin Community ToolkitCape Town MS Developer User Group: Xamarin Community Toolkit
Cape Town MS Developer User Group: Xamarin Community Toolkit
 
Windows 8 app bar and live tiles
Windows 8 app bar and live tilesWindows 8 app bar and live tiles
Windows 8 app bar and live tiles
 
Building appsinsilverlight4 part_1
Building appsinsilverlight4 part_1Building appsinsilverlight4 part_1
Building appsinsilverlight4 part_1
 
SPUnite17 Become a Developer Hero by Building Office Add ins
SPUnite17 Become a Developer Hero by Building Office Add insSPUnite17 Become a Developer Hero by Building Office Add ins
SPUnite17 Become a Developer Hero by Building Office Add ins
 
WPF For Beginners - Learn in 3 days
WPF For Beginners  - Learn in 3 daysWPF For Beginners  - Learn in 3 days
WPF For Beginners - Learn in 3 days
 
Getting Started with SharePoint Development
Getting Started with SharePoint DevelopmentGetting Started with SharePoint Development
Getting Started with SharePoint Development
 
tTecniche di sviluppo mobile per share point 2013 e office 365
tTecniche di sviluppo mobile per share point 2013 e office 365 tTecniche di sviluppo mobile per share point 2013 e office 365
tTecniche di sviluppo mobile per share point 2013 e office 365
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjsCodemotion 2013 - Designing complex applications using html5 and knockoutjs
Codemotion 2013 - Designing complex applications using html5 and knockoutjs
 
COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018COB - PowerApps - the good, the bad and the ugly - early 2018
COB - PowerApps - the good, the bad and the ugly - early 2018
 
IBM Domino Designer: Tips and tricks for maximum productivity
IBM Domino Designer: Tips and tricks for maximum productivityIBM Domino Designer: Tips and tricks for maximum productivity
IBM Domino Designer: Tips and tricks for maximum productivity
 
MSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF DemystifiedMSDN Unleashed: WPF Demystified
MSDN Unleashed: WPF Demystified
 
What's new in Xamarin.Forms
What's new in Xamarin.FormsWhat's new in Xamarin.Forms
What's new in Xamarin.Forms
 
Best Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point SolutionsBest Practices Configuring And Developing Share Point Solutions
Best Practices Configuring And Developing Share Point Solutions
 
Windows phone app development overview
Windows phone app development overviewWindows phone app development overview
Windows phone app development overview
 
SharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScriptSharePoint and the User Interface with JavaScript
SharePoint and the User Interface with JavaScript
 

Viewers also liked

13 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_1913 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_19
Niit Care
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentation
sameerraaj
 

Viewers also liked (17)

Coding for kids - TechDaysNL 2015
Coding for kids - TechDaysNL 2015Coding for kids - TechDaysNL 2015
Coding for kids - TechDaysNL 2015
 
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
 
Advanced c#
Advanced c#Advanced c#
Advanced c#
 
CSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+ReflectionCSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+Reflection
 
13 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_1913 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_19
 
Study research in April
Study research in AprilStudy research in April
Study research in April
 
Smoke and Mirrors - Reflection in C#
Smoke and Mirrors - Reflection in C#Smoke and Mirrors - Reflection in C#
Smoke and Mirrors - Reflection in C#
 
.NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know....NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know...
 
Reflection in C#
Reflection in C#Reflection in C#
Reflection in C#
 
Day02 01 Advance Feature in C# DH TDT
Day02 01 Advance Feature in C# DH TDTDay02 01 Advance Feature in C# DH TDT
Day02 01 Advance Feature in C# DH TDT
 
Angularjs ve Angularjs 2 nedir?
Angularjs ve Angularjs 2 nedir?Angularjs ve Angularjs 2 nedir?
Angularjs ve Angularjs 2 nedir?
 
AspNet MVC ile metin resim sifreleme (Steganography)
AspNet MVC ile metin resim sifreleme (Steganography)AspNet MVC ile metin resim sifreleme (Steganography)
AspNet MVC ile metin resim sifreleme (Steganography)
 
C#/.NET Little Wonders
C#/.NET Little WondersC#/.NET Little Wonders
C#/.NET Little Wonders
 
Windows 10 UWP App Development ebook
Windows 10 UWP App Development ebookWindows 10 UWP App Development ebook
Windows 10 UWP App Development ebook
 
Basic DBMS ppt
Basic DBMS pptBasic DBMS ppt
Basic DBMS ppt
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentation
 
SMOKE - The Convenient Truth [1st place Worlds Best Presentation Contest] by ...
SMOKE - The Convenient Truth [1st place Worlds Best Presentation Contest] by ...SMOKE - The Convenient Truth [1st place Worlds Best Presentation Contest] by ...
SMOKE - The Convenient Truth [1st place Worlds Best Presentation Contest] by ...
 

Similar to Building & Designing Windows 10 Universal Windows Apps using XAML and C#

An Overview Of Silverlight 2
An Overview Of Silverlight 2An Overview Of Silverlight 2
An Overview Of Silverlight 2
Clint Edmonson
 
Win j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevWin j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateev
Mihail Mateev
 
Presentation wpf
Presentation wpfPresentation wpf
Presentation wpf
danishrafiq
 
Understanding the Windows Desktop App Development Landscape + Top 10 WPF Po...
Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Po...Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Po...
Understanding the Windows Desktop App Development Landscape + Top 10 WPF Po...
MSDEVMTL
 
Divya ASP Developer
Divya ASP Developer Divya ASP Developer
Divya ASP Developer
divya k
 

Similar to Building & Designing Windows 10 Universal Windows Apps using XAML and C# (20)

Rapidly Construct LOB Applications with UWP and Visual Studio 2017
Rapidly Construct LOB Applications with UWP and Visual Studio 2017Rapidly Construct LOB Applications with UWP and Visual Studio 2017
Rapidly Construct LOB Applications with UWP and Visual Studio 2017
 
Design stunning user experience with expression blend
Design stunning user experience with expression blendDesign stunning user experience with expression blend
Design stunning user experience with expression blend
 
Windows presentation foundation
Windows presentation foundation Windows presentation foundation
Windows presentation foundation
 
An Overview Of Silverlight 2
An Overview Of Silverlight 2An Overview Of Silverlight 2
An Overview Of Silverlight 2
 
SilverlightDevIntro
SilverlightDevIntroSilverlightDevIntro
SilverlightDevIntro
 
Win j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateevWin j svsphonegap-damyan-petev-mihail-mateev
Win j svsphonegap-damyan-petev-mihail-mateev
 
Hello windows 10: An overview of the new features for developers in WIndows 10
Hello windows 10: An overview of the new features for developers in WIndows 10Hello windows 10: An overview of the new features for developers in WIndows 10
Hello windows 10: An overview of the new features for developers in WIndows 10
 
Browser Developer Tools for APEX Developers
Browser Developer Tools for APEX DevelopersBrowser Developer Tools for APEX Developers
Browser Developer Tools for APEX Developers
 
Tutti pronti per Windows 10?
Tutti pronti per Windows 10?Tutti pronti per Windows 10?
Tutti pronti per Windows 10?
 
Deeper into Windows 10 Development
Deeper into Windows 10 DevelopmentDeeper into Windows 10 Development
Deeper into Windows 10 Development
 
TypeScript and SharePoint Framework
TypeScript and SharePoint FrameworkTypeScript and SharePoint Framework
TypeScript and SharePoint Framework
 
Introduction to Xamarin - Confoo 2015
Introduction to Xamarin - Confoo 2015Introduction to Xamarin - Confoo 2015
Introduction to Xamarin - Confoo 2015
 
Presentation wpf
Presentation wpfPresentation wpf
Presentation wpf
 
Cross platform mobile app development with Xamarin
Cross platform mobile app development with XamarinCross platform mobile app development with Xamarin
Cross platform mobile app development with Xamarin
 
Understanding the Windows Desktop App Development Landscape + Top 10 WPF Po...
Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Po...Understanding the Windows Desktop App Development Landscape   + Top 10 WPF Po...
Understanding the Windows Desktop App Development Landscape + Top 10 WPF Po...
 
Windows 10 pentru dezvoltatori - InfoEducație 2015
Windows 10 pentru dezvoltatori - InfoEducație 2015Windows 10 pentru dezvoltatori - InfoEducație 2015
Windows 10 pentru dezvoltatori - InfoEducație 2015
 
Divya ASP Developer
Divya ASP Developer Divya ASP Developer
Divya ASP Developer
 
HTML5 apps for iOS (and probably beyond)
HTML5 apps for iOS (and probably beyond)HTML5 apps for iOS (and probably beyond)
HTML5 apps for iOS (and probably beyond)
 
Html5
Html5Html5
Html5
 
KhajavaliShaik
KhajavaliShaikKhajavaliShaik
KhajavaliShaik
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 

Building & Designing Windows 10 Universal Windows Apps using XAML and C#

  • 1. Fons Sonnemans Reflection IT Building & Designing Windows 10 Universal Windows Apps using XAML and C# @fonssonnemans www.storeappsug.nl @StoreAppsUG
  • 2. Topics • Universal Windows Apps • Blend 2015 • Layout Controls • Adaptive UI • Resources • Animations & Behaviors • Styling & Templating • Data Binding
  • 3. Fons Sonnemans • Software Development Consultant • Programming Languages • Clipper, Smalltalk, Visual Basic, C# • Platforms • Windows Forms, ASP.NET (Web Forms, MVC), XAML (WPF, Silverlight, Windows Phone, Windows 8 & 10) • Databases • MS SQL Server, Oracle • Role • Trainer, Coach, Advisor, Architect, Designer, App Developer • More info: www.reflectionit.nl
  • 5. Universal Windows Apps Introducing the Universal Windows Platform (UWP)
  • 6. Easy for users to get & stay current Unified core and app platform The convergence journey Windows 10 Converged OS kernel Converged app model
  • 7. Phone Small Tablet 2-in-1s (Tablet or Laptop) Desktops & All-in-OnesPhablet Large Tablet Classic Laptop Xbox IoTSurface Hub Holographic Windows 10
  • 8. One Store + One Dev Center Reuse Existing Code One SDK + Tooling Adaptive User Interface Natural User Inputs One Universal Windows Platform
  • 9. Universal Windows Platform • A single API surface • A guaranteed API surface • The same on all devices Phone Device Xbox Device Desktop Device Windows Core Universal Windows Platform
  • 10. Universal Windows Platform • One Operating System • One Windows core for all devices • One App Platform • Apps run across every family • One Dev Center • Single submission flow and dashboard • One Store • Global reach, local monetization Consumers, Business & Education
  • 11. Adaptive code • A compatible binary across devices • Universal API with device-specific implementation • Light up our app with capabilities • Testing for capabilities and namespaces
  • 12. UAP Windows Core Windows Core Windows Core Windows Core UAP UAP UAP Desktop Mobile Xbox More… Adaptive codePlatform extensions (capabilities)
  • 13. Platform extensions (capabilities) • Device-specific API • Family-specific capabilities • Compatible across devices • Unique update cadence Phone Device Xbox Device Desktop Device Windows Core Universal Windows Platform Windows App Phone extension Xbox extension Desktop extension
  • 14. Test capabilities at runtime • Use Adaptive Code to light-up your app on specific devices var api = "Windows.Phone.UI.Input.HardwareButtons"; if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent(api)) { Windows.Phone.UI.Input.HardwareButtons.CameraPressed += CameraButtonPressed; }
  • 16. Pre Blend 2015 • Blend is a tool for creating great user experiences, with deep focus on best-in-class UI design capabilities. • Visual Studio is a tool for creating great apps, with focus on best-in-class code editing and debugging capabilities. • Supports • WPF, Silverlight (Phone), Windows 8 & 8.1
  • 17. Feedback themes • No XAML or C# IntelliSense • File reload experiences when switching between VS and Blend • Inconsistent shell & project system experiences with VS • Git and TFS • Expand/collapse of project nodes • Performance and scalability of large solutions
  • 18. Blend for Visual Studio 2015 • Adds Windows 10 support • Rebuilt from the ground up using VS technologies • IntelliSense, GoTo Definition, Peek, Debugging, Window Layouts, Reloading, Customizing • Retains almost all of the unique Blend capabilities • SketchFlow is killed
  • 20. UI Debugging for XAML • Visual tree inspection and manipulation • Live tracking of tree and property changes • Fully integrated into debugging • Upcoming • Serializing edits back into source • Edit-n-continue • Data debugging visualizations
  • 23. Layout Controls • Canvas • Simplest, placement relative to the top left edge • Not scalable • StackPanel • Horizontal or vertical stacking • RelativePanel • You arrange child elements by specifying how they should be arranged in relationships to each other, and how they should position relative to their content and/or their parent • Grid • Uses rows and columns • Flexible Positioning (similar to <TABLE /> in HTML) • More • Border (“Obsolete”), ScrollViewer, Viewbox, VariableSizedWrapGrid
  • 24. Canvas • Is a Drawing Surface • Children have fixed positions relative to top-left-corner <Canvas Width="250" Height="200" Background="Gray"> <Rectangle Canvas.Top="25" Canvas.Left="25" Width="200" Height="150" Fill="Yellow" /> </Canvas> The Canvas The Rectangle
  • 25. XAML - Attached Properties • Top & Left properties only make sense inside a Canvas <Canvas Width="250" Height="200" Background="Gray"> <Rectangle Canvas.Top="25" Canvas.Left="25" Width="200" Height="150" Fill="Yellow" /> </Canvas>
  • 26. StackPanel • The StackPanel will place its children in either a column (default) or row. This is controlled by the Orientation property. <StackPanel Orientation="Horizontal" BorderBrush="#FF0B77FD" BorderThickness="2" Padding="5"> <Button Content="Button1" FontSize="30" /> <Button Content="Button2" FontSize="30" Margin="5,0" /> <Button Content="Button3" FontSize="30" /> </StackPanel> New Properties in Win10 Makes ‘Border’ obsolete
  • 27. Nested Stackpanels <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <StackPanel Orientation="Horizontal" Margin="0,0,0,12"> <TextBlock Text="Username" FontSize="26.667" Width="240" TextAlignment="Right" Margin="0,0,20,0"/> <TextBox FontSize="26.667" Width="300"/> </StackPanel> <StackPanel Orientation="Horizontal" Margin="0,0,0,12"> <TextBlock Text="Password" Margin="0,0,20,0" FontSize="26.667" Width="240" TextAlignment="Right"/> <PasswordBox Margin="0" FontSize="26.667" Width="300"/> </StackPanel> <Button Content="Login" HorizontalAlignment="Left" Margin="260,0,0,0" FontSize="26.667"/> </StackPanel>
  • 28. RelativePanel • Decrease Tree size <RelativePanel HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock x:Name="labelUsername" Text="Username" RelativePanel.LeftOf="inputUsername" TextAlignment="Right" Margin="0,0,20,0" FontSize="26.667" /> <TextBox x:Name="inputUsername" RelativePanel.AlignRightWithPanel="True" Width="300" FontSize="26.667" /> <TextBlock x:Name="labelPassword“ Text="Password" RelativePanel.LeftOf="inputPassword" RelativePanel.AlignVerticalCenterWith="inputPassword" TextAlignment="Right" Margin="0,0,20,0" FontSize="26.667" /> <PasswordBox x:Name="inputPassword" RelativePanel.Below="inputUsername" RelativePanel.AlignRightWithPanel="True" Width="300" Margin="0,10" FontSize="26.667" /> <Button x:Name="buttonLogin" Content="Login" RelativePanel.Below="inputPassword" RelativePanel.AlignLeftWith="inputPassword" FontSize="26.667" /> </RelativePanel>
  • 29. RelativePanel • Vertical layout <RelativePanel HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock x:Name="labelUsername“ Text="Username“ Margin="0,0,20,0" FontSize="26.667" /> <TextBox x:Name="inputUsername" RelativePanel.Below="labelUsername" Width="300" Margin="0,0,0,10" FontSize="26.667" /> <TextBlock x:Name="labelPassword" Text="Password" RelativePanel.Below="inputUsername" Margin="0,0,20,0" FontSize="26.667" /> <PasswordBox x:Name="inputPassword" RelativePanel.Below="labelPassword" Width="300" Margin="0,0,0,10" FontSize="26.667" /> <Button x:Name="buttonLogin" Content="Login" RelativePanel.Below="inputPassword" RelativePanel.AlignLeftWith="inputPassword" FontSize="26.667" /> </RelativePanel>
  • 30. Grid • The Grid is a powerful layout container. • It acts as a placeholder for visual elements • You specify the rows and columns, and those define the cells. • The placement of an element in the Grid is specified using attached properties that are set on the children of the Grid: • Supports different types of row and column sizes in one Grid: • Pixel size: Fixed value in pixels • Auto size: The cell has the size of it’s contents • Star size: whatever space is left over from fixed- and auto-sized columns is allocated to all of the columns with star-sizing <Image Grid.Column="3" Source="demo.png" Stretch="None"/>
  • 32. IsTextScaleFactorEnabled <StackPanel Margin="10"> <Button Content="Button 1" /> <TextBlock Text="Hello World 1" FontSize="20" Margin="0,10" /> <TextBox Text="TextBox 1" /> <Button Content="Button 2" IsTextScaleFactorEnabled="False" Margin="0,40,0,0" /> <TextBlock Text="Hello World 2" IsTextScaleFactorEnabled="False" FontSize="20" Margin="0,10" /> <TextBox Text="TextBox 2" IsTextScaleFactorEnabled="False" /> </StackPanel> 33
  • 34. Adaptive UI <RelativePanel HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock x:Name="labelUsername" Text="Username" RelativePanel.LeftOf="inputUsername" TextAlignment="Right" Margin="0,0,20,0" FontSize="26.667" /> <TextBox x:Name="inputUsername" RelativePanel.AlignRightWithPanel="True" Width="300" FontSize="26.667" /> <TextBlock x:Name="labelPassword“ Text="Password" RelativePanel.LeftOf="inputPassword" RelativePanel.AlignVerticalCenterWith="inputPassword" TextAlignment="Right" Margin="0,0,20,0" FontSize="26.667" /> <PasswordBox x:Name="inputPassword" RelativePanel.AlignRightWithPanel="True“ RelativePanel.Below="inputUsername" Margin="0,10" Width="300" FontSize="26.667" /> <Button x:Name="buttonLogin" Content="Login" RelativePanel.Below="inputPassword" RelativePanel.AlignLeftWith="inputPassword" FontSize="26.667" /> </RelativePanel> <RelativePanel HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock x:Name="labelUsername“ Text="Username“ Margin="0,0,20,0" FontSize="26.667" /> <TextBox x:Name="inputUsername" RelativePanel.AlignRightWithPanel="True" RelativePanel.Below="labelUsername" Margin="0,0,0,10" Width="300" FontSize="26.667" /> <TextBlock x:Name="labelPassword" Text="Password" RelativePanel.Below="inputUsername" Margin="0,0,20,0" FontSize="26.667" /> <PasswordBox x:Name="inputPassword" RelativePanel.AlignRightWithPanel="True" RelativePanel.Below="labelPassword" Margin="0,0,0,10" Width="300" FontSize="26.667" /> <Button x:Name="buttonLogin" Content="Login" RelativePanel.Below="inputPassword" RelativePanel.AlignLeftWith="inputPassword" FontSize="26.667" /> </RelativePanel>
  • 35. Adaptive UI <RelativePanel HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock x:Name="labelUsername" Text="Username" RelativePanel.LeftOf="inputUsername" TextAlignment="Right" Margin="0,0,20,0" FontSize="26.667" /> <TextBox x:Name="inputUsername" RelativePanel.AlignRightWithPanel="True" Width="300" FontSize="26.667" /> <TextBlock x:Name="labelPassword“ Text="Password" RelativePanel.LeftOf="inputPassword" RelativePanel.AlignVerticalCenterWith="inputPassword" TextAlignment="Right" Margin="0,0,20,0" FontSize="26.667" /> <PasswordBox x:Name="inputPassword" RelativePanel.AlignRightWithPanel="True“ RelativePanel.Below="inputUsername" Margin="0,10" Width="300" FontSize="26.667" /> <Button x:Name="buttonLogin" Content="Login" RelativePanel.Below="inputPassword" RelativePanel.AlignLeftWith="inputPassword" FontSize="26.667" /> </RelativePanel> <RelativePanel HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock x:Name="labelUsername“ Text="Username“ Margin="0,0,20,0" FontSize="26.667" /> <TextBox x:Name="inputUsername" RelativePanel.AlignRightWithPanel="True" RelativePanel.Below="labelUsername" Margin="0,0,0,10" Width="300" FontSize="26.667" /> <TextBlock x:Name="labelPassword" Text="Password" RelativePanel.Below="inputUsername" Margin="0,0,20,0" FontSize="26.667" /> <PasswordBox x:Name="inputPassword" RelativePanel.AlignRightWithPanel="True" RelativePanel.Below="labelPassword" Margin="0,0,0,10" Width="300" FontSize="26.667" /> <Button x:Name="buttonLogin" Content="Login" RelativePanel.Below="inputPassword" RelativePanel.AlignLeftWith="inputPassword" FontSize="26.667" /> </RelativePanel>
  • 36. Visual States – Setters & StateTriggers
  • 37. Visual States – Setters & StateTriggers <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="VisualStateGroup"> <VisualState x:Name="Horizontal"> <VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth="600" /> </VisualState.StateTriggers> <VisualState.Setters> <Setter Target="labelUsername.(RelativePanel.LeftOf)" Value="inputUsername" /> <Setter Target="labelUsername.(TextBlock.TextAlignment)" Value="Right" /> <Setter Target="inputUsername.(RelativePanel.Below)" Value="" /> <Setter Target="inputUsername.(FrameworkElement.Margin)" Value="0" /> <Setter Target="labelPassword.(RelativePanel.Below)" Value="" /> <Setter Target="labelPassword.(RelativePanel.LeftOf)" Value="inputPassword" /> <Setter Target="labelPassword.(RelativePanel.AlignVerticalCenterWith)" Value="inputPassword" /> <Setter Target="labelPassword.(TextBlock.TextAlignment)" Value="Right" /> <Setter Target="inputPassword.(RelativePanel.Below)" Value="inputUsername" /> <Setter Target="inputPassword.(FrameworkElement.Margin)" Value="0,10" /> </VisualState.Setters> </VisualState> </VisualStateGroup> </VisualStateManager.VisualStateGroups>
  • 43. Resources Reusable objects such as data, styles and templates
  • 44. Resources • Reusable objects such as data, styles and templates. • Assigned a unique key (x:Key) so you can reference to it. • Every element has a Resources property. • Nesting Support • All static resources are loaded on page load • Resource is loaded even if not used 45
  • 45. Convert to New Resource…
  • 46. Resources in Blend • Menu Window - Resources • Shows all resources of all open XAML documents • Link to Resource Dictionary • Edit Resource • Rename Resource • Move Resource • Delete Resource • Apply Resource by Drag & Drop 47
  • 47. Windows 10 - SystemAccentColor • Reduces the need for a custom Theme
  • 48. Animations & Behaviors Storyboards & Transitions Interactivity without Code
  • 49. Key Frame Concept • XAML supports key frames • A key frame defines an objects target value on a moment in an animation. • A key frame has an interpolation method. • A Key Frame target can be a: • Double (X, Y, Height, Width, Opacity, Angle, etc.) • Color (Fill, Stroke, etc.) • Object (Visibility, Text, etc)
  • 52. Storyboards • The Storyboard object has interactive methods to Begin, Pause, Resume, and Stop an animation. public void ButtonStart_Click(object sender, MouseEventArgs e) { if (myStoryboard.GetCurrentState() == ClockState.Stopped) { myStoryboard.Begin(); } } public void ButtonPause_Click(object sender, MouseEventArgs e) { myStoryboard.Pause(); } public void ButtonResume_Click(object sender, MouseEventArgs e) { myStoryboard.Resume(); } public void ButtonStop_Click(object sender, MouseEventArgs e) { myStoryboard.Stop(); }
  • 54. Animation Library Transitions <ItemsControl> <Rectangle Fill="Red" Margin="10" /> <Rectangle Fill="Red" Margin="10"/> <Rectangle Fill="Red" Margin="10"/> <Rectangle Fill="Red" Margin="10"/> <Rectangle Fill="Red" Margin="10"/> <Rectangle Fill="Red" Margin="10"/> <Rectangle Fill="Red" Margin="10"/> <Rectangle Fill="Red" Margin="10"/> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <ItemsWrapGrid ItemHeight="150" ItemWidth="150" Orientation="Horizontal" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemContainerTransitions> <TransitionCollection> <ReorderThemeTransition /> </TransitionCollection> </ItemsControl.ItemContainerTransitions> </ItemsControl>
  • 55. ShowMessageBox Action public class ShowMessageAction : DependencyObject, IAction { public string Text { get; set; } public object Execute(object sender, object parameter) { new MessageDialog(this.Text).ShowAsync(); return null; } } Open Source Behaviors SDK XAML • https://visualstudio.uservoice.com/forums/121579-visual- studio/suggestions/5282131-open-source-behaviors-sdk-xaml- for-visual-studio
  • 56. Styling and Templating Customize the look of an application without changing it’s behavior
  • 57. Styling and Templating • Styling = Small Visual Changes on an Element (Font, Background Color, etc.) • Templating = Replacing Element’s entire Visual Tree
  • 58. Styling <Page.Resources> <Style x:Key="HollandButtonStyle" TargetType="Button"> <Setter Property="Background" Value="#FFFF9E00"/> <Setter Property="FontSize" Value="40"/> <Setter Property="FontStyle" Value="Italic"/> </Style> </Page.Resources> <Grid> <Button Content="Button" Style="{StaticResource HollandButtonStyle}"/> </Grid>
  • 59. Implicit Styling • If you omit the Style’s Key and specify only the TargetType, then the Style is automatically applied to all elements of that target type within the same scope (it is implicitly applied). • This is typically called a typed style as opposed to a named style. <Style TargetType="TextBox"> <Setter Property="FontFamily" Value="Arial Black"/> <Setter Property="FontSize" Value="16"/> </Style>
  • 60. BasedOn Styling <Page.Resources> <Style x:Key="HollandButtonStyle" TargetType="Button"> <Setter Property="Background" Value="#FFFF9E00"/> <Setter Property="FontSize" Value="24"/> <Setter Property="FontStyle" Value="Italic"/> </Style> <Style x:Key="GermanButtonStyle" TargetType="Button" BasedOn="{StaticResource HollandButtonStyle}"> <Setter Property="Background" Value="White"/> <Setter Property="Foreground" Value="Black"/> <Setter Property="BorderBrush" Value="Black"/> </Style> </Page.Resources> <Grid> <Button Content="Button" Style="{StaticResource GermanButtonStyle}"/> <Button Content="Button" Style="{StaticResource HollandButtonStyle}"/> </Grid>
  • 63. Data Binding • Data binding is the process that establishes a connection, or binding, between the UI and the business object which allows data to flow between the two • Enable clean view/model separation and binding • Change UI presentation without code-behind modifications • Every binding has a source and a target • Source is the business object or another UI element • Target is the UI element • Binding Expressions can be one way or two way and supports converters
  • 64. Element to Element Binding • Element binding is performed in the same manner as Data Binding with one addition: the ElementName property. ElementName defines the name of the binding source element. <RelativePanel HorizontalAlignment="Center" VerticalAlignment="Center"> <TextBlock Text="{Binding ElementName=mySlider, Path=Value}" RelativePanel.RightOf="mySlider" FontSize="32" Margin="20,0,0,0" /> <Slider x:Name="mySlider" Maximum="10" Value="6" Width="400" /> </RelativePanel>
  • 65. Compiled Binding {x:Bind} • DataBind to a Property or Field of the Code Behind • Databinding code is generated in the .g.cs file • Up to 5x faster • Default Mode = OneTime !!! • Not tooling support yet! • Use IntelliSense <TextBlock Text="{x:Bind mySlider.Value, Mode=OneWay}" RelativePanel.LeftOf="" RelativePanel.RightOf="mySlider" FontSize="32" Margin="20,0,0,0" />
  • 66. Data Window – Sample Data