public async void EditTheCommand(UserCortanaCommand command) { SharedModel model = (Application.Current as App).Model; model.selected = command; GotoMainPage(); }
private async void AddTheCommand() { UserCortanaCommand userCortanaCommand = new UserCortanaCommand("placeholder"); SharedModel model = (Application.Current as App).Model; model.selected = userCortanaCommand; GotoMainPage(); }
public MainPage() { this.InitializeComponent(); InitAvailableTasks(); SharedModel model = (Application.Current as App).Model; UCC = model.selected; ViewModel = new MainViewModel(this, UCC, AvailableTasks); this.DataContext = ViewModel; }
public static UserCortanaCommand ProcessUserCommand(string voiceCommandName, SpeechRecognitionResult speechRecognitionResult, CommandDiagnostics commandArgs) { SharedModel model = ModelHolder.Model; UserCortanaCommand command = null; if (model != null) { IList <UserCortanaCommand> commands = model.UserCortanaCommands; command = commands.Where(c => c.Name.Equals(voiceCommandName)).First(); if (command != null) { command = command.Spawn(speechRecognitionResult); } } return(command); }
private void CommandPicker_SelectionChanged(object sender, SelectionChangedEventArgs e) { UserCortanaCommand command = (UserCortanaCommand)CommandPicker.SelectedItem; ViewModel.EditTheCommand(command); }
public MainViewModel(MainPage page, UserCortanaCommand ucc, ObservableCollection <CortanaCommand> availableTasks) { ViewPage = page; UserCommand = ucc; AvailableTasks = availableTasks; }