mirror of
https://github.com/bitwarden/mobile
synced 2025-12-05 23:53:33 +00:00
* Refactored CustomFields to stop using RepeaterView and use BindableLayout and divided the different types on different files and added a factory to create them * Fix formatting
29 lines
968 B
C#
29 lines
968 B
C#
using Bit.App.Lists.ItemViewModels.CustomFields;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Bit.App.Lists.DataTemplateSelectors
|
|
{
|
|
public class CustomFieldItemTemplateSelector : DataTemplateSelector
|
|
{
|
|
public DataTemplate TextTemplate { get; set; }
|
|
public DataTemplate BooleanTemplate { get; set; }
|
|
public DataTemplate LinkedTemplate { get; set; }
|
|
public DataTemplate HiddenTemplate { get; set; }
|
|
|
|
protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
|
|
{
|
|
switch (item)
|
|
{
|
|
case BooleanCustomFieldItemViewModel _:
|
|
return BooleanTemplate;
|
|
case LinkedCustomFieldItemViewModel _:
|
|
return LinkedTemplate;
|
|
case HiddenCustomFieldItemViewModel _:
|
|
return HiddenTemplate;
|
|
default:
|
|
return TextTemplate;
|
|
}
|
|
}
|
|
}
|
|
}
|