mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-01 00:46:33 +01:00
26 lines
823 B
C#
26 lines
823 B
C#
using Xamarin.Forms;
|
|
|
|
namespace TINK.View.MiniSurvey.Question
|
|
{
|
|
/// <summary>
|
|
/// Selects different templates for different question types.
|
|
/// </summary>
|
|
public class QuestionViewCellTemplateSelector : DataTemplateSelector
|
|
{
|
|
DataTemplate checkOneViewCell;
|
|
DataTemplate freeTextViewCell;
|
|
|
|
public QuestionViewCellTemplateSelector()
|
|
{
|
|
checkOneViewCell = new DataTemplate(typeof(CheckOneViewCell));
|
|
freeTextViewCell = new DataTemplate(typeof(FreeTextViewCell));
|
|
}
|
|
|
|
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
|
|
{
|
|
return item is ViewModel.MiniSurvey.Question.FreeTextViewModel
|
|
? freeTextViewCell
|
|
: checkOneViewCell;
|
|
}
|
|
}
|
|
}
|