{"id":3807,"date":"2014-03-30T05:46:08","date_gmt":"2014-03-30T05:46:08","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/static-resource-error-collection-of-common-programming-errors\/"},"modified":"2014-03-30T05:46:08","modified_gmt":"2014-03-30T05:46:08","slug":"static-resource-error-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/static-resource-error-collection-of-common-programming-errors\/","title":{"rendered":"Static Resource Error-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to work through a Silverlight example posted here:<br \/>\nhttp:\/\/www.silverlight.net\/learn\/quickstarts\/choosing-which-control-to-use\/<\/p>\n<p>But, I am getting the following runtime error:<br \/>\n&#8220;Cannot find a Resource with the Name\/Key WriterTemplate [Line: 14 Position: 42]&#8221;<\/p>\n<p>Here is my code so far:<\/p>\n<p>xaml<\/p>\n<pre>\n\n    \n        \n        \n        \n        \n        \n\n    \n<\/pre>\n<p>xaml.cs<\/p>\n<pre>using System;\nusing System.Collections.ObjectModel;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Animation;\nusing System.Windows.Shapes;\n\nnamespace TreeView\n{\n    public partial class MainPage : UserControl\n    {\n        public MainPage()\n        {\n            InitializeComponent(); \n\n            ObservableCollection writers = new ObservableCollection() { new Writer(\"Chris Sells\", new ObservableCollection() {\"ComboBox\", \"ComboBoxItem\"}, \"Writer II\"), new Writer(\"Luka Albrous\", new ObservableCollection() {\"ListBox\",\"ListBoxItem\"}, \"Senior Writer\"), new Writer(\"George Louverdis\", new ObservableCollection() {\"DataGrid\",\"Binding\"}, \"Writer I\")};\n\n            listBox1.DataContext = writers;\n            dataGrid1.DataContext = writers;\n            treeView1.DataContext = writers;\n\n        }\n        public class Writer\n        {\n            public Writer() { }\n            public Writer(string writerName, ObservableCollection listOfTypes, string writerTitle)\n            {\n                Name = writerName;\n                Types = listOfTypes;\n                Title = writerTitle;\n            }\n\n            public string Name { get; set; }\n            public ObservableCollection Types { get; set; }\n            public string Title { get; set; }\n        }\n\n    }\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to work through a Silverlight example posted here: http:\/\/www.silverlight.net\/learn\/quickstarts\/choosing-which-control-to-use\/ But, I am getting the following runtime error: &#8220;Cannot find a Resource with the Name\/Key WriterTemplate [Line: 14 Position: 42]&#8221; Here is my code so far: xaml xaml.cs using System; using System.Collections.ObjectModel; using System.Collections.Generic; using System.Linq; using System.Net; using System.Windows; using System.Windows.Controls; using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3807","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3807"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3807\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}