當平臺為AnyCPU和X86的時候都是正常的。
X64:

X86或AnyCPU:

<Window x:Class="CefTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CefTest"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.DataContext>
<local:TestM/>
</Window.DataContext>
<Grid>
<Button Click="Button_Click" Width="200" Height="100" Margin="141,90,451,229" Content="{Binding TextStr}"/>
<TextBox Width="200" Height="400" TextWrapping="Wrap" x:Name="textb1" Text="{Binding TextStr}"/>
<ContentControl x:Name="mainf">
</ContentControl>
<Button Click="Button_Click1" Width="200" Height="100" Margin="441,229,151,90" Content="{Binding TextStr}"/>
</Grid>
</Window>
public class TestM : INotifyPropertyChanged
{
private string _tes = "123123123123";
public TestM() { }
public string TextStr
{
get => _tes;
set
{
if (_tes != value)
{
_tes = value;
RaisePropertyChanged();
}
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/41609.html
標籤:C#
上一篇:vs2012 開發語言 vb ,資料系結 GridView,運行報錯。這段代碼應該怎么寫GridView才能顯示資料?
