xamlreader

XamlReader.Load in a Background Thread. Is it possible?

不想你离开。 提交于 2019-12-04 04:49:57
A WPF app has an operation of loading a user control from a separate file using XamlReader.Load() method: StreamReader mysr = new StreamReader(pathToFile); DependencyObject rootObject = XamlReader.Load(mysr.BaseStream) as DependencyObject; ContentControl displayPage = FindName("displayContentControl") as ContentControl; displayPage.Content = rootObject; The process takes some time due to the size of the file, so UI becomes frozen for several seconds. For keeping the app responsive I try to use a Background thread for performing the part of operation that is not directly involed in UI updating.

C# Attribute XmlIgnore and XamlWriter class - XmlIgnore not working

不想你离开。 提交于 2019-11-29 10:29:52
I have a class, containing a property Brush MyBrush marked as [XmlIgnore] . Nevertheless it is serialized in the stream causing trouble when trying to read via XamlReader . I did some tests, e.g. when changing the visibility of the Property (to internal) it is gone in the stream. Unfortunately I cannot do this in my particular scenario. Did anybody have the same issue and? Do you see any way to work around this? Remark: C# 4.0 as far I can tell This is a method from my Unit Test where I do test the XamlSerialization : // buffer to a StringBuilder StringBuilder sb = new StringBuilder();

C# Attribute XmlIgnore and XamlWriter class - XmlIgnore not working

ぐ巨炮叔叔 提交于 2019-11-28 03:50:41
问题 I have a class, containing a property Brush MyBrush marked as [XmlIgnore] . Nevertheless it is serialized in the stream causing trouble when trying to read via XamlReader . I did some tests, e.g. when changing the visibility of the Property (to internal) it is gone in the stream. Unfortunately I cannot do this in my particular scenario. Did anybody have the same issue and? Do you see any way to work around this? Remark: C# 4.0 as far I can tell This is a method from my Unit Test where I do