WinFX – A Lap Around the Windows Presentation Establishment.


68 views
Uploaded on:
Category: Sales / Marketing
Description
WinFX – A Lap Around the Windows Presentation Establishment Bart J.F. De Smet MVP Visual C# info@bartdesmet.net http://blogs.bartdesmet.net/bart Motivation WPF – What's in a name? Presenting XAML Taming the instruments Beginning Controls Format Databinding Design Content and Records
Transcripts
Slide 1

WinFX – A Lap Around the Windows Presentation Foundation Bart J.F. De Smet MVP Visual C# info@bartdesmet.net http://blogs.bartdesmet.net/bart

Slide 2

Agenda WPF – What’s in a name? Presenting XAML Taming the devices Getting started Controls Layout Databinding Graphics Text and Documents Conclusion + Q&A

Slide 3

WPF – What’s in a name? Detours

Slide 4

WPF – What’s in a name? Innovation Islands

Slide 5

WPF – What’s in a name? No Design Protocol

Slide 6

WPF – What’s in a name? Your “Dear” Powerful GPU

Slide 7

Everyone has some piece of the photo, yet nobody has it together consistent send rich client experience route network & disconnected from the net WPF – What’s in a name? Genuine Smart Client Not Possible

Slide 8

WPF – What’s in a name? Windows Presentation Foundation Vision Unified way to deal with UI, Documents, and Media Integration as a major aspect of improvement and experience Integrated, vector-based piece motor Utilizing the force of the PC all through the representation stack Declarative programming Bringing creators specifically into application advancement Ease of organization Allowing executives to send and oversee applications safely

Slide 10

Agenda WPF – What’s in a name? Presenting XAML Taming the devices Getting started Controls Layout Databinding Graphics Text and Documents Conclusion

Slide 11

Introducing XAML The Art of Declarative Programming History goes on Visual Basic Forms Designer (recall .frm & .frx?) The “Windows Form Designer created code” Partial classes .NET revelatory programming model “eXtensible Application Markup Language” Namespace, Classes, Properties and Events mapping XAML is not WPF just WPF in XAML Integrated UI, Media, Documents in markup Enables engineer creator work process

Slide 12

form1.cs page1.html image1.svg window1.xaml open class Form1 : Form { open Form1() { Button b = new Button(); b.Text = "Hello World"; } <html> <button> Hello World </button> </html> <rect> <text>hello world</text> </rect> <Window xmlns= " http://schemas.microsoft.com/winfx/2006/xaml/presentation " xmlns:x= " http://schemas.microsoft.com/winfx/2006/xaml" x:Class="Window1" > <Button> <TextBlock> <Rectangle Width="50" Height="50" Fill="Red"/> Hello <Bold>World</Bold> </TextBlock> </Button> </Window> dialog1.rc BEGIN DIALOG BUTTON "HELLO WORLD" END DIALOG Introducing XAML What’s the major ordeal?

Slide 13

Agenda WPF – What’s in a name? Presenting XAML Taming the apparatuses Getting started Controls Layout Databinding Graphics Text and Documents Conclusion + Q&A

Slide 14

Taming the instruments Developer and Designer Productivity Notepad Once in a WPF developer’s lifetime xp  XamlPad The quickest WYSIWYG device for WPF Visual Studio 2005 “Cider” Your number one advancement device Expression Interactive Designer “Sparkle” Closing the hole with the graphical fashioner

Slide 15

XamlPad Visual Studio 2005

Slide 16

Agenda WPF – What’s in a name? Presenting XAML Taming the devices Getting started Controls Layout Databinding Graphics Text and Documents Conclusion + Q&A

Slide 17

Getting Started The photo that lets it know all Applications Controls Styling and Templates Layout Data Content Actions

Slide 18

Controls Talking about difficulties Controls are not adaptable Low adaptability to adjust controls to the developer’s and end-user’s visual needs. The “gray box” issue Your just customization focuses are the ones in the property program. No “pay for play” Advanced customization requires altogether more work (a.k.a. the “OwnerDraw” bad dream).

Slide 19

Controls WPF’s “realizing your potential” New controls fabricated for the stage, utilizing the stage Globalization, confinement, availability, eventing, and so on Controls that can contain anything .Content clarified Controls that have the look you need Layout, illustrations, visuals theming, and so forth

Slide 20

Controls .Content == new(.Text) Replacing .Text yet wealthier WPF C# Button.Content = “Hello World”; WPF XAML <Button>Hello World</Button> <Button><Image Source=“...”/></Button> An enhanced methodology for information myButton.Content = new Customer(...); You get back what you put in Developer manages information, originator manages the perception

Slide 21

Layout WPF’s Layout Toolbox Canvas The old (terrible) total situating StackPanel The most straightforward programmed design DockPanel Dock controls on top, left, right, base and fill Grid Partitions the UI in lines and sections TextFlow Present content in a (typographically) easy to use way

Slide 22

Controls Layout Styles

Slide 23

Databinding Binding in Markup <Image Source="truck.png" Canvas.Left= " {Binding Path=Value, ElementName=horzPos} "/> <Slider Orientation="Horizontal" Name="horzPos" Value="40"/> {Binding Path=Value, ElementName=horzPos}

Slide 24

Databinding Object Data Sources Connect UI to information objects E.g. business elements Add to asset word reference Named source objects <Window.Resources> component Use with asset tying Source “property” {StaticResource myData} <Window> <Window.Resources> <ObjectDataProvider x:Key="myData" TypeName="Foo"/> </Window.Resources> … </Window> <TextBlock TextContent=" "/> <TextBlock TextContent=" {Binding Path= , Source= } "/> <TextBlock TextContent=" {Binding Path= , Source= {StaticResource myData} } "/> <TextBlock TextContent=" {Binding Path=Bar, Source= {StaticResource myData} } "/>

Slide 25

cars.xml <Cars> <Car Make="Ford " Model="F-150"> <Image>truck.png</Image> </Car> … </Cars> Databinding Binding to XML is all over the place Built-in backing for XPath <Window> <Window.Resources> <XmlDataProvider x:Key="cars" XPath="/Cars/Car" Source="cars.xml"/> </Window.Resources> … </Window> <TextBlock TextContent=" {Binding XPath=@Make, Source= {StaticResource cars} } "/>

Slide 26

Binding controls Binding articles Binding XML

Slide 27

Databinding Controls Think Data ContentControl – solitary substance Button, CheckBox, Label, ListBoxItem, … ItemsControl – plural substance ListBox, ComboBox, Menu, TabControl, ToolBar, … Can utilize information objects as substance myButton.Content = new Car(…); myListBox.Items.Add(new Car(…)); Car c = (Car) myListBox.SelectedItem;

Slide 28

DataTemplate Databinding Defining Data Templates class Car { string Image {get;set;} string Model {get;set;} } <DataTemplate x:Key="carTemplate"> <Border BorderBrush="Blue" BorderThickness="2" Background="LightGray" Margin="10" Padding="15,15,15,5"> <StackPanel> <Image HorizontalAlignment="Center" Source=" {Binding Path=Image} "/> <Border HorizontalAlignment="Center" BorderBrush="Navy" Background="#DDF“ BorderThickness="1" Margin="10" Padding="3"> <TextBlock FontSize="18" TextContent=" {Binding Path=Model} "/> </Border> </StackPanel> </Border> </DataTemplate>

Slide 29

Databinding Using Data Templates Bind to a sort <Application … xmlns:src=“clr-namespace:MyNamespace”> <Application.Resources> <DataTemplate DataType=“{x:Type src:Car}” > … </DataTemplate> </Application.Resources> Bind unequivocally <Application.Resources> <DataTemplate x:Key=“cars” > … </DataTemplate> </Application.Resources> <ContentControl … ContentTemplate=“{StaticResource autos }”/>

Slide 30

Binding with layouts

Slide 31

Graphics A Macroscopic View WPF is a graphical establishment 2D and 3D design Multimedia bolster A group of shapes Transforms Gradients Brushes ... In view of vector representation Superb quality Superb execution

Slide 32

Transformations Playing with illustrations

Slide 33

Text and Documents Text Is Everywhere Natural Reading ClearType Sub-pixel situating Anti-associating Adobe Compact Font Format (CFF) bolster Controls SinglePageViewer FlowDocument Annotation bolster

Slide 34

Putting it together

Slide 35

Agenda WPF – What’s in

Recommended
View more...