X: FieldModifier not valid for C # language?

When I apply x: FieldModifier to my WPF control, for example:

<TextBox x:Name="textBox1" x:FieldModifier="Public"/>

visual studio (in 2008 and 2010) raises the following error:

x: FieldModifier is not valid for C # language

How can I solve this problem?

Edit: Sorry, I want to make it public ...

+3
source share
2 answers

use lowercase 'public' not 'Public'

<Window x:Class="WpfApplication1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="350" Width="525">
<Grid>
    <TextBox Name="TEst" x:FieldModifier="public" Text="nothing" />
</Grid>

+6
source

Do you really want to FieldModifier? What happens if you do not turn it on?

From the documentation :

x: FieldModifier . XAML, XAML, XAML, , . , . , , , , , , , , , ..

+2

Source: https://habr.com/ru/post/1793909/


All Articles