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

Binding [VisualStateManager] view state to a MVVM viewmodel?

Actually you can. The trick is to make an Attached property and add a property changed callback that actually calls GoToState: public class StateHelper { public static readonly DependencyProperty StateProperty = DependencyProperty.RegisterAttached( “State”, typeof( String ), typeof( StateHelper ), new UIPropertyMetadata( null, StateChanged ) ); internal static void StateChanged( DependencyObject target, DependencyPropertyChangedEventArgs args ) { … Read more

MVVM: Binding to Model while keeping Model in sync with a server version

In the past I ‘ve written an application that supports “live” editing of data objects from multiple locations: many instances of the app can edit the same object at the same time, and when someone pushes changes to the server everyone else gets notified and (in the simplest scenario) sees those changes immediately. Here’s a … Read more

“UpdateSourceTrigger=PropertyChanged” equivalent for a Windows Phone 7 TextBox

Silverlight for WP7 does not support the syntax you’ve listed. Do the following instead: <TextBox TextChanged=”OnTextBoxTextChanged” Text=”{Binding MyText, Mode=TwoWay, UpdateSourceTrigger=Explicit}” /> UpdateSourceTrigger = Explicit is a smart bonus here. What is it? Explicit: Updates the binding source only when you call the UpdateSource method. It saves you one extra binding set when the user leaves … Read more

HttpUtility.UrlEncode in Windows Phone 7?

Silverlight has the Uri.EscapeUriString and Uri.EscapeDataString which can be used to URL-encode portions of a URI such as query strings and path components and such. Even in the desktop framework, you should never take a dependency on System.Web.dll just for HttpUtility, although many developers still do it. This is bad for 3 reasons. The assembly … Read more

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