Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Introduction to XAML

Download

Right click “Save as…”

In this screencast, Tim Sneath shows with a quick examples how the XAML feature of Windows Presentation Foundation (formerly codenamed “Avalon”) allows you to build UI that integrates 2D, media and text using an XML declarative language.

Tag:

Follow the Discussion

  • Hi Manip, you should be able to click on the button in the bottom-right hand corner to open it in WMP. Once loaded, you can simply do File / Save As... to copy it onto your disk.
  • No download on a screencast?

    Very impressive stuff... VERY impressive.  Very good screencast. Would it be possible to get one showing us how, for example, you would set text using C#?

    Two other questions -- Why are strings inconsistent in XAML? Some strings are contained within " " - "text" and others between tags <A> Text </A>; why not pick one or the other?

    Just because I'm curious, could you have your typed text follow a curve around (see WordArt)?
  • I did some editing above.  I am aware that I can save it using WMP; however the reason why I like the downloads is that they are in higher quality... But the quality didn't hurt this particular video too much. Smiley
  • bonkbonk Ich bin der ​Wurstfachve​rkäuferin !
    I most other browsers but IE you can rightclick that button and do "save traget as". At least in opera and firefox.
  • In response to your WordArt question, you can do some insanely cool stuff with text. Whilst you can't exactly do what you're after directly, you can use the FormattedText.BuildGeometry() method to turn any formatted text into a vector geometry, and once you've done that, you can skew it, transform it, reshape it or anything else you want. We're all going to be able to create some awesome effects using this capability.

    As far as the differing styles of XAML are concerned, it is at least consistent - you have both choices. For example, you can write:
       <Button Content="OK" />
    or
       <Button>OK</Button>

    It's just that the default property for Button is Content, hence you can embed the text within the element. We could only support the former choice, but the latter allows for a more natural syntax, I think. Does that make sense?
  • HarlequinHarlequin http:/​/​twitter.​com/True​Harlequin
    I'll ask the question I've asked before since the evangelist is here Smiley

    Will Avalon be helpful to web developers? A'la a web-based plugin, etc etc. Or is it app only?
  • HarlequinHarlequin http:/​/​twitter.​com/True​Harlequin
    Found my own answer I guess with Avalon Express. Guessing it needs IE7/Vista?
  • I do not recall avalon Express applications needing IE 7 or Vista for that matter. If you had VS 2k5 and beta 1 you can make express applications as far as I know.
  • That's right - you get Avalon Express applications on any machine with IE 6 or above and the WinFX Runtime Components installed. You'll get the very best experience on IE 7, since we weren't able to touch the IE 6 bits to integrate better. On IE 7, for instance, the back / forward buttons in the browser can be used to control the navigation model within an Avalon app. Avalon Express applications can be hosted as the full contents of a browser window, or alternatively within an IFRAME if you want to use Avalon as if it were a plug-in.

    The way is also open for other browsers to host Avalon Express, incidentally - they just need to host our container.

    Expect to see a whitepaper on Avalon Express published on MSDN in the next week by Karen Corby, the Program Manager for this area.
  • Very informative. Thanks Tim.
  • HarlequinHarlequin http:/​/​twitter.​com/True​Harlequin
    Tim Sneath wrote:
    That's right - you get Avalon Express applications on any machine with IE 6 or above and the WinFX Runtime Components installed. You'll get the very best experience on IE 7, since we weren't able to touch the IE 6 bits to integrate better. On IE 7, for instance, the back / forward buttons in the browser can be used to control the navigation model within an Avalon app. Avalon Express applications can be hosted as the full contents of a browser window, or alternatively within an IFRAME if you want to use Avalon as if it were a plug-in.

    The way is also open for other browsers to host Avalon Express, incidentally - they just need to host our container.

    Expect to see a whitepaper on Avalon Express published on MSDN in the next week by Karen Corby, the Program Manager for this area.


    What about the version of DirectX, is 9.0 good enough? Or 9.0b or whatever the newest is. I just had the feeling that DX10 was needed. Smiley

    If it does XP/IE6, then that's pretty sweet. No need to wait to get clients going on things then.
  • mikxmikx mikx
    Just tried to recreate the stuff done in the clip and it works great for the button part, but i can't get the MediaElement to work.

    It simply tells me the specified string for the Source is not valid. I tried to compile a simple sample (http://www.xamlshare.com/default.aspx/Text.Video%20clipped%20with%20text) including a video in Studio 2005. Compiles but throws a "class not registered" error mesaage when trying to access the video at runtime.

    Any ideas an how to fix that? I am using a 64bit system - maybe that is the key? Other examples work ok (blackjack avalon express for example).
  • DirectX 9.0c or later is required - this version was I believe included in Windows XP Service Pack 2, so if you're up to date with patches you should be all set.
  • Mikx, I've seen a few problems with this in the past on Beta 1 - this is the first release that has video and some things are still a little flaky. A few things to try:

    • Make sure you have Windows Media Player 10 installed;
    • Change your source file to an .avi or .wmv;
    • Check the media plays in WMP standalone;
    • Have a go with a 32-bit machine.

    If you're still having challenges, please feel free to post a bug on MSDN Product Feedback and someone will take a look.

    Good luck!

    Tim

  • Hi,

    http://channel9.msdn.com/Screencasts/introductiontoxaml.wmv
    Cool
  • ChadkChadk excuse me - do you has a flavor?
    Very good video.
    Its just a shame that the quallity is poor. I hardly couldn't see that you created a button the first time. The video is delayed compared to the sounds! Very very annoying!

    But its defently a great idea, to make videos about it(Really helped me ALOT! Thanks dude) I can't wait to see the next episode
  • Nice screencast.  Thanks.

    Two words:

    Shape tables.

    No, seriously (for those who know what I am talking about).  Apple had them in the eighties.  Nobody used them (except me maybe and a few others) because they were incredibly slow.  But they were vector based (scaling, rotations, xdrawing allowed) graphics that you could easily access in a program.  There was a tiny 7K program called DRAW, and another 24K one called TABLES which let you draw them onscreen, and then you tied the tables into your program.  If you were diligent enough, you could call the shape table routines from assembly language.  Primitive, yes, but not new territory by any means.

    Regarding typefaces, I never believed that designers spent so much time on them until I actually took a typography/graphic design class (one of many as part of my major).  It's unbelievable the amount of effort that can go into something so apparently simple as the letters you use onscreen or on paper.

  • mikxmikx mikx
    Tim, got the demo finally working. The MediaElement seems to be picky when it comes to the graphic hardware - i tried a handfull graphics card and finally got it working on a Radeon 9800 pro.

    Interestingly the card is only working on real Intel 32bit hardware and in combination with WinXP SP2. Intel32+Vista, AMD64+Vista64, AMD64+Vista32, AMD64+WinXP are not working with the same card. Surprisingly a real old S3 SavageDDR chip was at least able to play audio files - but no video (damn, no testing on my notebook).

    Anyway, my ultimate goal was to get the stuff working in a Avalon Express Application. I can create, compile and run the Avalon Express C# template. Also adding a button to Pag1e.xaml works. But as soon as i add a MediaElement (even without source attribute) the PresentationHost crashes on startup.

    Any idea? Creating those stuff as an Express Application would be really cool to create a web based Avalon Test Server (people could modifiy XAML files and when they open the test url, the server compiles the project and delivers the exe inside the browser).

    Oh, and is there a way to interact with the presentation host via JScript? e.g. recieving events or user input from a "normal" html based website?
  • Excellent video Tim!!! It gave me a nice start to XAML.
    I'm looking forward to your next one.
    Cool

  • hhhmmm...hi,im new in xaml...

    i need some help in doing fade-in and fade-out on images...how would i do that? Big Smile
  • jsampsonPCjsampsonPC SampsonBlog.​com Sampson​Videos.com
    Yes Yes Yes! Oh Heck Yes! Wow, Yah! Oh Yes!

    I was looking for a good intro to XAML today, after watching the Sweet Vid on C9 demonstrating the 3d capabilities of XAML and WPF...wow, such perfect timing!

    Update:
    Okay, I just finished watching this video (and I'm downloading the second). I am so impressed with the XAML language so far that I cannot wait to start working on it with my own two hands.

    I was a little upset that there was no dynamics in the first video, but heck, looks like the second video is going to address making an RSS reader in like 14 lines of code? Smiley I can't wait!

    Jonathan
  • www.mrmubi.comMubshir Raza Ali www.mrmubi.​com
    Hi Tim, Nice work man!

    Waiting for your other channels...

Remove this comment

Remove this thread

close

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.