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 35653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:16:11+00:00 2026-05-10T14:16:11+00:00

I have an object graph serialized to xaml. A rough sample of what it

  • 0

I have an object graph serialized to xaml. A rough sample of what it looks like is:

<MyObject xmlns.... >     <MyObject.TheCollection>         <PolymorphicObjectOne .../>         <HiImPolymorphic ... />     </MyObject.TheCollection> </MyObject> 

I want to use Linq to XML in order to extract the serialized objects within the TheCollection.

Note: MyObject may be named differently at runtime; I’m interested in any object that implements the same interface, which has a public collection called TheCollection that contains types of IPolymorphicLol.

The only things I know at runtime are the depth at which I will find the collection and that the collection element is named “*.TheCollection`. Everything else will change.

The xml will be retrieved from a database using Linq; if I could combine both queries so instead of getting the entire serialized graph and then extracting the collection objects I would just get back the collection that would be sweet.

  • 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. 2026-05-10T14:16:11+00:00Added an answer on May 10, 2026 at 2:16 pm

    Will,

    It is not possible to find out whether an object implements some interface by looking at XAML.
    With constraints given you can find xml element that has a child named .

    You can use following code: It will return all elements having child element which name ends with .TheCollection

        static IEnumerable<XElement> FindElement(XElement root)     {         foreach (var element in root.Elements())         {             if (element.Name.LocalName.EndsWith('.TheCollection'))             {                 yield return element.Parent;             }             foreach (var subElement in FindElement(element))             {                 yield return subElement;             }         }     } 

    To make sure that object represented by this element implements some interface you need to read metadata from your assemblies. I would recommend you to use Mono.Cecil framework to analyze types in your assemblies without using reflection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 76k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Are you absolutely sure that the server has successfully sent… May 11, 2026 at 3:00 pm
  • added an answer try implementing public partial class Window1 : INotifyPropertyChanged and then… May 11, 2026 at 3:00 pm
  • added an answer My personal anecdotes: I got involved with the Tcl community… May 11, 2026 at 3:00 pm

Related Questions

I have an object that I'd like to serialize and distribute between processes as
I have a server that handles the database access and a client that consumes
I'm running into problems serializing lots of objects in .NET. The object graph is
So I have an object graph, let's just say it's an order. You have

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.