C# Class Geowigo.ViewModels.AppViewModel

The application view model, which is responsible for application-wide flow and control of the app and game UI.
Datei anzeigen Open project: WFoundation/WF.Player.WinPhone Class Usage Examples

Public Methods

Method Description
AppViewModel ( ) : System
ClearHistory ( ) : void

Removes all entries from the user history.

HandleAppActivated ( bool isRecoveringFromTombstone ) : void

Called when the app is being activated.

HandleAppContractActivated ( IActivatedEventArgs e ) : void

Called when the app is activated from a UX contract.

HandleAppDeactivated ( ) : void

Called when the app is being deactivated.

HandleGameCrash ( CrashMessageType crashMessageType, Exception exception, WF.Player.Core.Cartridge cartridge ) : void

Called when a game crashed. Displays a message and goes back home.

HandleGameStarted ( CartridgeTag tag, CartridgeSavegame savegame = null ) : void

Called when a game started.

HardResetCore ( ) : void

Kills the current Wherigo Core instance and replaces it with a new one.

PlayMediaSound ( WF.Player.Core.Media media ) : void

Plays a media sound.

SaveGame ( ) : void

Makes a custom savegame and prompts the user for a name.

SaveGameQuick ( ) : void

Makes a quick save of the current game.

ShowMessageBox ( WF mbox ) : void

Displays a message box. If a message box is currently on-screen, it will be cancelled.

StopAllSounds ( ) : void

Stops all currently played sounds.

Vibrate ( ) : void

Vibrates the device for a moment in order to alert the user.

Private Methods

Method Description
BeginRunOnIdle ( System.Action action ) : void

Runs an action as soon as the engine is not busy and no game message box is onscreen.

Core_AttributeChanged ( object sender, AttributeChangedEventArgs e ) : void
Core_CartridgeCompleted ( object sender, WherigoEventArgs e ) : void
Core_CartridgeCrashed ( object sender, CrashEventArgs e ) : void
Core_CompassCalibrationRequested ( object sender, EventArgs e ) : void
Core_InputRequested ( object sender, ObjectEventArgs e ) : void
Core_MessageBoxRequested ( object sender, MessageBoxEventArgs e ) : void
Core_PlayAlertRequested ( object sender, WherigoEventArgs e ) : void
Core_PlaySoundRequested ( object sender, ObjectEventArgs e ) : void
Core_PropertyChanged ( object sender, System e ) : void
Core_SaveRequested ( object sender, SavingEventArgs e ) : void
Core_ScreenRequested ( object sender, ScreenEventArgs e ) : void
Core_ShowStatusTextRequested ( object sender, StatusTextEventArgs e ) : void
Core_StopSoundsRequested ( object sender, WherigoEventArgs e ) : void
MessageBoxManager_HasMessageBoxChanged ( object sender, EventArgs e ) : void
OnCoreIsBusyChanged ( bool isBusy ) : void
RegisterModel ( WherigoModel model ) : void
UnregisterModel ( WherigoModel model ) : void

Method Details

AppViewModel() public method

public AppViewModel ( ) : System
return System

ClearHistory() public method

Removes all entries from the user history.
public ClearHistory ( ) : void
return void

HandleAppActivated() public method

Called when the app is being activated.
public HandleAppActivated ( bool isRecoveringFromTombstone ) : void
isRecoveringFromTombstone bool
return void

HandleAppContractActivated() public method

Called when the app is activated from a UX contract.
public HandleAppContractActivated ( IActivatedEventArgs e ) : void
e IActivatedEventArgs Activation event
return void

HandleAppDeactivated() public method

Called when the app is being deactivated.
public HandleAppDeactivated ( ) : void
return void

HandleGameCrash() public method

Called when a game crashed. Displays a message and goes back home.
public HandleGameCrash ( CrashMessageType crashMessageType, Exception exception, WF.Player.Core.Cartridge cartridge ) : void
crashMessageType CrashMessageType
exception System.Exception
cartridge WF.Player.Core.Cartridge
return void

HandleGameStarted() public method

Called when a game started.
public HandleGameStarted ( CartridgeTag tag, CartridgeSavegame savegame = null ) : void
tag Geowigo.Models.CartridgeTag Cartridge that started.
savegame Geowigo.Models.CartridgeSavegame Optional savegame restored when the game started.
return void

HardResetCore() public method

Kills the current Wherigo Core instance and replaces it with a new one.
public HardResetCore ( ) : void
return void

PlayMediaSound() public method

Plays a media sound.
public PlayMediaSound ( WF.Player.Core.Media media ) : void
media WF.Player.Core.Media The sound to play.
return void

SaveGame() public method

Makes a custom savegame and prompts the user for a name.
public SaveGame ( ) : void
return void

SaveGameQuick() public method

Makes a quick save of the current game.
public SaveGameQuick ( ) : void
return void

ShowMessageBox() public method

Displays a message box. If a message box is currently on-screen, it will be cancelled.
public ShowMessageBox ( WF mbox ) : void
mbox WF
return void

StopAllSounds() public method

Stops all currently played sounds.
public StopAllSounds ( ) : void
return void

Vibrate() public method

Vibrates the device for a moment in order to alert the user.
public Vibrate ( ) : void
return void