Skip to content

Unable to bind to TokenizingTextBox SelectedItems #4712

Open
@lukedukeus

Description

@lukedukeus

Describe the problem

I have a TokenizingTextBox control that I would like to bind to like this:
Page.xaml:

                <controls:TokenizingTextBox
                    SelectedItems="{x:Bind Viewmodel.SelectedItems, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                    TokenDelimiter=","/>

PageViewModel.cs:

public List<string> SelectedItems {get; set;} = new List<string>();

However this is not possible because SelectedItems is not a dependency property, and you can only access it in the code behind.

Describe the solution

I'm not sure. That's why I'm asking here. Right now, the way I am doing it is by manually updating the variable in the code behind on the focus lost event.

Alternatives

No response

Additional info

No response

Help us help you

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions