Upgrade Metro App From Beta To RC

03/06/2012

In my previous post Convert VS 11 Beta Metro Projects To VS 2012 RC I talked about upgrading the Project file from Beta to RC, in this post I’ll try to talk about all changes made from Beta to RC.

I don’t know all the breaking changes in JavaScript and C# but I collect all the breaking changes from the application and games I develop and I’ll show them here.

JavaScript + HTML

Type Old Value New Value Comment
Event MSGestureTap onclick  
Event MSGestureHold oncontextmenu  
Method getPointerList Removed use getIntermediatePoints with the element you want to get the points from.
Event MSGestureDoubleTap double-click  
Method   WinJS.strictProcessing();

function Test()
{
   //ToDo
}
test.supportedForProcessing = true;

Now, any function resolved for data-win-control or as a right-hand-side in data-win-options, or used as a binding initializer in data-win-bind, will require a property on the function definition.

Event viewstatechanged resize function onResize()
myViewState = Windows.UI.ViewManagement.ApplicationView.value;

C# + XAML

My first suggestion is – Start a new Project, don’t try to fix all the errors because there are tons of changes, class such as “LayoutAwarePage.cshas completely changed so just create a new project and start copying files.

But after you copy your code you will still have changes to do, starting from simple class changes to Style changes.

Below you can find a list of things that changed, just perform Find and Replace, I think 90% of the styles has changed just with “Theme” word before Brush, but some styles names also changed.

Type Old Value New Value Comment
Class PointerEventArgs PointerRoutedEventArgs  
Style FocusVisualBlackStrokeBrush FocusVisualBlackStrokeThemeBrush  
Style FocusVisualWhiteStrokeBrush FocusVisualWhiteStrokeThemeBrush  
Style ApplicationHoverTextBrush ApplicationPointerOverForegroundThemeBrush  
Style ApplicationPressedTextBrush ApplicationPressedForegroundThemeBrush  
Style ControlDisabledTextBrush ButtonDisabledForegroundThemeBrush  
Style ApplicationSecondaryTextBrush ApplicationSecondaryForegroundThemeBrush  
Style AppBarItemForegroundBrush AppBarItemForegroundThemeBrush  
Style AppBarItemBackgroundBrush AppBarItemBackgroundThemeBrush  
Style AppBarItemHoverBackgroundBrush AppBarItemPointerOverBackgroundThemeBrush  
Style AppBarItemHoverForegroundBrush AppBarItemPointerOverForegroundThemeBrush  
Style AppBarItemForegroundBrush AppBarItemForegroundThemeBrush  
Style AppBarItemPressedForegroundBrush AppBarItemPressedForegroundThemeBrush  
Style AppBarItemDisabledForegroundBrush AppBarItemDisabledForegroundThemeBrush  
Style BackButtonBackgroundBrush BackButtonBackgroundThemeBrush  
Style BackButtonGlyphBrush BackButtonForegroundThemeBrush  
Style BackButtonPressedGlyphBrush BackButtonPressedForegroundThemeBrush  
Style BackButtonHoverBackgroundBrush BackButtonPointerOverBackgroundThemeBrush  
Style BackButtonHoverGlyphBrush BackButtonPointerOverForegroundThemeBrush  
Style BackButtonGlyphBrush BackButtonForegroundThemeBrush  
Style ListViewItemPlaceholderRectBrush ListViewItemPlaceholderBackgroundThemeBrush  
Style ListViewItemOverlayBackgroundBrush ListViewItemOverlayBackgroundThemeBrush  
Style ListViewItemOverlayTextBrush ListViewItemOverlayForegroundThemeBrush  
Style ListViewItemOverlaySecondaryTextBrush ListViewItemOverlaySecondaryForegroundThemeBrush  
Method this.Dispatcher.InvokeAsync( this.Dispatcher.RunAsync can use the returned IAsyncAction object to set a completion routine to get the completion status.
Event ApplicationView.GetForCurrentView().ViewStateChanged += ViewStateChanged Window.Current.SizeChanged += WindowSizeChanged;  
Add comment
facebook linkedin twitter email

Leave a Reply