Your SlideShare is downloading. ×
Introdução ao Windows Presentation Foundation (WPF)
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Introdução ao Windows Presentation Foundation (WPF)


Published on

Apresentação de introdução ao Windows Presentation Foundation (WPF), seguida de várias demonstrações práticas sobre utilização dos diferentes controlos de layout, como Grid, Canvas, DockPanel, entre …

Apresentação de introdução ao Windows Presentation Foundation (WPF), seguida de várias demonstrações práticas sobre utilização dos diferentes controlos de layout, como Grid, Canvas, DockPanel, entre outros... Utilização dos controlos DataGrid, Calendar e DatePicker do WPF Toolkit e a Ribbon Bar. do Office UI, e criação de Resources e Styles, na 6ª reunião presencial da comunidade NetPonto

Published in: Technology

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide
  • WPF provides a very rich and highly integrated UI stack, exposed through a .NET programming model. Figure 1 illustrates the overall architecture and the key components of WPF.ARCHITECTURE: This diagram shows the basic architecture for WPF. Notice all the different media types (in yellow) that are handled by WPF: Vectors, Bitmaps, 3D, Audio and Video, Text and Effects! Second, notice how the animation capabilities of WPF spans across all the media types, allowing you to animate any kind of content. The WPF Composition Engine (in black) is one of the revolutionary features of WPF. This engine provides capability of having live content inside of another content. This means that you can have a 3D object rotating inside a Button control and furthermore you can have a video projected over the surface of the 3D object! This tree structure and nesting capability is available for all content and every control that WPF provides. WPF is not only about rich user interfaces but also about high fidelity information, connection and data. Controls, Layout and Databinding are just some of the examples of this power. The XPS format is a rich document definition that allows us to enjoy the best of WPF in a document. In summary, WPF represents an evolution in terms of richness, interactivity as well as information and data.Link:
  • WPF is structured by using subsystems or classes that are defined in different namespaces. These classes have a very deep inheritance hierarchy. Figure: shows these important classes and their relationships.The following list describes the classes that make up the WPF subsystems (links lead to documentation on the MSDN Web site for the individual class):Object. The base class for all .NET Framework classes. DispatcherObject. The base class that handles messages from other objects.DependencyObject (DO). The base class for any object that can support dependency properties (DPs). This class defines the GetValue and SetValue methods that are central to the operation of DPs.Freezable. The base class for objects that have a modifiable state and can be “frozen” into a read-only state for performance purposes.Visual. The base class for all objects that have their own visual representation. This class provides a tree of visual objects, each optionally containing drawing instructions and metadata about how to render those instructions, such as clipping, transformation, and so on. Visual is the entry point to the WPF composition system. It is also the point of connection between two subsystems, the managed API and the unmanaged milcore (the core of the WPF rendering system).UIElement. The base class for all visual objects, which provides support for layout, input, focus, and routed events (collectively referred to as LIFE).ContentElement. A base class that is similar to UIElement, but for content that does not have its own rendering behavior. In order to be rendered in the UI, ContentElement objects must be hosted in an object that derives from Visual.FrameworkElement. A base class that adds support for styles, data binding, resources, and a few common mechanisms for Windows-based controls such as tooltips and shortcut menus.Control. The base class that provides basic elements for GUI development, such as Button, ListBox, and so on. The controls separate the data model (properties), interaction model (commands and events), and display model (templates), which enables developers to completely replace their visual aspect.Shape. The base class for shape elements, such as Ellipse, Polygon, and Rectangle.Panel. base class for all Panel elements, which is used to position and arrange child objects in WPF applications. ContentControl. The base class for controls that can have only one child element. This child element can be anything from a string to a layout panel with a combination of other controls and shapes.ItemsControl. The base class for controls that can be used to present a collection of items, such as the ListBox and TreeView controls.Link:
  • XAML simplifies creating a UI for the .NET Framework programming model. You can create visible UI elements in the declarative XAML markup, and then separate the UI definition from the run-time logic by using code-behind files, joined to the markup through partial class definitions. The ability to mix code with markup in XAML is important because XML by itself is declarative, and does not really suggest a model for flow control. An XML based declarative language is very intuitive for creating interfaces ranging from prototype to production, especially for people with a background in web design and technologies. Unlike most other markup languages, XAML directly represents the instantiation of managed objects. This general design principle enables simplified code and debugging access for objects that are created in XAML.XAML files are XML files that generally have the .xaml extension.The following XAML example shows how little markup is necessary to create a button as part of a UI. The created button has default visual presentation through theme styles, and default behaviors through its class design.Link:
  • Transcript

    • 1.
      6ª Reunião Presencial – 23/01/2010
      Introdução ao Windows Presentation Foundation (WPF)Sara Silva
    • 2. Sara Silva
      3 anos de experiência profissional em TI
      Lic. Matemática: EspecializaçãoemComputação - DMUC
      MCPD: Windows Developer 3.5
      MCTS: WPF 3.5 e Windows Forms 3.5
    • 3. Agenda
      Introdução ao WPF
      Tipos de Aplicações
      Interface com o Utilizador
      - Layout e Controlos
      - WPFToolkit e WPF Ribbon
    • 4. Introdução ao WPF
    • 5. Introdução ao WPF
    • 6. Introdução ao WPF
      <Button Width="100"> OK
      Button b1 = new Button();
      b1.Content = "OK";
      b1.Background = new SolidColorBrush(Colors.LightBlue);
      b1.Width = 100;
      Dim b1 As New Button
      b1.Content = "OK"
      b1.Background = New _SolidColorBrush(Colors.LightBlue)
      b1.Width = 100
      XAML = Extensible Application Markup Language
    • 7. Tipos de Aplicações
    • 8. Dos tipos de aplicações no Visual Studio 2008
    • 9. Interface com o utilizador
    • 10. Do ControlLayout e dos controlos de WPF no Visual Studio 2008
    • 11. Interface com o utilizador
      DataGrid Calendar DatePicker
    • 12. Interface com o utilizador
      WPF Ribbon
      - RibbonWindow - RibbonControl
    • 13. Do WPFToolkit e WPF Ribbon numaaplicação
    • 14. Resources
      xmlns=" sentation" xmlns:x="" xmlns:system="clr-namespace:System;assembly=mscorlib"> <system:Stringx:Key="buttonText">
      Hello World!
    • 15. Resources
      <ResourceDictionarySource="MyResourceDictionary2.xaml"/> </ResourceDictionary.MergedDictionaries>
    • 16. Styles
      <SetterProperty="Control.Background" Value="BlueViolet" />
      <SetterProperty="Control.Foreground" Value="White" />
      <SetterProperty="Control.FontSize"Value="20" />
      <SetterProperty="Control.Width" Value="50" />
      <SetterProperty="Control.Height" Value="30" />
      <ButtonWidth="100" Style="{StaticResourceButtonStyle}">
    • 17. Dacriação de resources e styles
    • 18.
    • 19. Livros
    • 20. Dúvidas?
    • 21. Referências
      Introduction to Windows Presentation Foundation (MSDN)
      XAML Overview
      WPF - Codeplex
      WPF Tutorial
      Foundation Blend 2 : Building Applications in WPF and Silverlight
    • 22. 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
      Tipos de Animações
      Outras? ...
    • 23. Patrocinadores desta reunião
    • 24. Obrigado!
      Sara Silva