using System; using System.Windows.Input; using WDataTemplate = Windows.UI.Xaml.DataTemplate; using WApplication = Windows.UI.Xaml.Application; #if WINDOWS_UWP namespace Xamarin.Forms.Platform.UWP #else namespace Xamarin.Forms.Platform.WinRT #endif { public class TextCellRenderer : ICellRenderer { public virtual WDataTemplate GetTemplate(Cell cell) { if (cell.RealParent is ListView) { if (TemplatedItemsList, Cell>.GetIsGroupHeader(cell)) return (WDataTemplate)WApplication.Current.Resources["ListViewHeaderTextCell"]; //return (WDataTemplate) WApplication.Current.Resources["ListViewTextCell"]; } return (WDataTemplate)WApplication.Current.Resources["TextCell"]; } } public class EntryCellRendererCompleted : ICommand { public bool CanExecute(object parameter) { return true; } public event EventHandler CanExecuteChanged; public void Execute(object parameter) { var entryCell = (EntryCell)parameter; entryCell.SendCompleted(); } } public class EntryCellRenderer : ICellRenderer { public virtual WDataTemplate GetTemplate(Cell cell) { return (WDataTemplate)WApplication.Current.Resources["EntryCell"]; } } public class ViewCellRenderer : ICellRenderer { public virtual WDataTemplate GetTemplate(Cell cell) { return (WDataTemplate)WApplication.Current.Resources["ViewCell"]; } } public class SwitchCellRenderer : ICellRenderer { public virtual WDataTemplate GetTemplate(Cell cell) { return (WDataTemplate)WApplication.Current.Resources["SwitchCell"]; } } public class ImageCellRenderer : ICellRenderer { public virtual WDataTemplate GetTemplate(Cell cell) { //if (cell.Parent is ListView) // return (WDataTemplate)WApplication.Current.Resources["ListImageCell"]; return (WDataTemplate)WApplication.Current.Resources["ImageCell"]; } } }