From 51b55c7da66b3ec3373b4e7e935c46dbd28d386a Mon Sep 17 00:00:00 2001 From: hypersw Date: Tue, 21 Jun 2016 04:55:46 +0300 Subject: [PATCH] Only yield non-NULL template if DisplayMemberPath is set, otherwise leave it NULL for ContentPresenter to try looking up a template in resources by the data type. --- src/Controls/ItemsControl.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Controls/ItemsControl.ts b/src/Controls/ItemsControl.ts index dc22b59e..34797489 100755 --- a/src/Controls/ItemsControl.ts +++ b/src/Controls/ItemsControl.ts @@ -202,8 +202,9 @@ module Fayde.Controls { } private _DisplayMemberTemplate: DataTemplate = null; private _GetDisplayMemberTemplate(): DataTemplate { - if (!this._DisplayMemberTemplate) { - var xm = DisplayTemplate.create(this.DisplayMemberPath || ""); + // Only yield non-NULL template if DisplayMemberPath is set, otherwise leave it NULL for ContentPresenter to try looking up a template in resources by the data type + if ((!this._DisplayMemberTemplate) && (this.DisplayMemberPath) && (this.DisplayMemberPath !== "")) { + var xm = DisplayTemplate.create(this.DisplayMemberPath); this._DisplayMemberTemplate = Markup.Load(this.App, xm); } return this._DisplayMemberTemplate;