in

ExpressionBlog.com

Microsoft Expression Studio Community

This Blog

Syndication

Mirrored Blogs

Browse by Tags

All Tags » silverlight 2.0 (RSS)
  • Over The Top Twittering

    I see my job as, in part, community building, and as part of that, lots of experimentation. Today, I’m pleased to announce the launch of a new (experimental) HyperMicroBlog named SLGeek (join now) I will be blogging everything – all blogging all the time, at least while I’m working, often when I’m just thinking about work --- though topics may range beyond work, and you are fairly warned that you may learn ore about me than you care to know. (Intensive blogging begins later this morning and won’t stop for at least one week) The goal is that I’ll be recording not only what I’m working on but what I’m thinking about what I’m working on; as well as who I’m talking with, what we’re talking about (when it isn’t confidential), and anything else I can possibly tell you about what is going on.  Expect the blogging to come in bursts, but there will be lots of it. Sign Up Here To keep this from being entirely absurd, in this blizzard of words you should (if this goes as I hope) find tidbits about what I’m working on that won’t be posted for a while, what my team is thinking about that isn’t a big deal secret, what I find interesting that you might (or might not) and most important, have a chance to feed back to me and even more important discuss with others where I’m nuts, wrong or just off the rails.  To facilitate that, I’m setting up two places for community feedback: First, you can write to me directly, but I almost certainly won’t respond (except when I grab your email and plunk it into this blog) at slGeek@jliberty.com . Second you can post your thoughts, but I almost certainly won’t respond, and my not have time to even keep up to date)  on a public  discussion site I’ve created (you may have to join to post, but it is free). It is the forum that I hope will prove most interesting. Feel free to discuss anything there and if you need more folders, write to slGeek@jliberty.com and let me know.  NB: This is an experiment. We’ll see how it goes.
  • Want To Follow Silverlight MicroBlog?

    SilverlightShow is featuring a brilliant Twitter tool written by Emil Stoychev that you can download here – you can grab the HTML or you can download the source. If you just get the HTML and plop it into your blog you are free to tell it whom you want to follow (e.g., SLMicroblog. Here’s the HTML: <div style= "width: 250px; height: 310px;" > < object data= "data:application/x-silverlight," type= "application/x-silverlight-2-b2" width= "100%" height= "100%" > <param name= "source" value = "http://www.silverlightshow.net/twitter/ClientBin/Silvester.xap" /> <param name= "onerror" value = "onSilverlightError" /> <param name= "background" value = "white" /> <param name= "initParams" value = "twitterUser= SLMicroBlog " /> <a href= http://go.microsoft.com/fwlink/?LinkID=115261 style= "text-decoration: none;" > <img src= http://go.microsoft.com/fwlink/?LinkId=108181 alt= "Get Microsoft Silverlight" style= "border-style: none" /> </a> </ object > </div> Suddenly, all the SLMicroblog you can eat… No muss, no fuss. Works great.  Reposted due to technical problems with the server
  • One Man’s Guide To Silverlight Nirvana

    Every day (honest) I am asked for a path through the learning material, even though the Getting Started page offers an explicit path. And that is not surprising. We all have our own way of learning. Here is the path that I personally tend to suggest to most Silverlight neophytes. Path of quick learning: Go to Getting started and get all the links shown here Then watch the video on the same page on getting started. Once Set UP, Writing Programs Read this tutorial on interface controls. Watch [forthcoming] this video on why I made the switch to coding with Silverlight and Blend and how powerfully they work together, and then watch watch these “How Do I” videos on Blend for Programmers: Part 1 Part2 Part3 and/or read this tutorial Data Next, it’s time to focus on this video on data and then this tutorial on creating n-tier applications and data binding. Follow that with a great video on Cross Domain issues and then read up on user controls which you can supplement with this video on keyboard input followed by this video on user controls. Styles and Templates You may then want to read my tutorial and watch my videos on Styles and Templates (to be posted in the next week or two) or check out Karen Corby’s excellent 4 part series on the subject. Freestyle After all that you can pretty much move freely among the other tutorials and videos . Best of luck
  • Who Ate My Mouse Down Event??

    Before I leave, I want to squeeze in one quick note about a problem a lot of folks are running into as they upgrade from Beta 1 to Beta 2. I’ll come back to this in more detail when I get back, but here it is in a nutshell. A breaking change in the Beta 2 upgrade is that all the controls now handle MouseLeftButtonDown/Up/Move, while graphic objects do not. That means that no built in control will pass those events on (bubble them up) anymore. So, if you revisit my example for drag and drop what you’ll find is that if you create a button that has a graphic object inside it, and you drag on the button, it will not move, but if you drag on the graphic object it will! You can see this in (the newly updated) Tutorial #1 (where the image for Drag and Drop is misleading). Dragging on the Very Little Green Man works, dragging on the button he is in, does not. That is because the Very Little Green Man consists of nothing but Graphics (elipses and paths) but the button is a control and the control eats the event. This is why figure 1.9 in the tutorial has to be replaced; you can’t drag the button, you have to drag the green man, Broken image It’s subtle but important, where the mouse is shown, you could not be dragging . Yes, in Beta 1, no in Beta 2. Fixed image Here the mouse is dragging the little green man, and that will work just fine. The full reason for this is to come, but the short explanation is that this helps controls in Silverlight behave more like controls in WPF.
  • Boston .NET Users Group Meeting

    Last night I had the opportunity to talk to a packed room at the Boston .NET User’s Group; an incredibly welcoming and most friendly group of some 150,000 screaming fans of all things Microsoft. I promised at the time to provide a few links; including of course the single most important; the link to Silverligh.net , as well as a link to my blog , to  our Getting Started page , a link to the videos and a link to the tutorials . Other important resources mentioned were Scott Guthrie’s blog ,  Tim Heuer’s Blog and  Silverlight Cream . You can subscribe to the Silverlight Microblog here , though it will be fairly quiet for the next week or so. Thanks again for coming, for your questions, for the car and for your kind words.   -j
  • O’Hare is a Very Big Place

    I got to O’Hare at 1pm because the hotel I was staying at had the usual early check out time and it being Sunday there was no reasonable place to go.  When I got here I learned that my 6pm flight was delayed to 10pm. I won’t bore you with the details but after a few hours I decided some food was in order and so stopped at a grill and sat down next to a total stranger who turned out to have just moved here from a part of Brooklyn not far from where I grew up. Being relentlessly intrusive, I threw matches on the conversation until it flared, and soon we were talking about this year’s election and not long after that we were deep into racism (he is black, I am not). This can be a difficult conversation, as I’m sure you know but apparently we were  both into it, and we really got into the nitty-gritty.   Why am I telling you this? Because at the end we exchanged biz cards so that we could exchange celebratory emails on election night and it was then that I discovered that he is the creative director for web development for  a major network who happens to be very interested in learning more about Silverlight. Zow!  This was quite cool. So many laptops, so few outlets Also I wanted to ask why an airport as big as O’Hare has so few chairs near outlets, and why there was a stretch of hallway where I saw 7 people, apparently unrelated and not with each other, all working on Mac laptops, followed immediately by about 12 others working on PCs?  Is this some sort of sociology experiment? I finally popped for $50 to work in the “Admiral’s club” of one of the airlines where they offer two wonderful alternatives: tiny cubes with not enough light or outlets or nice big tables that are right next to the TV.  Otherwise, you may sit in comfortable chairs with your computer in your lap. Brilliant.  Oh, and they have very expensive, very bad food, none of which is vegetarian. Which is why I went out to eat in the first place. OK, back to work….
  • What is coming soon?

    You have noticed, I’m sure, that there has been a flurry of blogging, videos and more since the release of Beta 2. That is all goodness, though it can be hard to know where to start; and the road map will differ depending on where you are in your experience with Silverlight. This is a rapidly changing environment and I’m hesitant to make promises, because things can change, but after some thought I’ve decided that it would be helpful to give you an idea of what to expect with my tutorials, videos and webcasts.  So, here is my tentative schedule through the next couple months. WebCasts Styles and Templates   Wednesday June 18 9am UTC –8 (Pacific) Deep Zoom Wednesday, July 16, 2008 9:00 Tutorials All of the tutorials are updated to Beta 2 in their  pdf form and the HTML will be updated very soon. All of the source code is already updated.  The next couple tutorials will include Styles, Templates, the Visual State Manager Graphics, Transforms, and Animation Animation In Detail The DataGrid in Detail Book Tim and I are working hard to write and publish Programming Silverlight 2 .  Our hope is to be able to provide an early look very soon. Here is one paragraph from my non-introduction (unedited and unauthorized) We’ve set out to tell you the story of Silverlight and to teach you everything you need to know to program effectively with what we believe is an amazing new technology. We have not tried to replicate the documentation nor to provide a comprehensive definition of every property, event and method of the framework. But telling the story of Silverlight is more than just picking which parts are most important; it is threading our way through a very large and complex framework in a coherent and logical way, making sense of it, and providing a guided tour through the underbrush pointing out the dangerous spots, showing the shortcuts, and warning of the dead-ends . How Do I   Videos In addition to the many videos already posted it is my plan to create videos on the following topics in the coming weeks. Styles  Templates and Visual State Manager The Visual State Manager In Depth Basic Animation in Beta 2 (with Blend) Inter-state animation In-state Animation Graphics and transforms Animating objects Data and Animation DataGrid Advanced DataGrid Popup Control Calendar Control TextBox In Depth Scroll Bars If your favorite topic is missing, just drop me a note .  Please note that some of these topics are covered already, but...
  • Beta 2 Tutorials Available Now in PDF

    I’m pleased to announce that the following tutorials are now updated for Beta 2 and available for immediate download (but only the PDF versions and the code have been updated so far, the HTML versions are not yet updated) 1 Creating Applications With Controls and Events 2 Binding Data In Silverlight 3 Filling a DataGrid using Sql, Linq and WCF 4 Instant Code Reuse: User Controls in Silverlight 5 Introducing Expression Blend For Silverlight Developers To be perfectly clear: The downloadable code is updated for Beta 2 The PDF is updated for Beta 2 The HTML is not updated to Beta 2 We’ll have the HTML updated as soon as possible. There will be a lot of information coming very fast in the next few hours and days. I recommend beginning your explorations with ScottGu’s blog post and then working your way through our new videos, tutorials, and the many other blog posts that will be appearing in the next couple days. Exciting times.
  • Popup Control

    Beta 2 includes a wealth of new controls including the Popup (that is new, right? It’s not that I just didn’t notice it before?). I received an email today asking if I’d do a short How Do I video on creating a Popup and I certainly will, but here is a wicked fast tutorial for those of you who can’t wait…. There are three approaches. 1. Create the Popup as Xaml, most easily in Blend 2. Create the Popup dynamically, most easily in Visual Studio 3. Create the Popup as a User Control (the right answer, once you’re comfortable with how Popups are created Creating the Popup in Xaml Here is a picture of what we’re going to build. The basic Silverlight control will have a button and an image….. The button’s event handler makes the Popup visible. If you are old enough to get the reference, from having watched it when it was first on, remind me to buy you a glass of milk the next time we’re at a conference together There are two important things to notice: the Popup covers any elements that are at its location (when you create it you give it a vertical and horizontal offset from the upper left of the control) and the Popup is entirely within the Silverlight control. Method 1 - Xaml Create your basic project with the Click Me button and the Image in Blend. Set their properties as usual. Then select a Popup from the Asset Library and place that inside your Grid as well. Make the Popup the container by double clicking on it, and you are ready to add the border and StackPanel. Double click on the panel to make it the container and add the TextBlock and Button. Set all the properties. Once you have the controls set, it is time to save all the files and edit in Visual Studio. Your Xaml file will look more or less like this: <UserControl xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x= "http://schemas.microsoft.com/winfx/2006/xaml" x:Class= "PopUpControl.Page" xmlns:d= "http://schemas.microsoft.com/expression/blend/2008" xmlns:mc= "http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable= "d" Width= "640" Height= "480" > <Grid x:Name= "LayoutRoot" Background= "White" > <Grid.RowDefinitions> <RowDefinition Height= "0.15*" /> <RowDefinition Height= "0.85*" /> </Grid.RowDefinitions> <Button x:Name= "ShowPopupButton" Height= "40" HorizontalAlignment= "Left"...
  • Beta 2 Month

    Beta 2 has been announced, and as you know from Tim’s post and Karen Corby’s , one of the big and wonderful additions to Beta 2 is a new model for skinning Silverlight controls. This is so exciting, and so important, that my plan is to make it a central (but not quite exclusive) focus for the month of June. The timing is good, because I just finished updating all the tutorials for Beta 2 (watch for them to be posted shortly after Beta 2 is available) and the one I did not update is #3 Styles and Templates. I chose not to update that one because the new model is so much better there was no point in fixing up a tutorial on typewriters when computers are about to land on your desk. The Plan During this month I’ll be releasing A new tutorial that covers Styles, Templates and the VSM in great detail How Do I videos on Styles, Templates, Visual State Manager, and tying it all together Multiple “digging deeper” blog posts and… June 18 - Round Buttons with Visual State Manager The first in my new series of Web casts unlike any I’ve tried before: much higher value, much more information, much more use of the medium. This should just be a blast. So, sign up for the June 18 WebCast and don’t forget to join SLMicroBlog to be kept up to date.
  • Beta 2 Event Bubbling

    There are many great changes in Beta 2, and some are designed to make Silverlight more like WPF. One side effect of this is that event bubbling has changed just a bit and that bit breaks some of the examples I love to use. In Beta 1, the distinction was that all the controls handled their own click events but the more primitive events such as many of the mouse events were allowed to bubble. This allowed for interesting if not terribly useful demonstrations in which I placed a check box inside a button and was able to demonstrate that if I were to use the click event on the check box the button would never see the click, but if I used a MouseLeftButtonDown, hey! Presto! the button did see the event. This has now changed in Beta 2 to make Silverlight behave more like WPF. By and large (other than breaking my demo) this is a good thing.  The consistency now is that objects that directly derive from UI element do support event bubbling for the mouse events (that is,  Ellipse, Glyphs, Image, InkPresenter, Line, MediaElement, Path, Polygon, Polyline, Rectangle and TextBlock.)  In addition, the container classes do. Thus, if you set up the following bizarre application in which you have a grid, with a grid in it, that contains a stack panel that in turn contains a rectangle, a TextBlock, a check box, a button and a listbox (the last to show the results)… <UserControl x:Class= "EventBubbling.Page" xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x= "http://schemas.microsoft.com/winfx/2006/xaml" Width= "400" Height= "800" > <Grid x:Name= "LayoutRoot" Background= "White" > <Grid x:Name= "InterimGrid" > <StackPanel x:Name= "myStackPanel" Orientation= "Vertical" > <Rectangle x:Name= "myRect" Width= "30" Height= "30" Fill= "Blue" Stroke= "Red" StrokeThickness= "2" Margin= "0,10,0,10" /> <TextBlock x:Name= "myTextBlock" Text= "Hello" HorizontalAlignment= "Center" FontSize= "14" Margin= "0,10,0,10" /> <CheckBox x:Name= "myCheckBox" Content= "Check Me" Width= "80" Height= "40" Margin= "0,10,0,10" HorizontalAlignment= "Center" /> <Button x:Name= "myButton" Content= "TinyButton" Height= "30"...
  • Creating a Project from xaml and xaml.cs files

    I posted the code for the PageSwitcher app described in a previous blog post , but to save space and to make the download faster, I didn't include anything but the code (no solution or project files). A reader wrote asking how to create a project and it is a more than fair question as the answer is not obvious until you've done it a couple times, so let's walk through that example. When you download the code, you'll receive a zip file named  PageSwitcher .zip. Unzip that and you'll have a folder named PageSwitcher,   Open a new Visual Studio project and to make this example as clear as possible, let's name it something else (myPageSwitcher) and locate it in a different directory. Open Page.xaml in your new project and note the name of the project (MyPageSwitcher) <UserControl x:Class= "MyPageSwitcher.Page" Open Page.xaml.cs and note the namespace namespace MyPageSwitcher This is the information you need to hold on to for the rest of this exercise. Ready To Go There are many ways to do this, but the easiest is to delete Page.xaml, Page.xaml.cs and App.xaml and App.xaml.cs from your new project. (Don't panic!) Next, right-click on the project and choose Add->Existing items and navigate to the downloaded files and add them all. They are now in your new project. Click on all 4 xaml files and change the name of the project in the x:Class tag. Click on all 4 .cs files and change the name of the namespace (ignore the smart tag) If you want to get rid of the smart tag, use Build->Clean. Build->Rebuild Solution. You're all set Here is your new PageSwitcher.xaml <UserControl x:Class= "MyPageSwitcher.PageSwitcher" xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x= "http://schemas.microsoft.com/winfx/2006/xaml" Width= "400" Height= "300" > </UserControl>   And here is your new PageSwitcher.xaml.cs using System.Windows.Controls; namespace MyPageSwitcher { public partial class PageSwitcher : UserControl { public PageSwitcher() { InitializeComponent(); if ( this .Content == null ) { this .Content = new Page(); } } public void Navigate(UserControl nextPage) { this .Content = nextPage; } } }   Don't forget, once your code compiles, you can right click on the using statements and choose Organize Usings -> Remove Unused Using  which greatly cleans up your code.
  • Multi-Page Applications in Silverlight

    I wanted to build a multi-page (Search - Results) application when I realized that isn't really our model. Fortunately, I wrote to Ashish Shetty , who combines enormous knowledge with enormous kindness, and even though he is in the middle of blogging about this, he agreed that I could blog about it as well. Since I will be creating an HDI Video on this as one of my first Beta 2 videos (RSN) and since I think his solution is wicked cool, here is how you do it 1. Create a new Silverlight 2 project in Visual Studio , (I named mine, MultiPage). 2. You want to have at least three pages. Let's use the default Page.xaml as the first. Add any content you like but but include a button with a name and set the content to something like "Switch" 3. Right click on the project and click Add New Item, and add a second User Control. Name the new user control anything you want and give it any content you want. I'll call mine Page2.xaml and give it content to make it distinct: <UserControl x:Class= "MultiPage.Page2" xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x= "http://schemas.microsoft.com/winfx/2006/xaml" Width= "400" Height= "300" > <Grid x:Name= "LayoutRoot" Background= "Beige" > <StackPanel Orientation= "Horizontal" > <TextBlock Text= "This is Page2" FontFamily= "Comic Sans MS" FontSize= "48" VerticalAlignment= "Center" /> <Button x:Name= "SwitcherooButton" Content= "Switcheroo" Height= "40" Width= "80" Background= "Red" FontSize= "14" Margin= "20,0,0,0" /> </StackPanel> </Grid> </UserControl> Note that again I have a button for switching pages. Here is where the magic happens 4. Add a third page (I named mine PageSwitch.xaml.) Put nothing in the xaml file, because the content will be the page you want to display , but in the code-behind file add this method: public void Navigate(UserControl nextPage) { this .Content = nextPage; } 5. Wire up the buttons on all of your pages to invoke the Navigate method, passing in the page you want to navigate to. So, in Page.xaml.cs you'll add this code, public Page() { InitializeComponent(); SwitchButton.Click += new RoutedEventHandler(SwitchButton_Click); } void SwitchButton_Click( object sender, RoutedEventArgs e) { PageSwitcher ps = this .Parent...
  • Xaml vs XAML

    I received an email from Ian Griffiths who informed me that the "Xaml spec refers to Xaml as Xaml , and not XAML ." because Rob Relyea didn't like the "shouty caps" look of all upper case. After some back and forth, I contacted Rob, who wrote back that Ian is right (no surprise there) but that Rob is "...starting to use XAML" as that ship has sailed. I don't know, Rob is pretty amazing, (the image below is a link to his blog), and I'm inclined to agree with him that Xaml is a lot classier looking than XAML. I suggested that I would put the following note in Programming Silverlight A quick note on the capitalization of Xaml. Ian Griffiths (who truly knows everything) sent an email that Rob Relyea submitted the official specification with the capitalization as Xaml rather than XAML . While even Rob agrees that all upper case is the popular usage, his blog, Xamlified ( http://tinyurl.com/6h6rr5 ) is an oasis of camel case, and high quality information. This book will use both capitalizations for the sake of inconsistency. Maybe we can start a movement. I'm going to try. If nothing else, this discussion has led me to find YAAM (Yet Another Amazing Microsoftie) which makes it worthwhile. Keep an eye on his blog ; there are gems there. For those of you about to write that this is a trivial and meaningless distinction not worth the time to blog about... I pretty much agree.
  • What do you think of my Silverlight How Do I Videos?

    I'm always looking for ways to make this blog specifically and all my material on silverlight in general more interactive. Survey Monkey offers free surveys, so I thought I'd try it out by asking you to take a 1 page survey on what you think of my Silverlight 2 How Do I videos . If you have a moment you can take the survey here . Also, don't forget that at the bottom of each video there is room for comments; your feedback is always welcome. Thanks again.
More Posts Next page »