/// <summary> /// Initializes a new instance of the <see cref="SinglePlayer"/> class. /// </summary> public SinglePlayer() { this.model = new ApplicationSinglePlayerModel(); this.InitializeComponent(); this.vm = new SinglePlayerViewModel(this.model); this.DataContext = this.vm; }
/// <summary> /// Initializes a new instance of the <see cref="SinglePlayerWindow"/> class. /// </summary> /// <param name="model">The model.</param> public SinglePlayerWindow(ISinglePlayerModel model) { this.model = model; this.InitializeComponent(); this.vm = new SinglePlayerWindowViewModel(model); this.DataContext = this.vm; }
// private Maze mazeDraw; public SinglePlayerViewModel() { model = new ApplicationSinglePlayerModel(); model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged(e.PropertyName); }; }
/// <summary> /// Initializes a new instance of the <see cref="SinglePlayerWindowViewModel"/> class. /// </summary> /// <param name="model">The model.</param> public SinglePlayerWindowViewModel(ISinglePlayerModel model) { this.model = model; model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { this.NotifyPropertyChanged("Vm" + e.PropertyName); }; }
/// <summary> /// Initializes a new instance of the <see cref="SinglePlayer"/> class. /// </summary> /// <param name="model">The model.</param> /// <param name="main">The main.</param> public SinglePlayer(ISinglePlayerModel model, Window main) { InitializeComponent(); // play the single player music this.player = new MusicPlayer("singleplayer.mp3"); this.player.Play(); this.mainWindow = main; // create a ViewModel for the singleplayer with the given model this.vm = new SinglePlayerViewModel(model); this.DataContext = this.vm; this.mazeCtrl.DataContext = this.vm; }
/// <summary> /// Initializes a new instance of the <see cref="SinglePlayerViewModel"/> class. /// </summary> /// <param name="model">The model.</param> public SinglePlayerViewModel(ISinglePlayerModel model) { this.model = model; model.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "PlayerPos") { PlayerPos = model.PlayerPos; } else if (e.PropertyName == "YouWon") { YouWon = model.YouWon; } }; }
/// <summary> /// Initializes a new instance of the <see cref="SinglePlayerViewModel"/> class. /// </summary> /// <param name="model">The model.</param> public SinglePlayerViewModel(ISinglePlayerModel model) { this.model = model; }
/// <summary> /// Initializes a new instance of the <see cref="SinglePlayerViewModel"/> class. /// </summary> /// <param name="model">The model.</param> public SinglePlayerViewModel(ISinglePlayerModel model) { this.model = model; this.model.PropertyChanged += Model_PropertyChanged; }
/// <summary> /// The constructor sets to model and connects via events /// </summary> /// <param name="model"></param> public SinglePlayerViewModel(ISinglePlayerModel model) { ended = false; this.Model = model; model.PropertyChanged += ModelUpdate; }