Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As you're probably aware, all the Express editions do not support third party extensions. Unfortunately I know of no stand alone tools that can do what you are asking.</p> <p>I've experimented with splitting a Winform class into partials classes. As you discovered, it is not a trivial undertaking. <a href="https://stackoverflow.com/questions/669540/split-old-net-code-into-designer-partial-class/">This</a> question has been asked before. Unlike <a href="https://stackoverflow.com/users/2684/martin-marconcini">Martin's</a> attempt, I went the other direction. Instead of creating a designer file, I renamed the existing file to MyForm.Designer.cs and created a new MyForm.cs file. I then proceeded in a similar manner, moving the "code behind" instead of the designer code into my new class. </p> <p>The one sticking point with either of these techniques is that future changes to the form still don't generate in the correct class file. This is because the project file still doesn't recognize the two files to be linked together. Your only option is to manually edit the project file in a text editor. Look for the following:</p> <pre><code>&lt;Compile Include="MyForm.Designer.cs"&gt; &lt;SubType&gt;Form&lt;/SubType&gt; &lt;/Compile&gt; </code></pre> <p>Replace the <code>&lt;SubType&gt;...&lt;/SubType&gt;</code> with <code>&lt;DependentUpon&gt;MyForm.cs&lt;/DependentUpon&gt;</code> so the end result looks like:</p> <pre><code>&lt;Compile Include="MyForm.Designer.cs"&gt; &lt;DependentUpon&gt;MyForm.cs&lt;/DependentUpon&gt; &lt;/Compile&gt; </code></pre> <p>Another solution I experimented with was simply creating an new form and dragging the controls from the old form to it. This actually worked to an extent. All the controls migrated along with all their properties. What didn't migrate was event handlers. These you would have to cut and paste from the old form, then go through each control and reselect the appropriate handler from the form designer. Depending on the complexity of the form this might be a reasonable alternative.</p> <p>From my own personal experiences supporting multiple UIs the best approach is to keep form design simple and separate the business logic from the UI completely. The <a href="http://martinfowler.com/eaaDev/PassiveScreen.html" rel="nofollow noreferrer">MVP Passive view</a> works pretty well for this. By delegating as much of the responsibility to a presenter class it becomes trivial to implement the form in a different UI framework. WinForms, WebForms, WPF, etc, it makes little difference to the presenter class. All it sees in an interface exposing a list of properties it manipulates. Of course all the shoulda coulda wouldas in the world won't help when the problem you are facing is here and now.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload