21 July, 2011

WP7: My scrollviewer doesn’t work!

If you ever find yourself wondering why your ScrollViewer does not kick in (as I was wondering!); you have most likely forgotten what I did.

You need to set the height and width of the scrollviewer explicitly to make it work.

   </controls:PivotItem>

<
controls:PivotItem Header="legal">
<
ScrollViewer Width="460" Height="700">
<
StackPanel x:Name="stkPnl"/>
</
ScrollViewer>
</
controls:PivotItem>
</
controls:Pivot>

The size of this control (ScrollViewer) is simply a “window” to your data that allows you to scroll the content of this window. Due to this reason – you need to tell WP7 that it should only display a fixed window of data to the User.


StackOverflow Tags:

06 July, 2011

Get the versioninfo of a WP7 application

Quick cut/paste for the masses:

public static class Utilities
{
/// <summary>
///
Gets the version info of the executing assembly.
/// </summary>
/// <returns></returns>
public static string GetVersionInfo()
{
string asmName = Assembly.GetExecutingAssembly().FullName; //format = HelloWorld, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

string[] splits = asmName.Split(',');
return splits[1]; //Version 1.0.0.0
}
}

This will return to you this string: ‘Version 1.0.0.0


StackOverflow Tags:

iPhone/XCode - not all cases are equal!

This bit me! Having made some changes to an iPhone application (Obj-C); everything worked fine in the simulator. But, when deploying the s...