{"id":110,"date":"2009-07-03T12:15:15","date_gmt":"2009-07-03T20:15:15","guid":{"rendered":"http:\/\/steveharoz.com\/blog\/?p=110"},"modified":"2009-07-03T12:15:15","modified_gmt":"2009-07-03T20:15:15","slug":"refactoring-in-wpf","status":"publish","type":"post","link":"http:\/\/steveharoz.com\/blog\/2009\/refactoring-in-wpf\/","title":{"rendered":"Refactoring in WPF"},"content":{"rendered":"<p>I\u2019ve recently encountered a lot of frustrating DX (developer experience) problems while working on my WPF OpenGL project. <em>For those curious, I\u2019m disentangling my personal research from the OpenGL libraries and controls (hopefully, I\u2019ll post by Monday)<\/em>. These gripes have no real order, so I\u2019ll just mention a couple:<\/p>\n<ul>\n<li>Renaming a Window class.\n<ol>\n<li>Rename the class in the .xaml.cs file. VS will nicely refactor all references including dependency properties (I hate that specific class names are needed for these). <\/li>\n<li>Rename the class in .xaml file. That\u2019s right; VS doesn\u2019t refactor XAML code. It\u2019s not even nice enough to give you a compiler error, you have to run the program to find the unintelligable, unlocalized error. WTF?!? <\/li>\n<li>To maintain sanity, rename the the .xaml file with the new class name. VS is at least nice enough to rename the .xaml.cs file automatically. <\/li>\n<li>If you renamed the file of the startup window, you\u2019ll get another meaningless runtime error. Yay! The fix is to open App.xaml and change the StartupUri. <\/li>\n<li>Compile and hope you didn\u2019t make a single typo anywhere. Then recall fond memories of the winform days when refactoring took care of everything. <\/li>\n<\/ol>\n<\/li>\n<li>Converting an application project into a library. It\u2019s simple but unintuitive. Change the \u201cOutput type\u201d in the project properties to \u201cclass library\u201d. Now your application will completely break. The fix is to drop app.xaml and the .cs file from the class project. We shouldn\u2019t have to do this! <\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve recently encountered a lot of frustrating DX (developer experience) problems while working on my WPF OpenGL project. For those curious, I\u2019m disentangling my personal research from the OpenGL libraries and controls (hopefully, I\u2019ll post by Monday). These gripes have no real order, so I\u2019ll just mention a couple: Renaming a Window class. Rename the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[8],"tags":[13,25],"class_list":["post-110","post","type-post","status-publish","format-standard","hentry","category-wpf","tag-dx","tag-wpf"],"_links":{"self":[{"href":"http:\/\/steveharoz.com\/blog\/wp-json\/wp\/v2\/posts\/110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/steveharoz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/steveharoz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/steveharoz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/steveharoz.com\/blog\/wp-json\/wp\/v2\/comments?post=110"}],"version-history":[{"count":0,"href":"http:\/\/steveharoz.com\/blog\/wp-json\/wp\/v2\/posts\/110\/revisions"}],"wp:attachment":[{"href":"http:\/\/steveharoz.com\/blog\/wp-json\/wp\/v2\/media?parent=110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/steveharoz.com\/blog\/wp-json\/wp\/v2\/categories?post=110"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/steveharoz.com\/blog\/wp-json\/wp\/v2\/tags?post=110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}