<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Blog of Zachary Snow &#187; WinForms</title>
	<atom:link href="http://zacharysnow.net/category/net/winforms-dotnet-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://zacharysnow.net</link>
	<description></description>
	<lastBuildDate>Tue, 20 Dec 2011 19:41:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Keeping SplitContainer SplitterDistance consistent</title>
		<link>http://zacharysnow.net/2011/02/09/keeping-splitcontainer-splitterdistance-consistent/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=keeping-splitcontainer-splitterdistance-consistent</link>
		<comments>http://zacharysnow.net/2011/02/09/keeping-splitcontainer-splitterdistance-consistent/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 18:53:06 +0000</pubDate>
		<dc:creator>Zachary</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[WinForms]]></category>
		<category><![CDATA[split-container]]></category>
		<category><![CDATA[win-forms]]></category>

		<guid isPermaLink="false">http://zacharysnow.net/?p=368</guid>
		<description><![CDATA[If you&#8217;re having trouble keeping the SplitterDistance property of a SplitContainer consistent across app sessions, you can set the FixedPanel property of the splitter to FixedPanel.Panel1. splitter.FixedPanel = FixedPanel.Panel1; I guess this could also work with FixedPanel.Panel2 as well but &#8230; <a href="http://zacharysnow.net/2011/02/09/keeping-splitcontainer-splitterdistance-consistent/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re having trouble keeping the SplitterDistance property of a SplitContainer consistent across app sessions, you can set the FixedPanel property of the splitter to FixedPanel.Panel1.</p>
<pre name="code" class="c#">
splitter.FixedPanel = FixedPanel.Panel1;
</pre>
<p>I guess this could also work with FixedPanel.Panel2 as well but I haven&#8217;t given it a try. Credit <a href="http://stackoverflow.com/questions/129362/restoring-splitterdistance-inside-tabcontrol-is-inconsistent">this stackoverflow post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://zacharysnow.net/2011/02/09/keeping-splitcontainer-splitterdistance-consistent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WinForms and MVC</title>
		<link>http://zacharysnow.net/2010/05/26/winforms-and-mvc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=winforms-and-mvc</link>
		<comments>http://zacharysnow.net/2010/05/26/winforms-and-mvc/#comments</comments>
		<pubDate>Wed, 26 May 2010 18:53:09 +0000</pubDate>
		<dc:creator>Zachary</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[WinForms]]></category>
		<category><![CDATA[mvc]]></category>

		<guid isPermaLink="false">http://zacharysnow.net/?p=304</guid>
		<description><![CDATA[I recently became interested in doing MVC inside of a Windows Forms app. I found a few MVC frameworks which work with WinForms (see here) but they didn&#8217;t really interest me. Too heavy I felt for what I was looking &#8230; <a href="http://zacharysnow.net/2010/05/26/winforms-and-mvc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently became interested in doing MVC inside of a Windows Forms app. I found a few MVC frameworks which work with WinForms (<a href="http://stackoverflow.com/questions/2406/looking-for-a-mvc-sample-for-winforms">see here</a>) but they didn&#8217;t really interest me. Too heavy I felt for what I was looking to do. I ended up with a solution looking something like this:</p>
<p><a href="http://zacharysnow.net/wp-content/uploads/2010/05/WinFormsMvcSolution.png"><img src="http://zacharysnow.net/wp-content/uploads/2010/05/WinFormsMvcSolution-150x150.png" alt="WinForms MVC Solution" title="WinForms MVC Solution" width="150" height="150" class="alignnone size-thumbnail wp-image-305" /></a></p>
<p>There is really only one controller and that is the &#8220;Application&#8221; class. It contains all the methods your app can call to manipulate your models, which are in the &#8220;Data&#8221; folder / namespace. The &#8220;WinFormsApplication&#8221; class inherits from the &#8220;Application&#8221; class and just sets the view to an instance of &#8220;WinFormsView&#8221;. The &#8220;Application&#8221; class communicates with the view through the &#8220;IView&#8221; interface. The &#8220;WinFormsView&#8221; class is a Windows Forms implementation of that view. The &#8220;Application&#8221; class and your models are not coupled in any way to your Windows Forms implementation of the view.</p>
<p>If you want you view to be as dumb as possible, your view can communicate with the &#8220;Application&#8221; class only through events. In my case though, I choose to go with a smart view and have the view call back to methods in the &#8220;Application&#8221; class. The &#8220;Application&#8221; class tells the view when models are loaded and unloaded. The view subscribes to events on the models and reacts to the events.</p>
<p>All of my forms and controls communicate with each other through the &#8220;WinFormsView&#8221; class. One control might change the value of a property in the &#8220;WinFormsView&#8221; class and another control might subscribe to a change event and update as necessary. This keeps the controls and forms slightly less coupled.</p>
<p>It&#8217;s not a perfect implementation of MVC but it keeps my model logic decoupled enough from my view logic that I can later implement a WPF version of the view I think.</p>
]]></content:encoded>
			<wfw:commentRss>http://zacharysnow.net/2010/05/26/winforms-and-mvc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>First Look at Map Editor</title>
		<link>http://zacharysnow.net/2009/07/13/first-look-at-map-editor/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=first-look-at-map-editor</link>
		<comments>http://zacharysnow.net/2009/07/13/first-look-at-map-editor/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 19:59:37 +0000</pubDate>
		<dc:creator>Zachary</dc:creator>
				<category><![CDATA[WinForms]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://zacharysnow.wordpress.com/?p=251</guid>
		<description><![CDATA[I&#8217;ve been working on a map editor for what seem likes forever now. I&#8217;ve gotten so much done and then I would just feel like the thing was written poorly and so I would completely reorganize it. I&#8217;ve done that &#8230; <a href="http://zacharysnow.net/2009/07/13/first-look-at-map-editor/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://zacharysnow.files.wordpress.com/2009/07/mapeditor.jpg"><img src="http://zacharysnow.files.wordpress.com/2009/07/mapeditor.jpg?w=300" alt="MapEditor" title="MapEditor" width="300" height="182" class="alignleft size-medium wp-image-253" /></a></p>
<p>I&#8217;ve been working on a map editor for what seem likes forever now. I&#8217;ve gotten so much done and then I would just feel like the thing was written poorly and so I would completely reorganize it. I&#8217;ve done that about 3 times now.</p>
<p>Finally though I have an MVC pattern going in the code and I&#8217;m very comfortable with what I&#8217;ve written. I&#8217;m not sure when I&#8217;ll be finished but I should have something workable within the next weeks or so.</p>
]]></content:encoded>
			<wfw:commentRss>http://zacharysnow.net/2009/07/13/first-look-at-map-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

