C# Class Geowigo.ViewModels.BaseViewModel

A base class for View models that deal with Wherigo objects.
Inheritance: System.Windows.DependencyObject
ファイルを表示 Open project: WFoundation/WF.Player.WinPhone Class Usage Examples

Public Properties

Property Type Description
ApplicationBarProperty System.Windows.DependencyProperty
CartridgeProperty System.Windows.DependencyProperty
IsProgressBarVisibleProperty System.Windows.DependencyProperty
ProgressBarStatusTextProperty System.Windows.DependencyProperty
WherigoObjectProperty System.Windows.DependencyProperty

Public Methods

Method Description
BaseViewModel ( ) : System
OnPageBackKeyPress ( CancelEventArgs e ) : void

Called by pages when the back key is pressed.

OnPageNavigatedTo ( System.Windows.Navigation.NavigationEventArgs e, NavigationContext navCtx ) : void

Called by pages when they are navigated to.

OnPageNavigatingFrom ( System.Windows.Navigation.NavigatingCancelEventArgs e, NavigationContext navctx ) : void

Called by the page when the navigation is leaving it.

Protected Methods

Method Description
InitFromNavigation ( NavigationInfo nav ) : void

Initializes the view model from the navigation context.

OnCoreGameStateChanged ( EngineGameState oldState, EngineGameState newState ) : void

Called when the state of the game engine has changed.

OnCorePropertyChanged ( string propName ) : void

Called when a property of the Wherigo Core has changed.

OnHasMessageBoxChanged ( bool hasMessageBox ) : void

Called when a non-native message box appears or disappears. This allows view models to adjust their layout, such as removing application bars.

The default implementation hides the application bar when a message box appears and shows it when a message box disappears.

OnModelChanged ( Models newModel ) : void

Called when the underlying model has changed.

OnModelChanging ( Models oldValue, Models newValue ) : void

Called when the underlying model is changing.

OnPageBackKeyPressOverride ( CancelEventArgs e ) : void

Called when an allowed back key pressed event has occured.

OnPageNavigatedBackToOverride ( ) : void

Called when the user navigated back to page.

OnWherigoObjectChanged ( WF.Player.Core.WherigoObject obj ) : void

Called when the associated Wherigo object has changed.

OnWherigoObjectPropertyChanged ( string propName ) : void

Called when a property of the associated Wherigo object has changed.

Private Methods

Method Description
Core_PropertyChanged ( object sender, PropertyChangedEventArgs e ) : void
InitFromNavigationInternal ( NavigationInfo nav ) : void
OnAppViewModelHasMessageBoxChanged ( object sender, EventArgs e ) : void
OnApplicationBarChanged ( IApplicationBar bar ) : void
OnApplicationBarPropertyChanged ( DependencyObject o, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnIsProgressBarVisibleChanged ( bool newValue ) : void
OnIsProgressBarVisiblePropertyChanged ( DependencyObject o, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnModelChangingInternal ( Models oldValue, Models newValue ) : void
OnWherigoObjectChangedInternal ( System.Windows.DependencyPropertyChangedEventArgs e ) : void
RefreshApplicationBarIsVisible ( bool hasMessageBox = null, bool isProgressBarVisible = null ) : void
WherigoObjectProperty_PropertyChanged ( DependencyObject o, System.Windows.DependencyPropertyChangedEventArgs e ) : void
WherigoObject_PropertyChanged ( object sender, System e ) : void

Method Details

BaseViewModel() public method

public BaseViewModel ( ) : System
return System

InitFromNavigation() protected method

Initializes the view model from the navigation context.
protected InitFromNavigation ( NavigationInfo nav ) : void
nav NavigationInfo
return void

OnCoreGameStateChanged() protected method

Called when the state of the game engine has changed.
protected OnCoreGameStateChanged ( EngineGameState oldState, EngineGameState newState ) : void
oldState EngineGameState State the engine had before the change occured.
newState EngineGameState State the engine has now.
return void

OnCorePropertyChanged() protected method

Called when a property of the Wherigo Core has changed.
protected OnCorePropertyChanged ( string propName ) : void
propName string Property that has changed.
return void

OnHasMessageBoxChanged() protected method

Called when a non-native message box appears or disappears. This allows view models to adjust their layout, such as removing application bars.
The default implementation hides the application bar when a message box appears and shows it when a message box disappears.
protected OnHasMessageBoxChanged ( bool hasMessageBox ) : void
hasMessageBox bool
return void

OnModelChanged() protected method

Called when the underlying model has changed.
protected OnModelChanged ( Models newModel ) : void
newModel Models
return void

OnModelChanging() protected method

Called when the underlying model is changing.
protected OnModelChanging ( Models oldValue, Models newValue ) : void
oldValue Models
newValue Models
return void

OnPageBackKeyPress() public method

Called by pages when the back key is pressed.
public OnPageBackKeyPress ( CancelEventArgs e ) : void
e CancelEventArgs
return void

OnPageBackKeyPressOverride() protected method

Called when an allowed back key pressed event has occured.
protected OnPageBackKeyPressOverride ( CancelEventArgs e ) : void
e CancelEventArgs
return void

OnPageNavigatedBackToOverride() protected method

Called when the user navigated back to page.
protected OnPageNavigatedBackToOverride ( ) : void
return void

OnPageNavigatedTo() public method

Called by pages when they are navigated to.
public OnPageNavigatedTo ( System.Windows.Navigation.NavigationEventArgs e, NavigationContext navCtx ) : void
e System.Windows.Navigation.NavigationEventArgs
navCtx NavigationContext
return void

OnPageNavigatingFrom() public method

Called by the page when the navigation is leaving it.
public OnPageNavigatingFrom ( System.Windows.Navigation.NavigatingCancelEventArgs e, NavigationContext navctx ) : void
e System.Windows.Navigation.NavigatingCancelEventArgs
navctx NavigationContext
return void

OnWherigoObjectChanged() protected method

Called when the associated Wherigo object has changed.
protected OnWherigoObjectChanged ( WF.Player.Core.WherigoObject obj ) : void
obj WF.Player.Core.WherigoObject
return void

OnWherigoObjectPropertyChanged() protected method

Called when a property of the associated Wherigo object has changed.
protected OnWherigoObjectPropertyChanged ( string propName ) : void
propName string
return void

Property Details

ApplicationBarProperty public_oe static_oe property

public static DependencyProperty,System.Windows ApplicationBarProperty
return System.Windows.DependencyProperty

CartridgeProperty public_oe static_oe property

public static DependencyProperty,System.Windows CartridgeProperty
return System.Windows.DependencyProperty

IsProgressBarVisibleProperty public_oe static_oe property

public static DependencyProperty,System.Windows IsProgressBarVisibleProperty
return System.Windows.DependencyProperty

ProgressBarStatusTextProperty public_oe static_oe property

public static DependencyProperty,System.Windows ProgressBarStatusTextProperty
return System.Windows.DependencyProperty

WherigoObjectProperty public_oe static_oe property

public static DependencyProperty,System.Windows WherigoObjectProperty
return System.Windows.DependencyProperty