You need to look into design patterns like:
Model-View-Controller (MVC) often used by web sites (ASP.NET)
Model-View-View Model (MVVM) often used by WPF
By keeping to one of these you should be able to keep the various parts of your application separate.
There are other patterns that do a similar job.
Also, developing with WPF can help as the UI is defined by the XAML and the code that does the work is the C#. This can provide a basic degree of separation. If you find yourself writing C# code that just manipulates the UI you can take a step back and think "should I do this in XAML?". Obviously there might be things you have to do in the code behind, but it's a start.
answered 2010-06-25T12:09:43.297