Esempio n. 1
0
        public TravelBotViewModel()
        {
            this.IsBusy         = true;
            this.BotAuthor      = new Author();
            this.BotAuthor.Name = "Botyo-BotTesting";

            string botAvatar = "VacationBot.png";
            string suffix    = Device.RuntimePlatform == Device.UWP ? "Assets/" : null;

            this.BotAuthor.Avatar = suffix + botAvatar;

            this.Me      = new Author();
            this.Me.Name = "human";

            this.chatService = new AzureChatBotService("Y_ly-If6haE.cwA.PQE.ZwOOsq4MlHcD3_YLFI-t9oW6L6DXMMBoi67LBz9WaWA", this.BotAuthor.Name, this.OnMessageReceived);

            this.OkPickerCommand = new Command(this.OnOkPickerCommandExecuted, this.OnOkPickerCommandCanExecute);

            this.Items = new ObservableCollection <ChatItem>();
            this.Items.CollectionChanged += this.OnItemsCollectionChanged;

            this.waitingForBotMessage = new ChatMessage {
                Author = this.BotAuthor, Data = WaitingForBot,
            };
        }
Esempio n. 2
0
        public HealthCareAssistanceView()
        {
            InitializeComponent();

            this.busyIndicator.IsBusy = true;
            this.botAuthor            = new Author();
            this.botAuthor.Name       = "HealthCareBotService";
            string botAvatar = "HealthCareBot.png";
            string suffix    = Device.RuntimePlatform == Device.UWP ? "Assets/" : null;

            this.botAuthor.Avatar = suffix + botAvatar;

            this.botService = new AzureChatBotService("yFLWlpeK3CI.cwA.YsY.zgUzyQ1lj2ELKwj7h2pdBqPyVQsf2zrY1DPJfWbWA3I", this.botAuthor.Name, this.OnMessageReceived);

            ((INotifyCollectionChanged)this.chat.Items).CollectionChanged += this.OnChatItemsCollectionChanged;

            this.waitingForBotMessage = new ChatMessage {
                Author = this.botAuthor, Data = WaitingForBot
            };
        }