Open hawkerm opened 3 years ago
Hello hawkerm, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
I am trying to reproduce the bug and I it seems to be working fine. I made a project with
MainPage.xaml
<Page
x:Class="Periscope.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="using:Periscope"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<controls:TokenizingTextBox ItemsSource="{x:Bind MyItems}"/>
</Page>
MainPage.xmal.cs
namespace Periscope
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
{
public ObservableCollection<string> MyItems { get; }
public MainPage()
{
MyItems = new ObservableCollection<string>()
{
"First",
"Second",
"Third"
};
this.InitializeComponent();
}
}
}
I seems to work fine.
I cant seem to get this bug to occur. I am not sure its still an issue.
Thanks @RosarioPulella, I'll move this to 7.1 then and see if I can check for differences in whatever setup I had.
Describe the bug
Can't set binding to the TokenizingTextBox
ItemsSource
in XAML directly. This seems to work in the sample app, but it's doing it from code-behind after the control has been loaded.Steps to Reproduce
Have an
ObservableCollection<string>
of items in my code. Then trying to bind it directly to the TokenizingTextBox:(Doesn't matter if OneWay or TwoWay.)
Fails on application launch.
Expected behavior
Able to bind to
ItemsSource
directly in XAML. It should pre-populate any items from the backing collection, and then any edits from the user should be seen in my backing collection as well.Environment
Additional context
I am swapping out my collection object depending on if I have values, so if I remove all initializations of my backing
ObservableCollection
then the app loads, but the control is disabled. Though sometimes I get: