venerdì 3 febbraio 2012

lunedì 16 gennaio 2012

WP7 - Navigation with MVVM

There is a very interesting blog by my colleague Marco about navigation between pages in a Windows Phone 7, using MVVM pattern.

Here is the article (mostly in Italian)
http://silverlightedintorni.wordpress.com/2012/01/15/wp7-navigazione-mvvm/

giovedì 5 gennaio 2012

Whitespace is not allowed after end of Markup Extension

While working on a new Silverlight project I faced this error during compile: Whitespace is not allowed after end of Markup Extension.

The issue it's related to the Binding: be careful white spaces before and after parenthesis.
Here is a sample of code to explain better what I mean (check hi-lighted part):

<ComboBox Grid.Row="4" Grid.Column="4" DisplayMemberPath="Description"
          ItemsSource="{Binding DescriptionsList} "
          SelectedValue="{Binding SelectedDescription, Mode=TwoWay}"
          SelectedValuePath="DescriptionId" />


Have nice coding ;)

giovedì 1 dicembre 2011

Element is already the child of another element

I found this post  by HakOmaN very useful for understand my "Element is already the child of another element" problem in a Prism application:

http://blogs.msdn.com/b/hakoman/archive/2010/06/11/silverlight-navigation-framework-and-prism.aspx

Bye!

venerdì 25 novembre 2011

Silverlight 4: ChildWindow freezes the entire application

There is a known bug in Silverlight 4 ChildWindow control:
sometimes, without apparently reason, application freezes and you need to refresh the page.

A easy solution for this issue is this to use this instead of normal ChildWindow:
public class MyChildWindow : ChildWindow
{
      protected override void OnClosed(EventArgs e)
      {
           base.OnClosed(e);
           Application.Current.RootVisual.SetValue(IsEnabledProperty, true);
      }
}

venerdì 7 ottobre 2011

Visual Studio: 32bit to 64bit causes not valid win32 application resx

There is a (small???) bug in Visual Studio 2010 RESX generator:

when try compile a 32bit application on a 64bit system, if you have an ImageList control within your form, you may get a non-very-clear error in a form's resx file and project wont compile.

The problem is related to the base64 string generated by Visual Studio on 64bit systems.

If you double-click on error, it should go somewhere near the ImageList control string. To fix it just change manually


<data name="ImageList1.ImageStream" 
      mimetype="application/x-microsoft.net.object.binary.base64">
<value>
   AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w

to


<data name="ImageList1.ImageStream" 
      mimetype="application/x-microsoft.net.object.binary.base64">
<value>
   AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w



this should fix the error and let you compile the project!
Unluckily the problem will came again and again each time you will change something in the form.

Hope Microsoft's guys will provide a fix soon.

Here the discussion.

giovedì 6 ottobre 2011

WP 7.1 SDK on a computer with different language version of VS2010 and Blend4

When I read about release of Windows Phone 7.1 SDK I was so much excited that I wanted to try it immediately.
I could easily install SDK on my personal notebook, where I have both Italian version of Visual Studio 2010 and Expression Blend 4 installed, but I found more troubles on install it on my job computer, where I have English Visual Studio 2010 and Italian Expression Blend.

Using Web Installer I faced the problem of Language Incompatibility with an error message:

Incompatible language version of products
Setup has detected that the following incompatible language version of products or components are installed on youc computer. Please uninstall the following product of components in the specified order: 
*Microsoft Expression Blend 4 and all Expression Blend SDKs

This is not an easy problem, because as we know, Expression Blend licence cannot be deactivated!

I figured to avoid this error message downloading ISO version of WP7.1 SDK and installing each single package it own.

You can find links to ISO images in my previous post (here)


Be sure you already installed Visual Studio 2010 SP1 before continue!

1- Mount iso image on a virtual drive (or burn it!)
2- Go to the WCU folder and then to Windows Phone
3- Install each package you will find in this folder.
4- Reboot your PC manually


Now your Visual Studio 2010 is ready to compile WP7.1 binaries.
Do same for Expression Blend with right language version of ISO and everything will be