in

ExpressionBlog.com

Microsoft Expression Studio Community

This Blog

Syndication

Mirrored Blogs

Browse by Tags

All Tags » Silverlight Features (RSS)
  • Canonical Q&A

    Every day I get about 10-30 questions that I answer with a stock response (sorry) that says something like Hello and thank you for writing. I would encourage you to post your question in the Silverlight Forums . Be sure to include: * which version of Silverlight you are running, * which version of Visual Studio and/or Blend you are using and * whatever else you can add to help reproduce the problem. Meanwhile I’ll try to look into this as well. Thank you, I hate this answer; but it is the right thing; I can’t possibly do my job and also dive deep into all the questions I get; the forum s really are the right place and 1,000 brains are better than one. Oh, and  I do follow and I do look into many (though not all) of them. That said, some questions come up a lot, and today I received a note with 4 that I must get at least five times a week, so here are my quick responses (I’ve paraphrased some of the questions) I'd like to make my website a bit more "rich" and a better UI experience for the users and I'm considering Silverlight. It currently uses….  What would be your advice? Since you are new to Silverlight you probably want to work your way through a suggested learning path and then ask a lot of questions in the forums. I wish I could spend a day (or a week) working on the design with you For this website, with respect to your multiple page example...Let's say I have 30 existing .aspx pages. Would I make page1.xaml, page2.xaml, page3.xaml, etc. that would correspond to each respective page that I currently have? Not necessarily (and I hope you’d use better names <grin>). In fact, there is no reason you wouldn’t have a mixed model, using ASP.NET where it is working for you and Silverlight for enhanced (richer, faster, etc.) experiences. Are there any resources that tell you how to convert a complex ASP.NET web site into a complex Silverlight site? Not that I know of, but more information is coming every day. Be sure to keep an eye on silverlight.net and subscribe to Silverlight Cream , and Silverlight News . 4. This may sound odd, but how do I know that wanting to do this in Silverlight is not completely strange when it works and looks satisfactory now? Still make the change and why I guess is what I'm asking here. If it is satisfactory now, go do something else <smile>. But maybe it isn’t completely satisfactory; maybe a faster richer experience, in at least some parts of the application would be valuable. Take...
  • BBC Silverlight Zoom and Wow

    Apparently Radio 1's Big Weekend is a big thing in England, and to launch the festivities they've made The Big Zoomy Photo Thing a central piece of the action (as you may guess, this is Silverlight/Zoom incognito). (picture cropped to save room)   The implementation is beautiful. Click, roll, zoom. To give you a quick sense of it, here are two images. The first is the starter, I then zoomed in on the control panel (pointed to by the red arrows I added.     The progressive rendering is just mind-blowing. Every time I see it. And it is a blast to see it in a live usage, even if they don't have any really interesting pictures up yet (they will soon). One of the folks who did a lot of the programming is a buddy (he refuses to be credited) and I will work on talking him into an interview about the programming experience. Stay tuned. I know that Tim Heuer is also taking a long look at Zoom so we'll have a good deal more on this very soon.
  • Will Silverlight Controls Become More WPF Like - A Personal Opinion

    I was told when I joined Microsoft that I no longer had personal opinions about matters having to do with Microsoft software, and certainly not about Silverlight. As a "Blue Badge" I'm just exposed to too much confidential information to be seen as offering informal speculation or personal opinions, or so they said. It might even be true; who can really keep straight what you hear in back channels and what you hear inside your head (you don't hear little voices in your head? How do you get any work done?). About a week ago a very smart fellow wrote to me asking for a list of the differences between Silverlight and WPF. I responded saying that I didn't think such a list existed and (I added) "the list is shrinking all the time." He immediately picked up on that and asked me if I was hinting that there is a plan to make Silverlight 2 considerably more like WPF. Answer: I don't know. And I wouldn't say (we really are careful about not announcing features until they're cooked). But let me step away from what I do know and put on my rational individual non-employee hat and observe (keeping in mind how often I've been wrong over the past 2 decades!).... Silverlight was originally named WPF/E. The Silverlight controls are clearly and markedly very similar to and almost a subset of the WPF controls and Silverlight itself is very similar to and almost a proper subset of WPF - so much so that you can take a Silverlight application and plop it into a WPF application and it works. So we can't be that far. It is just that some things don't work quite the way you expect. For example, I blogged earlier about the fact that click events don't bubble. I sorta' kinda' understand why not, but they don't in Silverlight and they do in WPF. Will that change? Will they, eventually bubble in Silverlight? I don't know . But again, let's think about the pressures on the programmers logically. Here are these guys who build the Silverlight controls (e.g., the button) who are incredibly and justifiably proud of what they've wrought. They use the controls themselves. They also read the email from customers and from WPF programmers and from others, many of whom are confused by (or outraged by, or annoyed by, or mildly bemused by) the differences between Silverlight and WPF behavior. I'm guessing they'd like the Silverlight click event to behave the same as the WPF click event. Either they think the...
  • More on Routing and Bubbling

    One of the readers of my earlier post on routing and bubbling was left confused about when events are bubbled and when they are not. The documentation is clearer about this in some places than in others. For example, the Mouse events documentation has this to say: There are two things to notice here. One is that this particular documentation does clearly distinguish those events that bubble from those that do not. The second is, unfortunately, that the first sentence unfortunately seems to equatebeing a routed event with bubbling. What I think it means to say is "are routed events that bubble"  The documentation shows that MouseEnter (which does not bubble) is an event of type MouseEventHandler and MouseEventHandler is a delegate for three non bubbling events: So.... we can safely conclude that All bubbling events are routed events but Not all routed events bubble ( All C# Programmers are human, but not all humans are C# Programmers * ) So which events Do and Do Not Bubble and Why? One rule seems to be that any event specific to a control does not bubble. That means that Button.Click and Slider.ValueChanged do not bubble. Wait a minute! What would it mean for Slider.ValueChanged to bubble? Where would it bubble to? What could contain a slider that could possibly do anything with the ValueChanged event?  Clearly that event needs to go to the Slider and nowhere else. Okay, what about a ListBox which has SelectionChanged. Where should that bubble to? We're beginning to see the pattern. Most of the time, it doesn't make sense for the events specific to a given control to bubble. (Clearly not all of the time - Click is a good example where you might want a control event to bubble,  but you can work around that as we did in the previous example with mouse up.) In WPF you can decide because there are three types of Routed Events (Bubbling, Direct and Tunneling). In Silverlight, for Beta 1 at least, what has been put in place is that control-specific events do not bubble and what does bubble is many (though not all) of the more fundamental events  such as MouseDown/Up/Move,  which lets you get what you want, though not always as elegantly. One of the other comments was that this "must be fixed."  I'll post my own speculations on that tomorrow, but whether or not this is changed, a few things are becoming clearer: It is possible to accomplish all the event handling you might want as implemented There certainly...
  • Tip of the Day - Binding to a Collection

    The Tip of the Day doesn't usually carry on a related series of postings, but data binding is so important that I'm making an exception this weekend. Yesterday we looked at laying out a form using a grid holding a DataGrid and a second grid to create a master detail relationship, with the end goal looking like this: To populate the DataGrid that we've placed in the left column of the outer grid, we'll need a collection of business objects. To keep this simple, I've returned to the idea of a book class, While it isn't strictly necessary for my Book class to implement INotifyPropertyChanged, it is convenient to have it do so, so that if the Book object is changed in the underlying data, the UI can be updated as well. Thus, each of the underlying private member fields  has a public property whose getter returns the private field and whose setter both sets the field and calls the Notify method to update the UI,   With the book class in place, it is easy to create a collection of Book objects based on the last few books I bought for my Kindle.  The steps are: Create a member variable to hold the collection Allocate memory for the collection Add objects to the collection Set the DataGrid to bind to properties of each individual object Set the collection as the ItemSource property of the DataGrid     Create a member variable to hold the collection Allocate memory for the collection Add objects to the collection You can imagine that we would normally be retrieving these objects from a database, web server, or other common data source. Here we are hand coding to keep life simple.       Set the DataGrid to bind to properties of each individual object   In this small snippet you can see that we've created an instance of the DataGrid, named it Books, placed it in the grid, and told it not to auto generate its columns (we only want two columns, not all of the properties of the Book!).  We then manually create two text box columns, one for the Title and one for the ISBN.   Set the collection as the ItemSource property of the DataGrid If you look closely at the line numbers you'll see that I cut out most of the "Add Book" calls to focus on the call to setting the ItemsSource on the DataGrid (look at line 23 in the previous image!).  By creating this binding, when the page loads the collection is bound to the data grid and the two properties from each book object are displayed...
  • Tip of the Day: How To Answer: Will This Work In Silverlight 2.0?

    I'm beginning to receive a lot of email about what is coming in Silverlight 2.0. Today's was pretty typical, so I thought I'd post the questions and answers (without revealing anything specific about this writer's application), as a guide to the kind of response you can expect. (Published early today to get an answer to this reader!) Please note, the best place for this kind of question is our Forum, where you'll get a far faster and more comprehensive answer; but I do understand why some folks write directly. Here is the (slightly edited) letter with my response I am the architect [responsible for redoing the UI of a large calculator/spreadsheet that is now in ASP.NET and that goes back to the server for all its calculations. I'd like to consider Silverlight rather than AJAX to move the calculations to the client, with the main benefit being managed code]... If we rebuild the application in Silverlight (assuming 2.0 with a 2009 go live) would we be able to use the existing c# libraries built out for validation and calculation without reworking them? ... plug-in and [access our rules on the client. This would eliminate a lot of round trips and network traffic.] I want to give you all the information I can, but for the moment I have to give you somewhat less information than will be available once we release Silverlight 2, which we will do very soon. The release date remains 1st Quarter of this year for Beta 1 (that is, no later than March 31). I'm willing to go out on a limb and say we're working hard to come in a bit early. So I'm going to ask that you re-send this question to me after we release, if that is okay. In the meantime, I’ll do some research to see if I’m at Liberty™ to say more. The specifics of what will be in Silverlight 2 has not been announced, though some general guidelines have been written about here . We have said, for example, that we’ll support C#, and that we’ll support a significant subset of the CLR. Let's assume we wanted to get something done ....today [using Silverlight 1.0 for now] Could I put a hidden Silverlight component on the page that encapsulates the c# libraries from the server? Then I could simply swap out the Ajax post-backs on each existing field for a js call to the Silverlight engine and update the fields accordingly. You could certainly create a hidden Silverlight 1.0 control on your page. It in turn, could certainly interact with a web service and/or do work on the client side...