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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:52:22+00:00 2026-06-16T01:52:22+00:00

I wrote simple XAML file: <Window xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006 xmlns:d=http://schemas.microsoft.com/expression/blend/2008 mc:Ignorable=d d:DesignHeight=400 d:DesignWidth=250 WindowStartupLocation=CenterScreen

  • 0

I wrote simple XAML file:

<Window      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="400" d:DesignWidth="250"
             WindowStartupLocation="CenterScreen"
             ResizeMode="NoResize" Title="Окошко" Width="250" Height="400">
    <Grid>
        <!--Настраиваем сетку-->
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <!--Теперь по сетке раскидываем контролы-->
        <GroupBox x:Name="listTitle" x:FieldModifier="public" Header="Список элементов:" Margin="5"
                  Padding="5">
            <!--В объекте ListBox указываем, что источником данных для элементов
            списка следует использовать свойство DataContext родительского элемента-->
            <ListBox x:Name="listbox" x:FieldModifier="public"
                     ItemsSource="{Binding}" SelectionMode="Multiple">
                <!--Шаблон отображения элементов списка-->
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <!--Указываем, что каждый элемент следует отображать
                        в виде текста, который должен считываться из свойства "Value"-->
                        <TextBlock Text="{Binding Path=Value}"/>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </GroupBox>
        <GroupBox Header="Примечание:" Grid.Row="1" Margin="5" Padding="5">
            <TextBlock x:Name="txtNotes" x:FieldModifier="public" TextWrapping="Wrap"/>
        </GroupBox>
        <StackPanel Orientation="Horizontal" Grid.Row="2"
                    HorizontalAlignment="Right">
            <Button x:Name="btnAccept" x:FieldModifier="public" Margin="5"
                    Padding="5" IsDefault="True">Принять</Button>
            <Button x:Name="btnExit" x:FieldModifier="public" Margin="5"
                    Padding="5" IsCancel="True">Выход</Button>
        </StackPanel>
    </Grid>
</Window>

It is simple window:

enter image description here

I parse this in my code:

using (io.FileStream fs = new io.FileStream(fileFullName, io.FileMode.Open)) {
    depObj = XamlReader.Load(fs) as DependencyObject;
    fs.Close();
}

It works fine in .NET 4.0, but in .NET 3.5 SP1 I get exception:

System.Windows.Markup.XamlParseException occurred
Message=The attribute ‘FieldModifier’ does not exist in XML namespace
‘http://schemas.microsoft.com/winfx/2006/xaml‘. Line ’17’ Position
’38’.

Why does this happen?

  • 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-06-16T01:52:23+00:00Added an answer on June 16, 2026 at 1:52 am

    Well, it shouldn’t work in .NET 4 either, but apparently the parser is being “nice” to you by ignoring your error of using x:FieldModifier.

    According to the MSDN documentation, then you must also have an x:Class directive.

    If a XAML production uses x:FieldModifier anywhere, the root element
    of that XAML production must declare an x:Class Directive.

    Using the x:FieldModifier makes no sense if you’re not declaring a class/codebehind file and are loading the XAML dynamically.

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

Sidebar

Related Questions

I wrote a simple XML file and a DTD file including an entity, but
i wrote simple 3 functions to scrape titles , description and keywords of simple
I wrote simple class that on the start it just increase the value of
I wrote simple load testing tool for testing performance of Java modules. One problem
I wrote a simple function, that makes emacs add matching quotes (so when I
I wrote a simple plugin which sets some css code using wp_options. It all
I wrote a simple test program for opencv to see if it's working after
I wrote a simple code to capture the netdevice notifications and simply print their
I wrote a simple C program: #include <unistd.h> #include <stdio.h> int main( int argc,
I wrote a simple javascript function to display a progressbar with the help of

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.