Components of ABC channel Nuget Package:
https://www.nuget.org/packages/AbcComponentsHelper/
To install the package:
PM> Install-Package AbcComponentsHelper
- Apple Business Chat
PS: Almost all these examples accepts an extra/optional argument that sets the order or style of the element.
PS2: Almost all these examples that uses a collection also accepts to be passed as params[].
Channels: Apple Business Chat
- BaseMessage
- InteractiveData: (Obligatory)
- Data : (Obligatory)
- Sections: (Obligatory)
- MultipleSelection
- Items(Obligatory)
- Image
- ReceivedMessage
- ReplyMessage
Example:
First of all, you'll create a array of items(or pass items as params[])
var items = new List<ListPickerItem>();
//Defining Items
items.Add(new ListPickerItem("style", "itemTitle", "imageIdentifier", order, "itemIdentifier"));Then you'll create the array of images(if there's any image):
var imageArray = new List<Image>();
//Defining Items
imageArray.Add(new Image("ImageIdentifier", Base64Image));or
imageArray.Add(new Image("ImageIdentifier", byte[] image));Then you'll create receveid message item:
var receivedMessage = new ReceivedMessage("style", "Title", "Subtitle", "ImageIdentifier");Finally, creating listpicker:
var sections = new List<Section>();
sections.Add(new Section(items.ToArray()));
var listPickerDocument = new ListPickerDocument(
new InteractiveData(
new Data(sections),
receivedMessage));Another way of create a listpicker:
var items = new List<Items>();
items.Add(new Items("ItemTitle", "ItemImageIdentifier", "itemImage", order));
items.Add(new Items("ItemTitle2", "ItemImageIdentifier2", "itemImage2", order+1));
var listPicker = new ListPickerDocument("ReceveidMessageTitle", "ReceveidMessageSubTitle", items, multipleSelection));- BaseMessage
- TimePickerInteractiveData: (Obligatory)
- TimePickerData : (Obligatory)
- EventItem: (Obligatory)
- Location
- TimeSlots(Obligatory)
- Image
- ReceivedMessage
- ReplyMessage
You'll have to initialize receivedMessage as you did in listpicker(replyMessage is optional in both cases), but using TimePickerReceivedMessage and TimePickerReplyMessage.
But instead of a collection of items you'll have a collection of TimeSlots, as you can see down bellow:
var timeSlots = new List<TimeSlots>();
timeSlots.Add(new TimeSlots(duration,
time.ToString($"yyyy-MM-ddTHH:mm{timezonestring}"),
timeIdentifier)); Then you can create a TimePicker:
var timePickerDocument = new TimePickerDocument(
new TimePickerInteractiveData(
new TimePickerData("1.0",
new Event(string.Empty, "Agendamento", timeSlots)),
receivedMessage));
