This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code to execute when the application is launching (eg, from Start) | |
// This code will not execute when the application is reactivated | |
private void Application_Launching(object sender, LaunchingEventArgs e) | |
{ | |
loadPersistentState(); | |
} | |
// Code to execute when the application is activated (brought to foreground) | |
// This code will not execute when the application is first launched | |
private void Application_Activated(object sender, ActivatedEventArgs e) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IInitialize | |
{ | |
void Init(); | |
SynchronizationContext SynchContext | |
{ | |
get; | |
set; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ITransientStateManager | |
{ | |
object SaveState(); | |
void LoadState(object obj); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IActivated | |
{ | |
void Activate(); | |
} | |
public interface IDeactivated | |
{ | |
void Deactivate(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PropertyNotificationBase : INotifyPropertyChanged | |
{ | |
public event PropertyChangedEventHandler PropertyChanged = delegate{}; | |
public PropertyNotificationBase() | |
{ | |
SuppressPropertyChangedNotification = false; | |
} | |
public SynchronizationContext SynchContext |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public virtual string UserName | |
{ | |
get | |
{ | |
return m_userName; | |
} | |
set | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class ViewModelBase : PropertyNotificationBase, ITransientStateManager, IInitialize, IActivated, IDeactivated | |
{ | |
public ViewModelBase() | |
{ | |
} | |
static ViewModelBase() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ViewModelBase(string pageTitle) : this() | |
{ | |
PageTitle = pageTitle; | |
} | |
public string PageTitle | |
{ | |
get; | |
set; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool CanUseModel | |
{ | |
get | |
{ | |
return !IsInvalidModel && IsAllInitDataLoaded(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Init() | |
{ | |
try | |
{ | |
IsInvalidModel = true; | |
AppTitle = GlobalConstants.APP_MAIN_TITLE; | |
SuppressValidating = false; | |
IsInvalidModel = false; | |
DoInternalInit(); | |
ThreadPool.QueueUserWorkItem(_ => |