Beispiel #1
0
 public AddEditINoteWindow(NotePageViewModel viewModel)
 {
     InitializeComponent();
     ViewModel = viewModel;
     NoteFrame.Navigate(new NotePage(ViewModel as NotePageViewModel));
     Messenger.Default.Register(this, new Action <string>(ProcessMessage));
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
 public NotePage(NotePageViewModel viewModel)
 {
     InitializeComponent();
     ViewModel = viewModel;
     Messenger.Default.Register(this, new Action <string>(ProcessMessage));
     this.ShowsNavigationUI = false;
 }
Beispiel #4
0
 public NewNoteTests()
 {
     Services    = new MockAppServiceProvider();
     ViewModel   = new NotePageViewModel(Services);
     SetupParams = NotePageSetupParameters.NewNote(Guid.NewGuid());
     ViewModel.Setup(SetupParams);
 }
Beispiel #5
0
 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);
        }
Beispiel #7
0
 public NotePage()
 {
     InitializeComponent();
     BindingContext = new NotePageViewModel(AppServiceProvider.Instance);
 }