Iterating through an enumeration in Silverlight?

Or maybe strongly typed using linq, like this: public static T[] GetEnumValues<T>() { var type = typeof(T); if (!type.IsEnum) throw new ArgumentException(“Type ‘” + type.Name + “‘ is not an enum”); return ( from field in type.GetFields(BindingFlags.Public | BindingFlags.Static) where field.IsLiteral select (T)field.GetValue(null) ).ToArray(); } public static string[] GetEnumStrings<T>() { var type = typeof(T); if … Read more

Custom WP7 Silverlight control with dynamic 3D content

I couldn’t find any way of detecting that a Silverlight control needs to change its presentation, be it due to user interaction or animation. Controls are rendered only when the 3D scene changes because of this, and so they lack the slick look and feel of the native WP7 applications. Make something that always changes … Read more

Is there a reference of default keyboard behaviours for Silverlight 4 controls? [closed]

Look in source code \ Reflector. There are lots of quirks in controls text processing, I doubt that any one will care to document this. For instance KeyDown event of TextBox is not fired when user presses BackSpace when there is text inside control, but fires when the is no text, etc. The quickest way … Read more

TextBlock with multiple spacing

if you write all your Runs in the same line, the empty space will go away. Basically a new line here is one empty space on the UI. <TextBlock Foreground=”DarkGray” VerticalAlignment=”Bottom” Margin=”0,0,0,8″><Run Text=”total length “/><Run Text=”{Binding TotalHours}” FontSize=”48″/><Run Text=”h “/><Run Text=”:” FontSize=”48″/><Run Text=”{Binding TotalMinutes}” FontSize=”48″/><Run Text=”m “/></TextBlock>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)