var thread = new Thread(delegate()
{
try{
var win = (System.Windows.Window)System.Windows.Markup.XamlReader.Load(
new MemoryStream(Encoding.UTF8.GetBytes(@"
<Window xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""
xmlns:d=""http://schemas.microsoft.com/expression/blend/2008""
xmlns:mc=""http://schemas.openxmlformats.org/markup-compatibility/2006""
Height=""300"" Width=""400"" Background=""Black"">
<Window.Resources>
<Style TargetType=""Control"" x:Key=""BlackStyleControl"">
<Setter Property=""Background"" Value=""Black"" />
<Setter Property=""Foreground"" Value=""White"" />
</Style>
<Style TargetType=""Button"" BasedOn=""{StaticResource BlackStyleControl}"">
<Setter Property=""FontSize"" Value=""18"" />
</Style>
<Style TargetType=""ListView"" BasedOn=""{StaticResource BlackStyleControl}"" />
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ListView></ListView>
<Grid Grid.Column=""1"">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Button Content=""Start"" Grid.Row=""1"" />
<Button Content=""Stop"" Grid.Row=""2"" />
</Grid>
</Grid>
</Window>")));
var app = new System.Windows.Application();
app.Run(win);
} catch(Exception e){
project.SendInfoToLog(e.Message);
}
});
thread.ApartmentState = ApartmentState.STA;
thread.Start();
в GAC понадобятся эти либы:
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System.Windows.Controls.Ribbon" />
<Reference Include="System.Xaml" />
<Reference Include="UIAutomationClient" />
<Reference Include="UIAutomationProvider" />
<Reference Include="UIAutomationTypes" />
<Reference Include="WindowsBase" />