Open Daoting opened 5 years ago
Thank you @Daoting for your report.
Typically I bind the Text property of TextBox using
<TextBox Text="{Binding FirstName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
Could you provide your code sample? (XAML and C# DataContext) It would help use understand and reproduce your issue.
xaml:
<dt:PageWin
x:Class="Dt.Sample.TestDemo1"
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"
mc:Ignorable="d"
xmlns:dt="using:Dt.Base">
<TextBox Text="{Binding Title}" />
</dt:PageWin>
Code:
public sealed partial class TestDemo1 : PageWin
{
public TestDemo1()
{
InitializeComponent();
DataContext = this;
}
}
Title's define:
public partial class PageWin : ContentControl, IWin
{
public readonly static DependencyProperty TitleProperty = DependencyProperty.Register(
"Title",
typeof(string),
typeof(PageWin),
new PropertyMetadata("No Title"));
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
}
It cannot load the ui that include text binding. Thanks @MatFillion .
There may be an issue with self-DataContext binding. Can you try with a sub-object, or using x:Bind
?
Yes, sub-object, ElementName, x:Bind are ok. Only self-DataContext binding.
I'm submitting a...
Current behavior
TextBox does not support text binding in iOS. UI is no response when include text binding.
<TextBox Text="{Binding Title}" />
Expected behavior
Minimal reproduction of the problem with instructions
Environment