How to reduce hard coding of dialog flow in MSBot? - c#

I am creating a dialog flow in MSBot and I am hard-coding the content which will be displayed in Bot Emulator.
For example I want to make the dialog flow for creating the steps, and in rich cards there will be a button for the next step. Now the content I will be creating for the rich card, I have to hard-code in C# if I have a single dialog flow.
But if I have to create the dialog flow for other possible use cases, then I have to hard-code it for everyone.
So is there a way to reduce my effort for hard-coding each of the dialogs? Because if I have to change the steps then I have to manually go to that file and change the whole logic.

It is possible to do this in a generic fashion, where the source for the dialog flow steps are retrieved from a database or some other store. Please see this simple example: https://github.com/EricDahlvang/MultiTurnHelpStepsBot
The current step is stored in context.ConversationData(), and when the user clicks next or back, context.ConversationData() is checked to determine what to show next.

Related

Show suggestions to user and get input

I am using Microsoft Bot Framework with C# and my requirement is to show few images one by one to user and get feedback on each of them by click of button.
Later I need to process all the inputs collected.
I have implemented this logic inside a single step dialog within a waterfall.
I was trying to implement it by calling the same dialog again until all images have been shown to user, but the problem is that either same image keeps coming again and again or only one image is shown.
I wanted to know if this approach is feasible to achieve the desired functionality or I should consider taking any other approach

Popup child window with ok and cancel buttons

I've created a simple dialog here with a list of people. All I want to do is a few simple things which are rather trivial in winforms. However I'm struggling to grasp how to do this in wpf with an mvvm approach. Could someone help me out please.
When the user hits the Add New Person button, I want a dialog to appear where a user can type in their Name and either hit OK or Cancel. If the user hits OK, it appends the person to the list. (keep in mind i'll add more edting fields for the users to input, for example last name...)
When the users has a single item in the list selected, i want them to give them the ability to click an 'edit' button showing a dialog similar to the one in the previous step, pre populated with the selected items data, so a user can edit the properties. Then depending on if they hit OK or Cancel the changes are committed.
Dropbox solution: https://www.dropbox.com/s/8sjpabfod08yil5/AddDeleteItems_basic.zip?dl=
To create and display dialogs using MVVM, you'll want to implement a dialog service pattern to handle such requests. This service would be called from within your view model.
There is a really informative Code Project article about this very topic (Showing Dialogs When Using The MVVM Pattern. My advice would be to read that article and then look through the source files accompanying the article. This should provide you with a very good starting point to achieve your use cases (custom dialogs) and can also be used for displaying standard dialogs too (e.g. open file, save file, browse folder etc).
The service pattern isn't the only way to implement this, in the following article I show how to do it using the same data-driven mechanism used for regular windows:
http://www.codeproject.com/Articles/820324/Implementing-Dialog-Boxes-in-MVVM
I suggest this tutorial for you to get started. However, for the dialog Xceed library has some cool custom controls that may help you.

Ideas for the representation of a call flow

I need to make a representation of a voice mail call flow.
In this voice mail, I have actions such as reading text or a menu in which you have to press a number on your phone to go to another action.
My first thought was a treeview (I need to make it in C# wpf), but in the call flow, a next action can be an action already listed. So there will be duplicates.
Do you have any idea about how I could represent this call flow?
EDIT:
Sorry I miss the most important thing.
I want the user to be able to click on it and then text content will be display on a textbox to be modified.
Every action is an object and has content that I want to update

WPF save as dialog ... in a view?

My application has a wizard with some steps used to export data.
I want one of these steps to be the "Save as" step where the user choose the location on disk where the results will be exported.
I don't want to pop the save as dialog, but would like to have the equivalent in a view that I could put in my wizard as "just another step".
Any idea?
Unfortunately that's not possible without engineering your own non-standard save control. Save location in windows is done via the common save file dialog control. This is presented as a dialog and is not embeddable as an inline control.
My advice would be to follow the pattern laid out by other wizards
The save location should be expressed with a text box where users can directly enter the save location
To the right of the box is a Browse button which is hooked up to the save dialog
I would definitely recommend heavily against implementing your own Save control. There are a lot of odd nuances handled by the standard Save dialog that you would almost certainly miss (network locations, share point, etc ...). The result would be a non-standard and frustrating experience for end users

Non intrusive 'live' help system

I'm searching a C# component or code snipped that does something like that:
I want to inform new users about the most important program functions if he opens a new window for example.
It should be a box showing text (formated if possible) that is of course not modal and has some mechanism to 'go out of the way' if the user enters the textbox area. So that he can access what's underneath it. Alternativly the window could also stick to the border of the window, but there needs to be a way that this also works if the window is maximized.
So I want to present him with a short introduction of what he can do in every corner of my app most painlessly.
Thank you!
I use a "bar" at the top of every window to display some information about the current window/dialog.
Use tooltips. They can be programmatically controlled, and you can have them appear at will. You'll need to add the functionality to your app to keep track of what tooltips have been shown to the user already.
You can add a "balloon" style by setting the IsBalloon property to true.
You can also replace them with smaller descriptions for when the user wants to hover over the control and have them displayed again.
I'm already using tooltips heavily. However, they aren't very practical when displaying bigger amounts of data and they are bound to specific user actions.
Have you considered having a contextual menu for each form / page which contains links to Adobe Captivate style presentations for each available task? That way the user can investigate an example of how to achieve a task relating to what they are trying to achieve from within the application / site.
This approach would require a good deal of maintenance and management if your code changes regularly but coordinating it with a training department can provide rich help features in your application.
See http://www.adobe.com/products/captivate/ for more information.

Categories