Skip to content

ModernWpf.SampleApp throws XamlParseException when viewing the "Threaded UI" example. #660

@dostjh

Description

@dostjh

ModernWpf.SampleApp throws XamlParseException when viewing the "Threaded UI" example.

I'm cloned to commit 218e8ec.
I'm on Windows 11.

System.Windows.Markup.XamlParseException: ''Initialization of 'ModernWpf.Controls.ProgressBar' threw an exception.' Line number '29' and line position '15'.'

Inner Exception:
InvalidOperationException: The calling thread cannot access this object because a different thread owns it.

image

Callstack

>	PresentationFramework.dll!System.Windows.Markup.XamlReader.RewrapException(System.Exception e, System.Xaml.IXamlLineInfo lineInfo, System.Uri baseUri) Line 362	C#
 	PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader xamlReader, System.Xaml.IXamlObjectWriterFactory writerFactory, bool skipJournaledProperties, object rootObject, System.Xaml.XamlObjectWriterSettings settings, System.Uri baseUri) Line 121	C#
 	PresentationFramework.dll!System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader xamlReader, bool skipJournaledProperties, object rootObject, System.Xaml.Permissions.XamlAccessLevel accessLevel, System.Uri baseUri) Line 38	C#
 	PresentationFramework.dll!System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream stream, System.Windows.Markup.ParserContext parserContext, object parent, bool closeStream) Line 764	C#
 	ModernWpf.SampleApp.exe!ModernWpf.SampleApp.ThreadedUI.ThreadedProgressBar.InitializeComponent() Line 1	C#
 	ModernWpf.SampleApp.exe!ModernWpf.SampleApp.ThreadedUI.ThreadedProgressBar.ThreadedProgressBar() Line 10	C#
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	mscorlib.dll!System.RuntimeType.CreateInstanceSlow(bool publicOnly, bool skipCheckThis, bool fillCache, ref System.Threading.StackCrawlMark stackMark)	Unknown
 	mscorlib.dll!System.Activator.CreateInstance(System.Type type, bool nonPublic)	Unknown
 	mscorlib.dll!System.Activator.CreateInstance(System.Type type)	Unknown
 	ModernWpf.SampleApp.exe!ModernWpf.SampleApp.ThreadedUI.ThreadedVisualHost.CreateChild() Line 48	C#
 	ModernWpf.SampleApp.exe!ModernWpf.SampleApp.ThreadedUI.ThreadedVisualHostBase.LoadChild.__ThreadProc|0() Line 187	C#
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)	Unknown
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)	Unknown
 	mscorlib.dll!System.Threading.ThreadHelper.ThreadStart()	Unknown

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions