Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [xamlwriter]

The tag has no usage guidance.

0 votes
0 answers
35 views

In .NET 9, serialization of style using XamlWriter and XamlReader throws exception

In .NET 9, serialization and deserialization of style using XamlWriter and XamlReader throws exception. But in .NET 8 and other framework versions, it works fine. Please find the code below. In .NET 9,...
Karkuvel Rajan's user avatar
0 votes
1 answer
74 views

Why does XamlWriter adds a {} to some attributes?

I'm saving a resource dictionary to Xaml using XamlWriter and I noticed that for string properties with just {p}, the XamlWriter adds a {} before the text (resulting in {}{p}). Why does that happen? ...
Nicke Manarin's user avatar
2 votes
1 answer
303 views

XamlWriter.Save(object) - set root & additional namespaces

I'm serializing a object via XamlWriter.Save(object). This works as expected. Problem now is, XamlWriter sets the namespaces as it needs, for example the root Namespace xmlns is set to the namespace ...
Jochen Kühner's user avatar
2 votes
2 answers
457 views

Is it possible to get XamlWriter to save a StaticResource?

My problem is shown in the following program, where the GeometryModel3D's Material is set from a StaticResource in XAML. Is it possible to get the XamlWriter to save out the actual StaticResources ...
Kevin Marshall's user avatar
2 votes
1 answer
121 views

How to persist an Image with size, location, and rotation and then restore it?

In WPF, I have an image that is dropped onto an InkCanvas and added as a child: ImageInfo image_Info = e.Data.GetData(typeof(ImageInfo)) as ImageInfo; if (image_Info != null) { ...
Alan Wayne's user avatar
  • 5,305
0 votes
0 answers
571 views

How to convert an SoftwareBitmap Image to cv::Mat Image?

I am referencing this link -> Converting a SoftwareBitmap or WriteableBitmap to cv::Mat in c++/cx But every time I try to put this into the code it shows me this error...enter image description here ...
SK002's user avatar
  • 1
0 votes
1 answer
139 views

Generate xaml file (page) at runtime and reference it with uri

Im working on a wpf application based on Modern UI that have a gui designer part where the user can add and then drag/drop/resize etc. the control. The properties for the controls position, size etc. ...
Fredrik Boström's user avatar
2 votes
0 answers
785 views

How can I replace the default XamlWriter in XpsDocumentWriter?

It's a known issue that XamlWriter.Save is very slow (just Google "xamlwriter slow"). The application I wrote generates XPS documents, and has a limited scope of elements that it uses. Thus, I'd like ...
Charlie's user avatar
  • 855
0 votes
1 answer
514 views

The name 'XamlWriter' does not exist in the current context

I'm developing a universal windows application (on windows 10), with a .NET framework 4.5.2 I'm trying to clone a xaml object using 'XamlWriter' and 'XamlReader', but it seems visual studio has no ...
Isaac's user avatar
  • 29
0 votes
1 answer
472 views

WPF: Properties with ReadOnly attribute not being XAML serialized

I'm working on a C# WPF application that makes use of a Windows Forms PropertyGrid to allow the user to view and change an object's properties. Some properties I want to be visible but locked, so I'm ...
Chris Kessell's user avatar
0 votes
1 answer
390 views

XamlWriter skips "x:Name" attribute while saving ResourceDictionary

Here's custom style: <Style TargetType="{x:Type Button}"> <Setter Property="Focusable" Value="false" /> <Setter Property="Background" Value="{StaticResource AppBackBrush}"/> ...
keymusicman's user avatar
  • 1,291
5 votes
2 answers
2k views

XamlWriter.Save() is not serializing DependencyProperties

Consider the following XAML from my UserControl: <TextBlock Text="HelloWorld" Loaded="TextBlock_OnLoaded" /> And the associated event handler: private void ...
bugged87's user avatar
  • 3,084
8 votes
2 answers
3k views

Insert contents from the one FlowDocument into another when using XamlReader and XamlWriter

I use FlowDocument with BlockUIContainer and InlineUIContainer elements containing (or as base classes) some custom blocks - SVG, math formulas etc. Because of that using Selection.Load(stream, ...
Michał Turecki's user avatar
-1 votes
1 answer
366 views

Get a String from XamlWriter.Save(object obj, Stream stream)

Can i get back a string from the XamlWriter.Save(myBF, stream)? I need it so save the string in my database. What i have to change on the example from this answer
Karl_Schuhmann's user avatar
1 vote
1 answer
560 views

clone Xaml FramworkElement in WinRT

i need to clone a FrameworkELement in my CodeBehind in WinRT... I did found a solution in the internet, though this workaround doesn't work in WinRT because the XamlWriter is NOT available in winRT! ...
JuHwon's user avatar
  • 2,053

15 30 50 per page