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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:24:14+00:00 2026-05-28T14:24:14+00:00

I have been trying to create some dynamic Xaml. I have the following c#

  • 0

I have been trying to create some dynamic Xaml.

I have the following c#

private void LoadUI()
{
    XNamespace xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation";

    dynamic UI = new XElement(xmlns + "Grid",
                              new XAttribute(XNamespace.Xmlns + "x", "http://schemas.microsoft.com/winfx/2006/xaml"),
                              new XAttribute("Name", "Grid1"),
                              new XElement(xmlns + "Grid.ColumnDefinitions",
                                           new XElement(xmlns + "ColumnDefinition", new XAttribute("Width", "100*")),
                                           new XElement(xmlns + "ColumnDefinition", new XAttribute("Width", "200*"))),
                              new XElement(xmlns + "StackPanel", new XAttribute("Name", "StackLabels"),
                                           new XAttribute("Margin", "3"),
                                           from column in this.TableSchema
                                           where column.IsPrimaryKey == 0 && column.DataType != "timestamp"
                                           select
                                               new XElement(xmlns + "Label", new XAttribute("Height", "28"),
                                                            new XAttribute("Name", column.ColumnName + "Label"),
                                                            new XAttribute("HorizontalContentAlignment", "Right"),
                                                            column.ColumnName)),
                              new XElement(xmlns + "StackPanel",
                                           new XAttribute("Grid.Column", "1"),
                                           new XAttribute("Name", "StackFields"),
                                           new XAttribute("Margin", "3")
                                  ,

                from column in this.TableSchema
                where column.IsPrimaryKey == 0 && column.DataType != "timestamp"
                select
                GetUIElement(column)));

    this.DynamicContent.Content = XamlReader.Load(UI.CreateReader());

}

The error i get is in trying to create the Grid.Column. The exact error is
{“Der unbekannte Member \”Grid.Column\” kann nicht festgelegt werden.”}

so it doesn’t know the Grid.Column…

Anyone any ideas?

It works fine with the new XAttribute(“Grid.Column”, “1”), line commented out just doesn’t show what I want naturally!

The generated Grid looks like the following:

 <Grid xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="Grid1"   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="100*" />
    <ColumnDefinition Width="200*" />
  </Grid.ColumnDefinitions>
  <StackPanel Name="StackLabels" Margin="3">
    <Label Height="28" Name="NummerLabel" HorizontalContentAlignment="Right">Nummer</Label>    
  </StackPanel>
  <StackPanel Grid.Column="1" Name="StackFields" Margin="3">
    <TextBox Height="28" Name="txtNummer" Text="{Binding Path=Nummer}" />
    </StackPanel>
    </Grid>
  • 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-28T14:24:15+00:00Added an answer on May 28, 2026 at 2:24 pm

    Edit:

    It is reproducible. It seems there is some problem in the interaction of XamlReader.Load with the provided XmlReader. It throws XamlParseException “Cannot set unknown member ‘Grid.Column’.”

    Converting to string and loading XAML from it works, oddly:

    var xml = UI.ToString();
    var reader = XmlReader.Create(new StringReader(xml));
    var content = XamlReader.Load(reader); // works now.
    

    I see you’re creating XML markup only to convert it to UI objects. Why not simply create UI objects from the queries?

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

Sidebar

Related Questions

I have been trying to create an XML using the simplexml library (v2.6.2) http://simple.sourceforge.net/home.php
I'm trying to create a friendship association. I found and have been following the
EDIT: Database names have been modified for simplicity I'm trying to get some dynamic
I have been trying to create a web service out some python scripts, and
hi all i have been trying to create a soundboard for some time and
I have been trying to create a fairly simple application in WPF following the
I edited some mistakes and details... Well, I have been trying to create a
I have been trying to create a Main program that calls another program, sending
I have been trying to create a menu panel with jQuery that can be
I have been trying to create a new google custom search engine, but when

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.