public AddEditINoteWindow(NotePageViewModel viewModel) { InitializeComponent(); ViewModel = viewModel; NoteFrame.Navigate(new NotePage(ViewModel as NotePageViewModel)); Messenger.Default.Register(this, new Action <string>(ProcessMessage)); }
public NotePage(ParticleDevice device) { ViewModel = new NotePageViewModel(device); BindingContext = ViewModel; var piano = new Piano(); piano.upOctive.Command = new Command(() => ViewModel.IncreaseOctive()); piano.downOctive.Command = new Command(() => ViewModel.DecreaseOctive()); piano.cKey.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => ViewModel.SendNote("C")) }); piano.bKey.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => ViewModel.SendNote("B")) }); piano.aKey.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => ViewModel.SendNote("A")) }); piano.gKey.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => ViewModel.SendNote("G")) }); piano.fKey.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => ViewModel.SendNote("F")) }); piano.eKey.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => ViewModel.SendNote("E")) }); piano.dKey.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => ViewModel.SendNote("D")) }); Content = piano; }
public NotePage(NotePageViewModel viewModel) { InitializeComponent(); ViewModel = viewModel; Messenger.Default.Register(this, new Action <string>(ProcessMessage)); this.ShowsNavigationUI = false; }
public NewNoteTests() { Services = new MockAppServiceProvider(); ViewModel = new NotePageViewModel(Services); SetupParams = NotePageSetupParameters.NewNote(Guid.NewGuid()); ViewModel.Setup(SetupParams); }
public CachedUneditedNewNoteTests() { Services = new MockAppServiceProvider(); Services.MockNoteDatabase.GetCachedNoteResult = new Note(); ViewModel = new NotePageViewModel(Services); SetupParams = NotePageSetupParameters.NewNote(Guid.NewGuid()); ViewModel.Setup(SetupParams); }
public CachedUneditedExistingNoteTests() { Services = new MockAppServiceProvider(); ViewModel = new NotePageViewModel(Services); var id = Guid.NewGuid(); Services.MockNoteDatabase.NoteTable[id] = new Note() { ID = id, FolderID = Guid.NewGuid(), Name = "name", Text = "text" }; SetupParams = NotePageSetupParameters.ExistingNote(id); ViewModel.Setup(SetupParams); }
public NotePage() { InitializeComponent(); BindingContext = new NotePageViewModel(AppServiceProvider.Instance); }