Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6176137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:02:46+00:00 2026-05-24T00:02:46+00:00

Ok, so here’s what I want to do. Create a configuration file using XAML

  • 0

Ok, so here’s what I want to do.

  1. Create a “configuration file” using XAML 2009. It would look something like this:

    <TM:Configuration 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:tm="clr-namespace:Test.Monkey;assembly=Test.Monkey" 
    >
        <TM:Configuration.TargetFile>xxxx</TM:Configuration.TargetFile>
    <TM:Configuration 
    
  2. Parse this file at runtime in order to get the object-graph.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:02:47+00:00Added an answer on May 24, 2026 at 12:02 am

    Easy way:

    var z = System.Windows.Markup.XamlReader.Parse(File.ReadAllText("XAMLFile1.xaml"));
    
    (Turns out this does support XAML 2009 after all.)
    

    Hard way, but with less dependencies:

    var x = ParseXaml(File.ReadAllText("XAMLFile1.xaml"));
    
        public static object ParseXaml(string xamlString)
        {
            var reader = new XamlXmlReader(XmlReader.Create(new StringReader(xamlString)));
            var writer = new XamlObjectWriter(reader.SchemaContext);
            while (reader.Read())
            {
                writer.WriteNode(reader);
            }
            return writer.Result;
        }
    

    Creating XAML from object graph:

        public static string CreateXaml(object source)
        {
            var reader = new XamlObjectReader(source);
            var xamlString = new StringWriter();
            var writer = new XamlXmlWriter(xamlString, reader.SchemaContext);
            while (reader.Read())
            {
                writer.WriteNode(reader);
            }
            writer.Close();
            return xamlString.ToString();
        }
    

    Notes:

    1. Fully qualify all namespaces. It has problem finding local assemblies by namespace only.
    2. Consider using the ContentPropertyAttribute.
    3. Useful notes on XAML 2009: http://wpftutorial.net/XAML2009.html
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a coding problem for those that like this kind of thing. Let's see
Here is an example. foreach (var doc in documents) { var processor = this.factory.Create();
Here is what I want to do. Use this HTML line and have the
Here we go again, the old argument still arises... Would we better have a
Here is my persistence.xml : <?xml version=1.0 encoding=UTF-8?> <persistence xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd version=1.0>
Here's my procedure: DROP PROCEDURE IF EXISTS `couponExpires`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `couponExpires`(IN couponID BIGINT,
Here is my problem : I have a post controller with the action create.
Here is the code I'm using http://jsbin.com/evike5/edit When the jQuery UI dialog is fired
Here's my problem I have this javascript if (exchRate != ) { function roundthecon()
Here's my search array: $aExt = array('png','jpg','gif'); I want to search through the variable:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.