background preloader

Phone

Facebook Twitter

Implementing the Model-View-ViewModel pattern in a Windows Phone app. April 14, 2014 Applies to: Windows Phone 8 and Windows Phone Silverlight 8.1 | Windows Phone OS 7.1 In this walkthrough, you will build a simple app that implements the Model-View-ViewModel (MVVM) design pattern. MVVM is a way to separate your data from your user interface. MVVM allows developers to code data models, and designers to create user interfaces. The app that you create in this walkthrough is a “game tracker” in which the user can keep track of their accomplishments in a video game.

In this walkthrough, you will perform the following tasks: Create a Model, a ViewModel, and two Views.Use XAML binding to connect the Views to the data.Create a custom data converter.Maintain page state when navigating to and from your app.Save app data to isolated storage.Use an app bar to expose the save functionality. To complete this walkthrough, you must have Windows Phone SDK installed.

First, you create a new Windows Phone app project named MVVMTestApp. To create the app project. C# - How would MVVM be for games. 2D Graphics. DirectX on Windows Phone: 2D Game Example using DirectX Toolkit. Games for Windows Phone. Choosing the right project template for your game for Windows Phone 8. April 14, 2014 Applies to: Windows Phone 8 and Windows Phone Silverlight 8.1 only Windows Phone 8 applications belong to one of two categories.

Managed apps are based on managed code, but you can also invoke native code from this application type. The other application type is referred to as a “Direct3D app”. You cannot invoke managed code from within a Direct3D app. This topic contains the following sections. Windows Phone 8 provides several different project templates for managed apps all of which can be found in Visual Studio under Templates->Visual C#-> Windows Phone or Templates->Visual Basic-> Windows Phone in the New Project dialog. App Model – The app model for managed apps is almost identical to that of previous versions of Windows Phone. It is possible to create a game using XAML to provide the entire UI. The XAML with Direct3D project template The Direct3D with XAML project template Direct3D apps are written entirely in native code.

Direct3D with XAML apps for Windows Phone 8. This section walks you through the files included in the Direct3D with XAML app project template. If you’re going to create a Direct3D with XAML app, you should start with the Direct3D with XAML app project template that’s included with Windows Phone SDK 8.0. To create a new project, in Visual Studio, on the File menu, click New Project, and then, under Visual C++, click Windows Phone Direct3D with XAML App.

The Windows Phone Runtime component project includes some files that are similar to those in the pure native Direct3D app for Windows Phone, and similar to the Direct3D project template for Windows 8. These files handle obtaining the graphics device for you and have some example code that draws a cube to the screen. As mentioned earlier, the XAML app project that’s created as part of the Direct3D with XAML template is almost identical to a regular Windows Phone app that doesn’t use any Direct3D. MainPage.xaml MainPage.xaml.cs using PhoneDirect3DXamlAppComponent; Direct3DBase.cpp. How to handle manipulation events for Windows Phone. April 14, 2014 The following manipulation events are supported: The following gesture events are supported: The following items are not supported on the Windows Phone platform: The IsManipulationEnabled property is not supported.

Manipulation events are enabled by default on Windows Phone.Rotate transforms are not supported.Inertia events are not supported. To process touch input by handling manipulation events myPivot.ManipulationCompleted += (s, e) => { ... } this.myPivot.AddHandler(Pivot.ManipulationCompletedEvent, new EventHandler<ManipulationCompletedEventArgs> (MyPivot_ManipulationCompleted), true); C# - What are my options for 2D games on Windows Phone 8. Windows Phone 8 SDK on a Virtual Machine with Working Emulator. Windows Phone Dev Center. Windows Phone Using Sqlite with WP8 Beispiel in C#, C++, XAML für Visual Studio 2012.