Silverlight 2 Beta Issues
- posted in:
- Silverlight
After playing around with Silverlight 2 beta some more, I have run into a few issues. A quick note about this post, I have been a WPF developer for a couple of years now so my issues may not really be issues, but rather differences between Silverlight and WPF that I find to be bothersome. I'm sure Microsoft will be working to fix some of these issues as they are minor, but there is 1 major issue that has been talked about in further detail, Silverlight's control templating model. Dr. WPF and Robby both have very good points about the templating model, but I must say my thoughts and concerns are with Dr. WPF. Please give us triggers ... property, data, event ... just give us our triggers back! Some other minor issues that I have encountered are posted below, let me know if you agree / disagree with these:
- No x:Type allowed on dataTemplates which means no typed templates!
- The user must specify 'Mode=TwoWay' in certain bindings such as the slider's value property
- Setting the dataContext on a parent deos not allow its children to receive that dataContext
- The user must set the dataContext everytime a selection is changed on an itemsControl so the GUI will update that change properly
- XAML does not support certain bindings so I have to manually set those bindings up in code. Helpful hint on how to do this
- No label, combobox, progress bar ... yet
- No textbox.clear()
- No colorConverter class to create a new color in code from a hex value
- No DiscreteObjectKeyFrame animation so I cannot set Visibility of objects in XAML
- No x:'Type' support in XAML
- Buttons fill up their entire parent even if you specify VerticalAlignment and / or HorizontalAlignment
- In fullscreen mode, the user cannot use the keyboard to enter any text ... I understand this is a potential security issue, but could we somehow have a workaround at least?
Overall, Silverlight 2 beta is a huge step in the right direction. There are so many great things going for it, but Microsoft needs to fix some of the small things to make Silverlight that much better!
One quick note, an easy way to update your GUI from a background worker is to pass your dispatcher (in this case I passed in dispatcherUIThread from my main window to my data class in its constructor) to the needed class so you can do something like this:
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(String info)
{
if (PropertyChanged != null)
{
if (!this.dispatcherUIThread.CheckAccess())
{
this.dispatcherUIThread.BeginInvoke(new NotifyPropertyChangedCallback(NotifyPropertyChanged), info);
return;
}
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
}
If you rely on intellisense, and we all do, you will be sad that Dispatcher.CheckAccess() does not show up. This is also the case for WPF, but believe me that the code will compile and work. Maybe Microsoft should add intellisense support for it?
That's all I have for now. Currently I am working on a mini game that I almost have phase 1 complete. I will post more soon, but it's starting to get very nice outside and that means time for some fun in the sun!