Satisfy Your Technical Curiosity WPF/E Jeff Prosise Cofounder, Wintellect www.wintellect.com.

Slides:



Advertisements
Similar presentations
Nhóm Sport: Nguyễn Công Cường (*) Trịnh Xuân Quảng Đinh Ngọc Duy Graphics and Animation in SilverLight.
Advertisements

2 D and 3 D Graphics and Animations Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
The Microsoft Technical Roadshow 2006 Windows Presentation Foundation (WPF) Marcus Perryman
CSS level 3. History of CSS CSS level 1 – original CSS CSS level 2 CSS level 2 Revision 1 (CSS2.1) – up to CSS2.1 monolithic structure CSS level 3 – specification.
Developing with Microsoft Silverlight Mark Johnston Developer & Platform Group Microsoft UK April 2007.
Module 10 WPF 2-D Graphics, Multimedia, and Printing.
HTML 5. What is HTML5? HTML5 will be the new standard for HTML, XHTML, and the HTML DOM. The previous version of HTML came in The web has changed.
Charles Petzold XAML. Agenda Layout and positioning Shapes, brushes, and brush resources Text, fonts, and font resources Images.
Developing Rich Web Applications with Silverlight Mike Ormond Developer & Platform Group Microsoft Ltd
HTML 5 Tutorial Chapter 1 Introduction. What is HTML5? HTML5 will be the new standard for HTML, XHTML, and the HTML DOM. The previous version of HTML.
Integrating Silverlight with ASP.NET AJAX and Web Services Dan Wahlin Interface Technical Training
Open Source Rich Internet Applications with Silverlight & Moonlight Joseph Hill Product Manager, Novell.
Silverlight for Developers making it pass the glitz.
Lecture 18. HTML5 and JavaScript Instructor: Jie Yang Department of Computer Science University of Massachusetts Lowell Exploring the Internet,
The Web: Developing compelling sites and applications 19 th September Mark Johnston.
Silverlight Development Win Phone 7 Mohammed M. Melhem Senior ICT Assistant: Application Silverlight and Win Phone.
Tutorial 7 Working with Multimedia. XP Objectives Explore various multimedia applications on the Web Learn about sound file formats and properties Embed.
Building Silverlight 2 Applications (Parts 1 and 2)
Chapter 11 Adding Media and Interactivity. Flash is a software program that allows you to create low-bandwidth, high-quality animations and interactive.
INTRODUCTION TO CLIENT-SIDE WEB PROGRAMMING ACM 511 ACM 262 Course Notes.
HTML5. What is HTML5? HTML5 will be the new standard for HTML. HTML5 is the next generation of HTML. HTML5 is still a work in progress. However, the major.
HTML 5 New Standardization of HTML. I NTRODUCTION HTML5 is The New HTML Standard, New Elements New Attributes Full CSS3 Support Video and Audio 2D/3D.
2 A First Look at Windows Presentation Foundation Everywhere ("WPF/E") Joe Stegman Lead Program Manager Microsoft Corporation.
Windows Presentation Foundation: The Next GDI? Shawn Wildermuth MVP, MCSD.NET, MCT, Author and Speaker Shawn Wildermuth MVP, MCSD.NET, MCT, Author and.
JQuery 10/21. Today jQuery Some cool tools around the web JavaScript Libraries Drawing libraries HTML Frameworks Conventions.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
Silverlight Hitesh Trivedi Computer Science B.Tech A-Sec J.I.E.T.
Tutorial 7 Working with Multimedia. XP Objectives Explore various multimedia applications on the Web Learn about sound file formats and properties Embed.
Sascha P. Corti Microsoft Switzerland
Tutorial 7 Working with Multimedia
Tutorial 7 Designing a Multimedia Web Site
Tutorial 1 Introducing Adobe Flash CS3 Professional
Tutorial 7 Working with Multimedia. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Explore various multimedia applications.
Tutorial 7 Working with Multimedia. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Explore various multimedia applications.
The Microsoft Technical Roadshow 2007 Rich Client Development in XAML Mark Johnston Developer & Platform Group Microsoft Ltd
1 Introduction to WPFUCN / 2012 Introduction to WPF Introduction to WPF Based on a Microsoft presentation.
New Features Overview. Agenda Silverlight - Intro Silverlight 3 New Features Overview with Demos, Demos and Demos… RIA Services Overview Demos, Demos,
Overview of Silverlight Mike Taulty Developer & Platform Group Microsoft Ltd
SVG for Designers Tom Hoferek. Objectives Introduce SVG Illustrate its capabilities Demonstrate SVG in action Speculate, discuss, answer questions.
Introducing Windows Presentation Foundation (Avalon) The Next GDI? Shawn Wildermuth Wildermuth Consulting Services, LLC
Developing ASP.NET AJAX Controls with Silverlight Barry Gervin Microsoft Regional Director John Bristowe Developer Advisor, Microsoft.
Satisfy Your Technical Curiosity Building Rich, Highly Interactive Web Apps with WPF/E Jeff Prosise Cofounder, Wintellect
 2008 Pearson Education, Inc. All rights reserved Microsoft ® Silverlight ™ and Rich Internet Applications.
Introducing Silverlight 2. Agenda Silverlight architecture XAML CoreCLR The Silverlight Base Class Library Silverlight security Your first Silverlight.
Silverlight 2 Andrew Pardoe Program Manager CLR Execution Engine
Review of the DOM Node properties and methods Some ways of accessing nodes Appending, copying and removing nodes Event handling – Inline – Scripting –
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Contents : What is Silverlight? Silverlight Overview Silverlight Toolkit Overview Timeline & Packaging Silverlight V1.0 & V1.1 Properties of V1.0 Properties.
.NET Framework Presentation. About Me Patrik Löwendahl –C# MVP –Certified Vista Touchdown Trainer Cornerstone
Eben de Wit Developer Advisor Microsoft
V 1.0 Programming III. Graphical possibilities Simple graphics (shapes)
Microsoft’s Rich Web Technology XAML,WPF and WPF/E July, 2006 John Allwright.
HTML 5 (Part 1) – Start from SCRATCH. HTML 5 – Start from SCRATCH.
Part of the Microsoft.NET Framework 3.0 Tomer Shamam.NET Technologies Expert Sela Group
Introduction to Silverlight Development Pavel Yosifovich CTO, Matrix Global; Senior Instructor, Hi-Tech College
The HTML5 logo was introduced by W3C in 2010
Introduction to Silverlight
Microsoft® Silverlight™ and Rich Internet Applications
HTML 5 Tutorial Chapter 1 Introduction.
Java FX.
Creating Visual Effects and Animation
Introduction to Silverlight
Building beautiful and interactive apps with HTML5 & CSS3
ISC440: Web Programming II Ch14: HTML5 Canvas
.NET and .NET Core 7. XAML Pan Wuming 2017.
In-Depth Look at Internet Explorer 9
Graphics And Animation
Overview of Silverlight 2
Working with Multimedia
Presentation transcript:

Satisfy Your Technical Curiosity WPF/E Jeff Prosise Cofounder, Wintellect

Satisfy Your Technical Curiosity WPF/E "WPF/Everywhere" Microsoft's upcoming platform for rich, highly interactive Web experiences Cross-platform (browsers and OSes) XAML-based (subset of WPF XAML) Targeted availability: Q Browser plug-in with JavaScript API us/asp.net/bb aspx

Satisfy Your Technical Curiosity Platforms (Feb CTP) Browsers Internet Explorer 6 and 7 (Windows) Firefox , 2.0+ (Windows and Mac) Safari (Mac) Operating systems Windows XP SP2, Vista Mac OS X ( ) Opera support coming soon (probably)

Satisfy Your Technical Curiosity WPF/E Architecture Browser Plug-In Presentation Runtime Presentation Core Media Support (Audio/Video) XAML Native DOM APIJavaScript DOM API Operating System (Windows, Mac) WPF/E

Satisfy Your Technical Curiosity Components of a WPF/E Page WPF/E Plug-in ActiveX control for Internet Explorer Traditional plug-in for other browsers agHost.js Host-independent wrapper for WPF/E plug-in HTML and JavaScript Import agHost.js and instantiate plug-in XAML

Satisfy Your Technical Curiosity Page Structure new agHost( "WpfeDiv", // DIV ID "wpfeControl", // Control ID "100%", // Width "100%", // Height "white", // Background color null, // XAML source element "Hello.xaml", // XAML file "false", // IsWindowless "30", // MaxFrameRate null // Error handler );

Satisfy Your Technical Curiosity Hello.xaml <Canvas Width="300" Height="300" xmlns=" xmlns:x=" Hello, WPF/E!

Satisfy Your Technical Curiosity Inline XAML new agHost( "WpfeDiv", // DIV ID "wpfeControl", // Control ID "100%", // Width "100%", // Height "white", // Background color "xamlstuff" // XAML source element ); <Canvas Width="300" Height="300" xmlns=" xmlns:x=" Hello, WPF/E!

Satisfy Your Technical Curiosity

Layout Layout is driven by Canvas objects Every page has a root Canvas object Page can contain additional Canvases Canvas is a container for other UI elements Object position is relative to Canvas position Object position in Canvas controlled by attached properties Canvas.Left and Canvas.Top All units measured in points

Satisfy Your Technical Curiosity Positioning <Canvas Width="300" Height="560" xmlns="... xmlns:x="..."> <Canvas Canvas.Left="40" Canvas.Top="40" Width="220" Height="220"> <Ellipse Canvas.Left="40" Canvas.Top="40" Height="140" Width="140" /> <Canvas Canvas.Left="40" Canvas.Top="300" Width="220" Height="220"> <Ellipse Canvas.Left="40" Canvas.Top="40" Height="140" Width="140" /> (40,40)(0,0)(40,300) (80,80) (80,340)

Satisfy Your Technical Curiosity Drawing Primitives Shapes Ellipse, Line, Rectangle, Path, Polygon, Polyline Brushes SolidColorBrush, LinearGradientBrush, RadialGradientBrush, ImageBrush Text TextBlock, TextElement, Run Images

Satisfy Your Technical Curiosity Rectangles <Rectangle Canvas.Left="50" Canvas.Top="50" Height="200" Width="300" StrokeThickness="10" Stroke="Black" Fill="Yellow" /> Stroke Fill

Satisfy Your Technical Curiosity Ellipses and Paths <Ellipse Canvas.Left="20" Canvas.Top="20" Height="200" Width="200" Stroke="Black" StrokeThickness="10" Fill="Yellow" /> <Ellipse Canvas.Left="80" Canvas.Top="80" Height="35" Width="25" Stroke="Black" Fill="Black" /> <Ellipse Canvas.Left="140" Canvas.Top="80" Height="35" Width="25" Stroke="Black" Fill="Black" /> <Path Data="M 70, 150 A 60, , 150" Stroke="Black" StrokeThickness="15" StrokeStartLineCap="Round" StrokeEndLineCap="Round" />

Satisfy Your Technical Curiosity Property Element Syntax <Rectangle Canvas.Left="50" Canvas.Top="50" Height="200" Width="300" StrokeThickness="10">

Satisfy Your Technical Curiosity LinearGradientBrush <Rectangle Canvas.Left="50" Canvas.Top="50" Stroke="Black" Height="200" Width="300" StrokeThickness="10">

Satisfy Your Technical Curiosity RadialGradientBrush <Rectangle Canvas.Left="50" Canvas.Top="50" Stroke="Black" Height="200" Width="300" StrokeThickness="10"> <RadialGradientBrush GradientOrigin="0.5,0.5" Center="0.5,0.5" RadiusX="0.5" RadiusY="0.5">

Satisfy Your Technical Curiosity Text <TextBlock Canvas.Top="20" Canvas.Left="20" FontSize="120pt" FontFamily="Georgia" FontStyle="Italic" FontWeight="Bold"> WPF/E

Satisfy Your Technical Curiosity

Images <Image Source="Corsair.jpg" Stretch="None|Fill|Uniform|UniformToFill" /> NoneFill UniformUniformToFill Aspect ratio preserved Aspect ratio not preserved

Satisfy Your Technical Curiosity Audio and Video MediaElement does audio/video playback Play, Pause, and Stop methods and Position property provide control over playback IsMuted, Volume, and Balance properties provide control over volume Source property identifies media (e.g., WMV); can be local file or URL

Satisfy Your Technical Curiosity

Transforms Operations that "transform" UI elements by: Translating Rotating Scaling Skewing Use RenderTransform property to apply Use TransformGroup to group transforms Use MatrixTransform for custom transforms

Satisfy Your Technical Curiosity Transform Types TranslateTransformRotateTransform SkewTransformScaleTransform

Satisfy Your Technical Curiosity Using Transforms...

Satisfy Your Technical Curiosity Clipping <Ellipse Canvas.Left="20" Canvas.Top="20" Fill="SlateBlue" Height="200" Width="200" Stroke="Black" StrokeThickness="10"> UIElement.Clip property controls clipping Geometry objects define clipping regions

Satisfy Your Technical Curiosity Opacity UIElement.Opacity property controls opacity WPF/E also supports ARGB color values <Ellipse Canvas.Left="50" Canvas.Top="50" Stroke="Black" Height="200" Width="300" StrokeThickness="10" Fill="Red" Opacity="0.5" /> <Ellipse Canvas.Left="200" Canvas.Top="50" Stroke="Black" Height="200" Width="300" StrokeThickness="10" Fill="#80FFFF00" />

Satisfy Your Technical Curiosity OpacityMask UIElement.OpacityMask masks opacity Use gradient brushes for gradient masks <Rectangle Canvas.Left="50" Canvas.Top="50" Stroke="Black" Height="50" Width="500" StrokeThickness="10" Fill="Yellow">

Satisfy Your Technical Curiosity

Animation Animations are created by varying properties of UI elements over time From/To animations vary properties linearly Key-frame animations use discrete steps Animation objects define animations DoubleAnimation[UsingKeyFrames] ColorAnimation[UsingKeyFrames] PointAnimation[UsingKeyFrames] StoryBoard objects hold animation objects

Satisfy Your Technical Curiosity Animating Motion <Rectangle x:Name="Rect" Width="200" Height="100" Fill="Red" Stroke="Blue" StrokeThickness="10"> <DoubleAnimation Storyboard.TargetName="Rect" Storyboard.TargetProperty="(Canvas.Left)" From="0" To="200" Duration="0:0:2" />

Satisfy Your Technical Curiosity Animation Properties StoryBoard and Animation properties control animation parameters PropertyDescription BeginTimeTime at which animation should begin (e.g, "0:0:10") DurationDuration of animation (e.g., "0:0:5") AutoReverseIf true, plays animation in reverse after completion FillBehavior"Stop"=Reset to begin state, "HoldEnd"=Retain end state RepeatBehaviorSpecifies how many times animation plays (e.g., "Forever")

Satisfy Your Technical Curiosity

Object Hierarchy Canvas TextBlock Other Objects Web page WPF/E plug-in WPF/E content

Satisfy Your Technical Curiosity Navigating the Hierarchy UIElement.children -> Child nodes Use children.getItem to retrieve specified node Use children.add to add nodes on the fly UIElement.getParent -> Parent node UIElement.getHost -> WPF/E control findName -> Any node in the hierarchy Call it on UI element or WPF/E control Searches entire object hierarchy Use x:Name attribute to name nodes

Satisfy Your Technical Curiosity createFromXaml createFromXaml method creates objects from XAML strings Create objects programmatically Add objects to tree with object.children.add Implemented by WPF/E control Use document.getElementById to acquire control reference at run-time Or, in an event handler, use sender.getHost to acquire control reference

Satisfy Your Technical Curiosity

Events WPF/E objects fire events Canvas and shape objects fire Loaded events and mouse events (e.g., MouseLeftButtonDown) StoryBoard objects fire Completed events Other objects fire other events Use EventName="javascript:MethodName" attributes in XAML to register event handlers Handlers receive sender and args parameters

Satisfy Your Technical Curiosity Handling Events <Rectangle Canvas.Left="50" Canvas.Top="50" Width="300" Height="200" Stroke="Black" StrokeThicknes="10" Fill="Yellow" MouseLeftButtonDown="javascript:onClick" /> function onClick(sender, args) { sender.Fill = "Red"; // Change fill color window.alert(args.X); // X coordinate relative to root canvas window.alert(args.Y); // Y coordinate relative to root canvas }

Satisfy Your Technical Curiosity

Microsoft Expression Studio Tools for building rich content Web: CSS, XHTML, ASP.NET Blend: Video, vector graphics, animation, etc. Design: Graphic design Media: Digital media

Satisfy Your Technical Curiosity