private ChatItem CreateTimeBreak(ChatroomTimebreak timebreak) { TimeBreak telerikTimeBreak = new TimeBreak(); telerikTimeBreak.Data = timebreak; telerikTimeBreak.SetBinding(TimeBreak.TextProperty, new Binding { Path = nameof(timebreak.Text), Source = timebreak, }); return(telerikTimeBreak); }
public ChatItem ConvertToChatItem(object dataItem, ChatItemConverterContext context) { ChatroomTextMessage message = dataItem as ChatroomTextMessage; if (message != null) { return(this.CreateTextMessage(message, context.Chat)); } ChatroomTimebreak timebreak = dataItem as ChatroomTimebreak; if (timebreak != null) { return(this.CreateTimeBreak(timebreak)); } throw new NotSupportedException("Unsupported item type was provided."); }