// Assigns default templates depending on the Mode. void PrepareTemplates() { // Set appropriate default templates for each twitter mode switch (Mode) { case TwitterMode.Profile: if (LayoutTemplate == null) { LayoutTemplate = new DefaultProfileLayoutTemplate(this); } if (StatusTemplate == null) { StatusTemplate = new DefaultProfileStatusTemplate(this); } break; case TwitterMode.Search: if (LayoutTemplate == null) { LayoutTemplate = new DefaultSearchLayoutTemplate(this); } if (StatusTemplate == null) { StatusTemplate = new DefaultSearchStatusTemplate(this); } break; } // Assign default empty data template if (EmptyDataTemplate == null) { EmptyDataTemplate = new DefaultEmptyDataTemplate(); } // Copy templates from Twitter control to ListView _listView.LayoutTemplate = LayoutTemplate; _listView.ItemTemplate = StatusTemplate; _listView.AlternatingItemTemplate = AlternatingStatusTemplate; _listView.EmptyDataTemplate = EmptyDataTemplate; }
// Assigns default templates depending on the Mode. void PrepareTemplates() { // Set appropriate default templates for each twitter mode switch (Mode) { case TwitterMode.Profile: if (LayoutTemplate == null) LayoutTemplate = new DefaultProfileLayoutTemplate(this); if (StatusTemplate == null) StatusTemplate = new DefaultProfileStatusTemplate(this); break; case TwitterMode.Search: if (LayoutTemplate == null) LayoutTemplate = new DefaultSearchLayoutTemplate(this); if (StatusTemplate == null) StatusTemplate = new DefaultSearchStatusTemplate(this); break; } // Assign default empty data template if (EmptyDataTemplate == null) { EmptyDataTemplate = new DefaultEmptyDataTemplate(); } // Copy templates from Twitter control to ListView _listView.LayoutTemplate = LayoutTemplate; _listView.ItemTemplate = StatusTemplate; _listView.AlternatingItemTemplate = AlternatingStatusTemplate; _listView.EmptyDataTemplate = EmptyDataTemplate; }