Exemplo n.º 1
0
        public async void EditTheCommand(UserCortanaCommand command)
        {
            SharedModel model = (Application.Current as App).Model;

            model.selected = command;
            GotoMainPage();
        }
Exemplo n.º 2
0
        private async void AddTheCommand()
        {
            UserCortanaCommand userCortanaCommand = new UserCortanaCommand("placeholder");
            SharedModel        model = (Application.Current as App).Model;

            model.selected = userCortanaCommand;
            GotoMainPage();
        }
Exemplo n.º 3
0
        public MainPage()
        {
            this.InitializeComponent();
            InitAvailableTasks();
            SharedModel model = (Application.Current as App).Model;

            UCC              = model.selected;
            ViewModel        = new MainViewModel(this, UCC, AvailableTasks);
            this.DataContext = ViewModel;
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 6
0
 public MainViewModel(MainPage page, UserCortanaCommand ucc, ObservableCollection <CortanaCommand> availableTasks)
 {
     ViewPage       = page;
     UserCommand    = ucc;
     AvailableTasks = availableTasks;
 }