예제 #1
0
 public SinglePlayerWindow()
 {
     InitializeComponent();
     this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
     vm               = SinglePlayerViewModel.Instance(SinglePlayerModel.Instance);
     vm.VM_MazeRows   = Properties.Settings.Default.MazeRows;
     vm.VM_MazeCols   = Properties.Settings.Default.MazeCols;
     this.DataContext = vm;
 }
예제 #2
0
 public static SinglePlayerViewModel Instance(SinglePlayerModel model)
 {
     instanceMutex.WaitOne();
     if (instance == null)
     {
         instance = new SinglePlayerViewModel(model);
     }
     instanceMutex.ReleaseMutex();
     return(instance);
 }
예제 #3
0
 public SinglePlayerMazeWindow()
 {
     try
     {
         InitializeComponent();
         this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
         this.vm          = SinglePlayerViewModel.Instance(SinglePlayerModel.Instance);
         this.DataContext = vm;
         this.KeyDown    += new KeyEventHandler(this.GridKeyDown);
     }
     catch (Exception)
     {
         Message.ShowOKMessage("we are sorry, there is a problem with the connection, please try again later..", "ERROE");
     }
 }