Windows Phone 7 (WP7) Change a button’s background color on click

What you need to do is create a button template that modifies the Pressed visual state. In blend, select your button, click the menu item “Object”->”Edit Template”->”Edit a Copy…” and a new template is created. In the States window, select the Pressed visual state in the CommonStates visual state group. Now select ButtonBackground in the … 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>

MVVM Passing EventArgs As Command Parameter

It’s not easily supported. Here’s an article with instructions on how to pass EventArgs as command parameters. You might want to look into using MVVMLight – it supports EventArgs in command directly; your situation would look something like this: <i:Interaction.Triggers> <i:EventTrigger EventName=”Navigated”> <cmd:EventToCommand Command=”{Binding NavigatedEvent}” PassEventArgsToCommand=”True” /> </i:EventTrigger> </i:Interaction.Triggers>

Is there a way to check if WPF is currently executing in design mode or not?

I believe you are looking for GetIsInDesignMode, which takes a DependencyObject. Ie. // ‘this’ is your UI element DesignerProperties.GetIsInDesignMode(this); Edit: When using Silverlight / WP7, you should use IsInDesignTool since GetIsInDesignMode can sometimes return false while in Visual Studio: DesignerProperties.IsInDesignTool Edit: And finally, in the interest of completeness, the equivalent in WinRT / Metro / … Read more

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