String.IsNullOrWhiteSpace
Previous version of C# contain method String.IsNullOrEmpty which checks whether string is empty or null. If String only contain white spaces (it's also a case of empty string) you will be required to add an additional trim() function to handle it. But if you will use trim() on an null string, it will throw exception so you will be required to write few lines of code for it. But new function in string class
The new String.IsNullOrWhiteSpace method indicates whether
a string is null, empty, or consists only of white-space characters.
In Silverlight, you will bind the controls such as List/Grid with Observable collection so that any change in the collection automatically reflected on the control.
Often you will be required to convert the List to an observable collection but there isn't exist any method which automatically do so in Silverlight. Moreover, WCF service can only return IEnumerable collection which you may want to convert to the ObservableCollection. So, here is generic way to convert any List to Observable collection;
| var observableCollection = new ObservableCollection<T>(); |
| foreach (var
item in enumerableList) |
| observableCollection.Add(item); |
| return observableCollection; |
I hope this will help you ... Cheers:)