Moved a lot of the logic for running trials out of the code behind of TrialRun.xaml.cs and into an object class called TrialRunner.cs