Questions tagged [xamlwriter]
The xamlwriter tag has no usage guidance.
xamlwriter
21
questions
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,...
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? ...
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 ...
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 ...
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)
{
...
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
...
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. ...
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 ...
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 ...
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 ...
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}"/>
...
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 ...
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, ...
-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
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! ...