wpf - the future of gui is near

36
Bartłomiej Filipek | Jagiellonian University | bfilipek.com | [email protected] WPF : The future of Graphical User Interface is near!

Upload: bartlomiej-filipek

Post on 25-Dec-2014

3.605 views

Category:

Technology


3 download

DESCRIPTION

Presentation about Windows Presentation Foundation - that appeared in the .NET Framework 3.0. The technology gives us ability to create outstanding UI for our applications. I gave that lecture for IT Academic Days at my University.

TRANSCRIPT

Page 1: WPF - the future of GUI is near

Bartłomiej Filipek | Jagiellonian University | bfilipek.com | [email protected]

WPF: The future of Graphical User

Interface is near!

Page 2: WPF - the future of GUI is near

UI

UI’s are getting better and better…

but do we, as programmers, try to

make our apps visually attractive?

Page 3: WPF - the future of GUI is near

UI

http://i.imgur.com/pyz0K.png It would be hard to change

those standard dialogs…

Page 4: WPF - the future of GUI is near

UI

But maybe we can do something with search result

browsing, photos and other resources… ?

Page 5: WPF - the future of GUI is near

Better?

Cooliris My app – search3D

From Apple…

Page 6: WPF - the future of GUI is near

Samples

Play

Samples of my app: Search3D – available on my site bfilipek.com.

Page 7: WPF - the future of GUI is near

Plan

What is WPF?

How can I use this?

Are there any tools?

Where can I find it?

Future?

Page 8: WPF - the future of GUI is near

3.0

Optimalizations

2006

Vista & Server 2008

Architecture is mostly the same as in 2.0

But…

Page 9: WPF - the future of GUI is near

.NET 3.0

CLR WCF

WWF WPF

WCS

We have four new and interesting components:

• WCF – communication between apps, services…

• WWF – workflows

• WCS – card space

• And WPF – new and outstanding UIs

Page 10: WPF - the future of GUI is near

WPF – briefly…

from MSDN

Managed

Native

GPU

WPF uses GPU to render all the

controls and elements, so it needed

a mix of native and managed code.

Communication

between managed

code and directX…

Page 11: WPF - the future of GUI is near

WPF - features

Controls

Video

Text

GPU

Documents

Page 12: WPF - the future of GUI is near

Controls

There are more then 120 controls,

they are written almost from

scratch…

Page 13: WPF - the future of GUI is near

Data

Data

Xml

Database

Variables

UI

Control

Data View

binding

template

Page 14: WPF - the future of GUI is near

Data Template

<DataTemplate DataType="{x:Type local:Task}">

<StackPanel>

<TextBlock Text="{Binding Path=TaskName}" />

<TextBlock Text="{Binding Path=Description}"/>

<TextBlock Text="{Binding Path=Priority}"/>

</StackPanel>

</DataTemplate>

Page 15: WPF - the future of GUI is near

Effects

Page 16: WPF - the future of GUI is near

Animations

Almost everything can be animated!

Positions

Shapes

Colors

Sizes

Page 17: WPF - the future of GUI is near

3D

Lights

Cameras

Animations

Meshes

Although WPF is based on the GPU

redering, it is designed to render

GUIs not scenes like in FPP

games… it would be hard to do some

complicated 3D game in that.

Page 18: WPF - the future of GUI is near

Application Model

<Window

xmlns="http://scn"

xmlns:x="http"

x:Class="SDKSample.AWindow"

Title="Window with Button"

Width="250" Height="100">

<!-- Add button to window --

>

<Button Name="button"

Click="button_Click">Click

Me!</Button>

</Window>

using System.Windows; // Window, RoutedEventArgs, MessageBox

namespace SDKSample

{

public partial class AWindow : Window

{

public AWindow()

{

// InitializeComponent call is required to merge the UI

// that is defined in markup with this class, including

// setting properties and registering event handlers

InitializeComponent();

}

void button_Click(object sender, RoutedEventArgs e)

{

// Show message box when button is clicked

MessageBox.Show("Hello, Windows Presentation Foundation!");

}

}

}

Code XAML Application

Page 19: WPF - the future of GUI is near

Visual Tree

window grid

Panel1

Button

Menu

radioButton

Panel2

Canvas

etditBox

listbox

documentView

At the beginning the VisualTree from

Xaml is created so that it can be

effectively renderd on the screen…

Page 20: WPF - the future of GUI is near

XAML

<Window

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

x:Class="SDKSample.AWindow"

Title="Window with Button"

Width="250" Height="100">

<!-- Add button to window -->

<Button Name="button" Click="button_Click">Click Me!</Button>

</Window>

XAML is based on XML, and in some

part is similar to XBL (from Mozilla).

XAML is designed to describe UI in

more effective and intuitive way than

we could code in C# for instance…

Page 21: WPF - the future of GUI is near

Animations

<Rectangle

Name="MyRectangle"

Width="100"

Height="100"

Fill="Blue">

<Rectangle.Triggers>

<!-- Animates the rectangle's opacity. -->

<EventTrigger RoutedEvent="Rectangle.Loaded">

<BeginStoryboard>

<Storyboard>

<DoubleAnimation

Storyboard.TargetName="MyRectangle"

Storyboard.TargetProperty="Opacity"

From="1.0" To="0.0" Duration="0:0:5"

AutoReverse="True" RepeatBehavior="Forever" />

</Storyboard>

</BeginStoryboard>

</EventTrigger>

</Rectangle.Triggers>

</Rectangle>

Page 22: WPF - the future of GUI is near

Samples

Play

Very basic samples from MSDN or

even from the template that is in the

VisualStudio08…

Page 23: WPF - the future of GUI is near

Tools

Division: Artist team and Programmers Team

Programmer is not a designer…!

Artist is not a coder…!

Expression Studio

VisualStudio 2008/2010

Page 24: WPF - the future of GUI is near

Blend

Show some Blend UI and how it

looks…

Page 25: WPF - the future of GUI is near

Debug

VisualStudio 08/10

Useful tools:

Snoop

Performance Profiling Tools for WPF

Page 26: WPF - the future of GUI is near

Where is WPF?

Where can we use it?

Everywhere!

On the market:

VisualStudio 2010!

Yahoo! Messanger

Windows Messanger

Silverlight…

Page 27: WPF - the future of GUI is near

Samples

Play

Samples from Blend and some more

advanced applications…

Page 28: WPF - the future of GUI is near

Additionals…

PixelShaders!

XBAP

ClickOnce

Page 29: WPF - the future of GUI is near

Interop

WPF

Win32Api

WinForms

DirectX

XNA

OpenGL WPF can be used in one application with some

other technologies like WinForms, WinApi, etc…

When we use it with DirectX there can be some

problems with the performance…

Page 30: WPF - the future of GUI is near

RIA

Competitor for Adobe Flash

Subset of WPF’s XAML

Less features and a bit limited

But it can be used in browsers without the whole .NET platform…!

Page 31: WPF - the future of GUI is near

The future

Better interop

MultiTouch!

Ribbons

Integration with Windows 7

Graphics

PixelShader 3.0

Cached Composition

+ features of .NET4!

Page 32: WPF - the future of GUI is near

Advice

Use powerful fatures of WPF with a care!

Do you really need 3D?

2d is far more better for UI

3d can be used usually in rare cases

Colors

Layout

Performance

Page 33: WPF - the future of GUI is near

Sum up

Use your imagination!

Page 35: WPF - the future of GUI is near

Questions?

Page 36: WPF - the future of GUI is near

Bartłomiej Filipek

bfilipek.com

[email protected]

Thanks for watching