introdução ao windows presentation foundation (wpf)

24
Introdução ao Windows Presentation Foundation (WPF) Sara Silva http://netpont o.org 6ª Reunião Presencial – 23/01/2010

Upload: sara-silva

Post on 06-May-2015

1.822 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: IntroduçãO ao Windows Presentation Foundation (WPF)

Introdução ao Windows Presentation Foundation (WPF)

Sara Silva

http://netponto.org6ª Reunião Presencial – 23/01/2010

Page 2: IntroduçãO ao Windows Presentation Foundation (WPF)

Sara Silva3 anos de experiência profissional em TI

Lic. Matemática: Especialização em Computação - DMUC

MCPD: Windows Developer 3.5MCTS: WPF 3.5 e Windows Forms 3.5

Page 3: IntroduçãO ao Windows Presentation Foundation (WPF)

Agenda• Introdução ao WPF

• Tipos de Aplicações

• Interface com o Utilizador- Layout e Controlos- WPFToolkit e WPF Ribbon

• Resources

• Styles

Page 4: IntroduçãO ao Windows Presentation Foundation (WPF)

Introdução ao WPFArquitectura

Page 5: IntroduçãO ao Windows Presentation Foundation (WPF)

Introdução ao WPFClasses

Page 6: IntroduçãO ao Windows Presentation Foundation (WPF)

Introdução ao WPFXAML = Extensible Application Markup Language

<Button Width="100"> OK <Button.Background> LightBlue </Button.Background></Button>

XAML

Button b1 = new Button();b1.Content = "OK";b1.Background = new SolidColorBrush(Colors.LightBlue);b1.Width = 100;

C#

Dim b1 As New Buttonb1.Content = "OK"b1.Background = New _ SolidColorBrush(Colors.LightBlue)b1.Width = 100

VB.NET

Page 7: IntroduçãO ao Windows Presentation Foundation (WPF)

Tipos de Aplicações

Top-Level UI Object WPF Applications VS2008 ProjectsWindow Windows Application WPF Application

Page Navigation Application WPF Application

Page Xaml Browser Applications (XBAPs) WPF Browser Application

Page 8: IntroduçãO ao Windows Presentation Foundation (WPF)

Dos tipos de aplicações no Visual Studio 2008

demonstração

Page 9: IntroduçãO ao Windows Presentation Foundation (WPF)

Interface com o utilizador• ControlLayout

– Grid– Canvas– DockPanel– StackPanel– WrapPanel

Page 10: IntroduçãO ao Windows Presentation Foundation (WPF)

Do ControlLayout e dos controlos de WPF no

Visual Studio 2008

demonstração

Page 11: IntroduçãO ao Windows Presentation Foundation (WPF)

Interface com o utilizador• WPFToolkit

DataGrid Calendar DatePicker

Page 12: IntroduçãO ao Windows Presentation Foundation (WPF)

Interface com o utilizador• WPF Ribbon

- RibbonWindow - RibbonControl

Page 13: IntroduçãO ao Windows Presentation Foundation (WPF)

Do WPFToolkit e WPF Ribbon numa aplicação

demonstração

Page 14: IntroduçãO ao Windows Presentation Foundation (WPF)

Resources• ResourceDictionary

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

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib"> <system:String x:Key="buttonText">

Hello World!</system:String>

</ResourceDictionary>

Page 15: IntroduçãO ao Windows Presentation Foundation (WPF)

Resources• MergedDictionaries

<ResourceDictionary> <ResourceDictionary.MergedDictionaries>

<ResourceDictionary Source="MyResourceDictionary1.xaml"/>

<ResourceDictionary Source="MyResourceDictionary2.xaml"/> </ResourceDictionary.MergedDictionaries> </ResourceDictionary>

Page 16: IntroduçãO ao Windows Presentation Foundation (WPF)

Styles <Window.Resources> <Style x:Key="ButtonStyle"> <Setter Property="Control.Background" Value="BlueViolet" /> <Setter Property="Control.Foreground" Value="White" /> <Setter Property="Control.FontSize" Value="20" /> <Setter Property="Control.Width" Value="50" /> <Setter Property="Control.Height" Value="30" /> </Style></Window.Resources>...<Button Width="100" Style="{StaticResource ButtonStyle}">

Page 17: IntroduçãO ao Windows Presentation Foundation (WPF)

Da criação de resources e styles

demonstração

Page 18: IntroduçãO ao Windows Presentation Foundation (WPF)

WindowsClient.net

WindowsClient

http://windowsclient.net

Page 19: IntroduçãO ao Windows Presentation Foundation (WPF)

Livros

Page 20: IntroduçãO ao Windows Presentation Foundation (WPF)

Dúvidas?

Page 21: IntroduçãO ao Windows Presentation Foundation (WPF)

ReferênciasIntroduction to Windows Presentation Foundation (MSDN)

http://msdn.microsoft.com/en-us/library/aa970268.aspx

XAML Overviewhttp://msdn.microsoft.com/en-us/library/ms752059.aspx

WPF - Codeplexhttp://wpf.codeplex.com/

WPF Tutorialhttp://www.wpftutorial.net/Home.html

Foundation Blend 2 : Building Applications in WPF and Silverlighthttp://www.windowspresentationfoundation.com/

XAMLPThttp://xamlpt.com/

Page 22: IntroduçãO ao Windows Presentation Foundation (WPF)

Propostas de Apresentações de WPF• Manipulação de Dados:

– Binding, MultiBinding, IValueConverter, ValidationRule– ObservableCollection, INotifyPropertyChanged– ICollectionView e Group, Sort, Filter dados

• Styles e Animações– Definindo Styles– Trigger, Multi-trigger, EventTrigger, Data Trigger– Control Template, Data Template, Template– Storyboard– Tipos de Animações

• Outras? ...

Page 23: IntroduçãO ao Windows Presentation Foundation (WPF)

Patrocinadores desta reunião

Page 24: IntroduçãO ao Windows Presentation Foundation (WPF)

Obrigado!

Sara [email protected]

http://twitter.com/saramgsilvahttp://pt.linkedin.com/in/saramgsilva