XamlParseException: The current SyncrhonizationContext may not be used as a TaskScheduler

Nov 4, 2013 at 12:02 AM
Edited Nov 4, 2013 at 1:14 AM
EDIT: Okay the problem is clearly now about xUnit running the dialog. I don't understand why this would be a problem or how to fix it, but it's got to be something specifically about dialogs and threads. Help?

Huh? I'm following the manual tutorial, and as soon as I link in the Page1 UserControl, this blows up on me. I'm running the dialog through the xUnit unit tester.

I have not been able to locate any clues what causes this.

Page1.xaml:
<UserControl x:Class="VmmWpf.Page1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
  
</UserControl>
MoldFeatures.xaml:
<mui:ModernWindow x:Class="VmmWpf.MoldFeatures"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:mui="http://firstfloorsoftware.com/ModernUI"
  Title="MainWindow" Height="350" Width="525" 
  Background="Tan"
  ContentSource="/Page1.xaml" <!--- this line causes crash -->
>
  <Window.Resources>
    <ResourceDictionary Source="ResourceDictionary.xaml" />
  </Window.Resources>

  <mui:ModernWindow.MenuLinkGroups>
    <mui:LinkGroup DisplayName="group 1" >
      <mui:LinkGroup.Links>
        <mui:Link DisplayName="link 1" Source="/Page1.xaml" />
        <mui:Link DisplayName="link 2" />
        <mui:Link DisplayName="link 3" />
      </mui:LinkGroup.Links>
    </mui:LinkGroup>
  </mui:ModernWindow.MenuLinkGroups>
</mui:ModernWindow>