Articles → MICROSOFT BOT FRAMEWORK → Describe Attribute In Formflow
Describe Attribute In Formflow
Purpose
Click to Enlarge
Fields In Describe Attribute
- Description - Change the default description of field, property or enum.
- Image - Add an image on the card. In this attribute, the URL of an image is specified.
- Message - Message to return when a button is pressed in the card.
- Title - Specifies the title on the card.
- SubTitle - Specifies the subtitle on the card.
Example
[Describe(Description = "the name (written on your PAN card)")]
public string name;
Click to Enlarge
Click to Enlarge
public enum MaritalStatus { [Describe(Message = "Thank you for selecting the option Married")]
Married,
Unmarried,
Single
}
[Describe(
Description = "Marital Status", Image = "http://gyansangrah.com/ArticleImages/introduction_to_photoshop_three.JPG", Title = "Need for documentation purpose", SubTitle = "Please select between Married/Unmarried/Single")]
public MaritalStatus ? maritalStatus;
Click to Enlarge
Click to Enlarge
Click to Enlarge
Complete Code
using Microsoft.Bot.Builder.FormFlow;
using System;
namespace Bot_Application1.Dialogs {
public enum MaritalStatus { [Describe(Message = "Thank you for selecting the option Married")]
Married,
Unmarried,
Single
}
[Serializable]
public class FormFlowDemo { [Describe(Description = "the name (written on your PAN card)")]
public string name;
[Describe(Description = "Marital Status", Image = "http://gyansangrah.com/ArticleImages/introduction_to_photoshop_three.JPG", Title = "Need for documentation purpose", SubTitle = "Please select between Married/Unmarried/Single")]
public MaritalStatus ? maritalStatus;
public static IForm < FormFlowDemo > GetForm() {
return new FormBuilder < FormFlowDemo > ().Message("Welcome to support chat system. Please enter the following information to serve you better").Build();
}
}
}
Prompt Attribute
[Prompt("What is your marital status")]
public MaritalStatus ? maritalStatus;
Click to Enlarge