title: Can Windows Workflows be written in C# instead of XAML?
body: <p>We are using Windows Workflow Foundation for our workflows. The XAMLX files that contain workflow definitions are very brittle (they often end-up unopenable for no apparent reason) and we can't work on them in parallel, because we won't be able to merge those changes (underlying XAML is nie-human-readable). I'm looking for ways to alleviate the pains of having to work with XAML via built-in Visual Studio editor. Is it possible to define Windows Workflow Foundation workflows in C#? </p>
  
  <p>This article <a href="https://msdn.microsoft.com/en-us/library/ee342461.aspx" rel="nofollow noreferrer">article</a> in the "Workflow Structure" section suggests that it is possible, but does not give full example.</p>
  
  <p><strong>Final Update</strong>
  Check the answer below for a working sample of code-only C# workflow and config to host it via WCF.   </p>