in

ExpressionBlog.com

Microsoft Expression Studio Community

This Blog

Syndication

Mirrored Blogs

Browse by Tags

All Tags » Silverlight.net (RSS)
  • 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.
  • 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.
  • Organizing Lots of Information

    A very smart and frequent participant here wrote in today and said (paraphrasing)   ...Why do you  organize the Learn section around type (video, quickstart, tutorial) instead of topic/task (data binding, layout, browser integration)? Today I had a Data Binding question...I remember seeing what I wanted on Silverlight.net but not where. I looked at quick starts, then videos and finally found it in tutorials. Doesn't it make sense to have everything about Data Binding together? Great question!  I have three parts to my answer at least: 1. We are going to be reorganizing this site in the coming months to make it more useful; that is certain. What I'm about to write, though, has nothing to do with that process. 2. What is useful for one person is not always useful for everyone else, and one reasonably difficult thing to agree on is categorization, though you wouldn't think so. A quick social psych experiment: next time you are a party, ask someone to empty their pockets and to separate the contents into six logical piles. Refuse to provide further guidance.  Once they are done, ask them to explain their piles.  You'll find over time that everyone can do it, that everyone can explain in some detail why these are the logical mutually exclusive piles, but that everyone's criteria are different. 3. I have not discussed what I'm about to say with anyone else, nor am I sure that this way of organizing our tutorials and videos would be useful to anyone but me, but I did enjoy losing an hour thinking about it. If I were using this site; I'd like total control of how I access the learning material. I'd want to be able to find the material by topic, by type or even by who created it. But I would want all these "boxes" to be transparent.   I want to know what is in them before I open them, to minimize hunting around, and I want to be sure that whichever path I take I can always change my mind.       In this truly geeked out approach, I'm asked to choose if I want to see the available information by Topic , by Medium or by Presenter , but I don't have to guess what is under each of these choices. Let's assume that I prefer the presentations by that incredibly talented chap Liberty, and so I click on his name. This opens up the sub-menu that displays the contributions he has made, but once again I can choose to see it organized by topic or by medium (of course, just the...
  • Silverlight Gems

    One of the reasons I took my job was the amazing people I met during my interview. It turns out, however, that the place is crawling with talent; it doesn't seem likely that an organization that large would not have regressed to the mean yet, but the dev-div continues to astound me. I'd like to start pointing out some of the people who, I speculate, will have a lot to offer the Silverlight Developer community. These will be random "sightings" as I go, of folks who are actively presenting information to the community but who you may not yet have run across,  but who you want to watch for.   Karen Corby came to the attention of a lot of folks with her brilliant presentation at Mix , It turns out she has a great blog where you will find some terrific information on a variety of topics ranging from the Silverlight HTTP Networking Stack to  her amazing photographs, to creating a FickrViewer app that nicely demonstrates the use of Styles, Templates, User Controls, Custom Controls and that also provides, ready for you to download, a Horizontal Wrap Panel, and Continuing Progress control and a Modal Dialog! I met Karen when I was out in Redmond; and everyone I know who has met her agrees: "Amazingly  high signal to noise ratio combined with extremely high bit rate."  Plus she is very kind to strangers; she made a lot of time for Tim and me, and was an enormous help in our understanding the evolving Control/Template model.
  • Two Part Video on Event Handling

    I'm pleased to announce a two part How Do I video set on Event Handling in Silverlight 2 Beta 1. These videos explore how to hook up events and point out that in Silverlight some events "bubble" and some do not. Here are the key points to walk away with You can set the event handler in XAML, but I don't, and I personally don't think it is a good practice, though that is not an official Microsoft position <Button  x:Name="Submit"  Click="Submit_Click" />   The alternative to setting the event handler in XAML is to set it in the Code Behind file (e.g., Page.XAML.cs)   In either case Intellisense will help with the creation of the event and will create the skeleton of the implementation Some events "bubble" up through the interface tree (and some do not) How Bubbling Works - The 60 Second Version Suppose I create a button with four check boxes in it, Note that the button is named SetFeatures , and within that Button is a stack panel containing 4 named CheckBoxes.  I do not need event handlers for the 4 check boxes; only the button, but if I want clicking on the check boxes also to be counted as a click on the button, the event I must wire up is OnMouseLeftButtonUp and not Button.Click! SetFeatures.MouseLeftButtonUp += new MouseButtonEventHandler(SetFeatures_MouseLeftButtonUp);   It turns out that many of the Mouse events do bubble but none of the control events (such as click)  bubble, at least in Beat 1. Because MouseLeftButtonUp does bubble, it is passed up to the Button after it is handled by the checkbox; but click would be handled by the check box and then eaten. This is shown in detail in the two videos.
  • Get Started Programming With Silverlight 2

    I was asked to post this one more time... Useful tips Memorize this URL : http://silverlight.net - from there you can always find everything you need, including all the tools, tutorials, quick starts, videos, discussions, forums, demo programs, and much more Ignore and do not use anything marked Silverlight 1.1 - there are only two versions you care about as of now: Silverlight 1.0 (our release version) and Silverlight 2.0 (currently in Beta). How to Get Started 1. Navigate to Silverlight.net (did you memorize that URL?) and click on Get Started on the standard menu, Follow that by clicking on View Other Versions , That will bring you to a link to the Silverlight 2 Beta 1 Runtimes. Click on that link. This will bring you to the installation files for Silverlight 2 Install the Silverlight runtime and when installed look in the upper right hand corner where you will want to click on Tools, That will bring you to a page full of tools. I've isolated the essential tools that you'll want to download or follow the links to in the next image, Note that this is not how the page appears; I've removed the inessential links and I'm showing only the ones you'll want to get started developing with Silverlight 2. Getting Started Learning To Code Silverlight Applications There is a lot of information available for learning to code in Silverlight. Of course, I'll start by recommending that you read through the available Silverlight 2 Tutorials (I'll be adding a new tutorial twice each month) and watching the Silverlight 2 videos and then finally, I'd return to the Learn page and work through any material related to Silverlight 2. Don't forget about our Forums which are a great place to ask (and answer!) questions from other Silverlight programmers and Microsoft developers. Be sure to check (or better, subscribe to!) the blogs (under Community) That will make for a good start, and remember that lots of folks are adding new material every day; I personally will be adding two tutorials, half a dozen videos, a web cast and a couple dozen blog entries every month. So you'll want to stop by pretty often to keep up to date.
  • Innovation, Renovation and Change

      So, after some minutes of trying this and that, it is time to take stock and see what's working and what isn't.  What's changing... Tip of the Day: RIP The Tip of the Day was a great idea, but I have yet to figure out what is the difference between a Tip of the Day and a blog entry, and I think it is causing more confusion than help, so I hereby kill it, put a stake through its heart, put a fork in it, bury it, liquidate it, drop a house on it. may it rest in peace. But only in name.   I still intend to post at least 5 days a week with substantive tips, follow ups, explorations of issues, and all the material I'd have put into a Tip of the Day; I'll just call them.... er... blog posts; like every body else.   The Micro Blog If I have your permission to stop experiments (like Tip of the Day) then I can experiment with truly wacky ideas. One, which was suggested to me in passing, I want to start right away: the Silverlight Microblog.  This is the idea of a blog that posts very frequently but only a line or two, and posts through Twitter . It is not a "here's what I'm doing" or even a "look here" reference to a bigger post somewhere else. Rather it is a complete blog entry in the 140 characters you are given.  This will take some practice. The Twitter account is SLMicroBlog and here's the first posting What needs clarification.... Tutorials: Not in Order The tutorials have been met with some enthusiasm, though it would be great to get more feedback and I invite you to send me email ( jliberty@microsoft.com ) or to post comments here. We're working on a way for you to post comments to the tutorials themselves. In any case, it is not my intention to write the tutorials in "order" -- I'm very aware that some folks would like to get to more advanced topics; though I do think it makes sense to go through most of the material at this level of depth before doing deep dives in the tutorials.  In addition, Scott Guthrie and I have agreed that the tutorials will be supplemented by the book I'm writing with Tim Heuer for O'Reilly (Programming Silverlight 2) which will provide more depth. Of course the book will be static, so after it publishes I'll continue to write tutorial pieces here as changes and new features emerge. Videos: Focus on:  Data and a mix of Intro and Advanced Topics Much like with the tutorials; it is my intention to move quickly back...
  • Tip of the Day: Getting Started With Silverlight 2

    A number of folks have asked me for a step by step set guide to getting started programming with Silverlight 2. Here it is. Useful tips Memorize this URL: http://silverlight.net - from there you can always find everything you need, including all the tools, tutorials, quick starts, videos, discussions, forums, demo programs, and much more Ignore and do not use anything marked Silverlight 1.1 - there are only two versions you care about as of now: Silverlight 1.0 (our release version) and Silverlight 2.0 (currently in Beta). How to Get Started 1. Navigate to Silverlight.net (did you memorize that URL?) and click on Silverlight 2 Beta 1 Now Available!   If that link has scrolled off the news you can start by clicking on Get Started on the standard menu,     If you click on Get Started follow that by clicking on View Other Versions , That will bring you to a link to the Silverlight 2 Beta 1 Runtimes. Click on that link.   These three steps from the standard menu will bring you to the same page as the one step from news,   Install the Silverlight runtime and when installed look in the upper right hand corner where you will want to click on Tools, That will bring you to a page full of tools. I've isolated the essential tools that you'll want to download or follow the links to in the next image, Note that this is not how the page appears; I've removed the inessential links and I'm showing only the ones you'll want to get started developing with Silverlight 2.   Getting Started Learning To Code Silverlight Applications There is a lot of information available for learning to code in Silverlight. Of course, I'll start by recommending that you read through the available Silverlight 2 Tutorials (I'll be adding a new tutorial twice each month) and watching the Silverlight 2 videos       and then finally, I'd return to the Learn page and work through any material related to Silverlight 2.   Don't forget about our Forums which are a great place to ask (and answer!) questions from other Silverlight programmers and Microsoft developers.       Be sure to check (or better, subscribe to!) the blogs (under Community)     That will make for a good start, and remember that lots of folks are adding new material every day; I personally will be adding two tutorials, half a dozen videos, a web cast and a couple dozen blog entries every month. So you'll want to stop by pretty...
  • Taking the market for granted - Not

    Sometimes when I'm writing a reply to a comment, I realize it deserves a new blog post. Here you go....   >>  I think that you're being optimistic in thinking that Silverlight is an automatic choice, even with SL 2.0. << Sorry, I was unclear. I meant it was an automatic choice for me . That is, for my values, for my work, with my history and needs, it is a no-brainer: and would be if I didn't work  for Microsoft. In fact, it was, before I worked for Microsoft. After I saw Silverlight at Mix 07, I went home and within a week registered Silverlight Consulting LLC.   That was my plan until I was offered the only better job in the world, the one I have now.   The point is that Silverlight fits in with my existing skills, builds on the technology I know, uses the tools I like, comes from a company I trust to get it right.  So for me it was a no-brainer. What I was trying to say is that I'm not good at (as you can see) selling it to anyone else. I see my job as coming mostly post-sales; helping those who want to learn or use Silverlight to get the most out of the experience, and helping to make sure that Silverlight.net is the place they turn to for whatever they need. I did not mean to suggest that the decision to use Silverlight is a given for everyone else. As always, there are some for whom it actually is a given,  and there are some for whom the rule may well be "anyone but Microsoft" -- for most an evaluation will be made based on their needs and the technology, though I reject the idea that lots of people come to a technology like this as babes in the woods, open to any technology solely based on its merits,  as if they have no previous investments in learning, acquired skills, legacy technology, etc. How big each group is, is outside my area of expertise. Put a gun to my head and make me guess? My gut says the world will look something like the following by end of 2009: Silverlight adopted with no alternative seriously considered: 20%. Not Silverlight, no matter what we do: 10% Explore Silverlight but decide on a competitor: 5% Explore Silverlight and its competition and choose Silverlight: 40% Decide to stay out of this space for now:  20%. Fell out of the statistical map, and never heard from again: 5% **** THIS IS NOT A MICROSOFT PREDICTION OPINION OR EVEN SPECULATION *** This is straight from my own 2 decades of being wrong every time I predict anything to you. And note...
  • My Commitment To Support Silverlight 2 Developers

    Silverlight 2 is big. Very big. It's great, but it is very big, with many cool features. So we're preparing. And all that preparation means that there will be a lot of information, and many paths through that information. My goal is to ensure that Silverlight.net always has more than enough information to be the one-stop home for the community of Silverlight developers. As a step in that direction, I'd like to tell you a little about my own plans for providing an integrated set of materials to make learning Silverlight 2 easier. The Plan My plan, subject to management intervention ("stop that and get back to sharpening pencils"), your feedback ("you call that a tutorial?"), or unexpected acts of the Gods ("oh look, locusts") is this: The day we release Silverlight 2, I will post a number of on-line tutorials here on Silverlight.net with links through my blog . These tutorials will be targeted at .NET developers, but I will not assume the reader has experience in Silverlight or WPF . Each tutorial will be filled with illustrations and working examples (that you can download separately), and each will run about 4,000 - 5,000 words (the equivalent of about 20 pages), or more as needed. The goal is for the Silverlight 2 tutorials to compliment rather than replace or repeat the Silverlight 2 documentation. The tutorials are targeted at working developers who prefer more explanation rather than less, but my assumption is a high level of professional expertise; these are not for hobbyists; and they are not fluff. Along with these tutorials I will also post the first of my new How Do I video series on programming Silverlight 2. This new series will be a compliment to the tutorials; not repeating the material; but demonstrating concepts through developing examples in screen-capture videos, and adding a new level of post-production enhancement to increase their value. After we release , I'll personally commit to at least the following every month... Two tutorials, each covering a Silverlight 2 topic in detail, starting with the most compelling topics 6 How Do I videos A Deep Dive Webcast 20 Tips of the Day Numerous blog entries on Silverlight 2 news, events, and more Also, Tim Heuer and I have committed to writing Programming Silverlight, to be published by O'Reilly Media this year. I certainly will not be the only person producing material on Silverlight 2 (far from it) but I hope to create a useful set of multi-media...
  • Tip of the Day - Suspends Until Mid March - Then Focus On Silverlight 2

    Rather than trying to provide a Tip of the Day as we head towards one of the larger and more important  shows of the year (you are going to Mix , right?) Therefore, I'm going to suspend the Tip of the Day from now until mid-March. After Mix, I'll be going on a family vacation we can't change (life is tough). But... ... As soon as I get back,  I'll be launching a set of coordinated  efforts , including a reliable Tip of the Day focused on Silverlight 2*. The new Tip of the Day will publish no later than  1pm Eastern, at least 5 days a week and will be part of a much larger effort that will include frequent Silverlight 2 blog posts , How Do I videos , monthly Webcasts and more .  Stay tuned; many details to come.       *Note: we've announced that we will be releasing Silverlight 2 during the first Quarter, which means by March 31. This note in no way implies any change to that plan.
  • Silverlight 1.0 for Total Novices

    I received two emails today asking that I repost my recommendations on how to get started with Silverlight 1.0. Here you go.... The best way to get started is to go to the Silverlight site and click on Get Starged From there you can click on Get Started to download the files you need. My advice would be to: Skip the Watch the Getting Started Video Download the Silverlight 1.0 runtime(s) Download the Developer tools VS 2008 Silverlight 1.1 Tools For VS 2008 (yes 1.1, even though you'll be building 1.0) ASP.NET Futures Download the designer tools Blend 2 Encoder Design (optional) Download the 1.0 SDK(s) For now, you really only need Silverlight 1.0 and can safely skip the 1.1 files, except that you will want Silverlight 1.1 Tools For VS 2008 because it includes what you need to write Silverlight 1.0 applications in Visual Studio 2008 as explained here . After downloading your files and installing them, return to Silverlight.net and click on Learn . (as shown in the image above). Then click on the 1.0 Videos. Start with the following videos: #1, #3, #57, #24, #49, #30, #34, #36 in that order . Then explore other videos, or click on QuickStarts for another perspective on getting going. Finally, as you explore further, and questions arise, please be sure to join our Forums where, to date, over 11,000 members have contributed to nearly 20,000 topics (don't panic, it is very well organized!) Best of luck, and please do let me know if I can be of further help, Jesse Liberty Silverlight Geek
  • One more gadget (the ego never quits)

    I woke up at 5 this morning, so I decided to take apart the Silverlight Tip of the Day gadget that Kelly White had so kindly created and, as an exercise in egomania, modify it to display all my blog entries, rather than just those that are tagged as Tip of the Day. It turned out to be an interesting adventure in playing with Sidebar gadgets, in the frustration of making sure you find all the references to all the images, and not much more than that (oh yes, it was a good time sink). In any case, here it is, if you want a copy: Silverlight Blog.gadget.zip . Just unzip it into the usual gadget folder and it will run side by side with the Tip of the Day gadget, or you can choose one or the other or neither. Now, to make this at all relevant, the next step is to put a Silverlight control together that does the same thing. That would be worth blogging about!