Frame.Template can be null

Frame.Template is null if you use a ListView with MasterDetailMode = ListViewAndDetailView inside a DetailView. Without this change this DetailView can't be opened any more.