CommunityToolkit / WindowsCommunityToolkit

The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation.
https://docs.microsoft.com/windows/communitytoolkit/
Other
5.88k stars 1.38k forks source link

Binding fails for TextBox with a Mask bound to the Text of another TextBox using Binding. #3514

Open Rosuavio opened 4 years ago

Rosuavio commented 4 years ago

Describe the bug

When a TextBox with a Mask is bound to the Text from another TextBox using Binding It does not load showing the target value.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Use Binding to bind the Text from a TextBox with a TextBoxMask.Mask to a TextBox's Text.
  2. Load a page or controls that has the two controls.
  3. See that the Text on the binding target did not update from source.

Expected behavior

The TextBox with the Mask loads with the Text from the source if it fits the mask.

Screenshots

image

Environment

NuGet Package(s): 
Microsoft.Toolkit.Uwp.UI 6.1.1
Package Version(s): 

Windows 10 Build Number:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [ ] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [ ] Insider Build (build number: )

App min and target version:
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [x] October 2018 Update (17763)
- [ ] May 2019 Update (18362)
- [x] May 2020 Update (19041)
- [ ] Insider Build (xxxxx)

Device form factor:
- [x] Desktop
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [ ] 2017 (version: )
- [x] 2019 (version: 16.7.5) 
- [ ] 2019 Preview (version: )

Additional context

Sample Code. Derived from https://github.com/windows-toolkit/WindowsCommunityToolkit/issues/3335#issuecomment-649725410

<Page
    x:Class="Periscoe.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Periscoe"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:extensions="using:Microsoft.Toolkit.Uwp.UI.Extensions"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <StackPanel Orientation="Horizontal" VerticalAlignment="Top">
        <TextBox
                x:Name="tbxSource"
                Text="10:20:30"
                Header="Source"
                />
        <AppBarSeparator VerticalAlignment="Center"/>
        <TextBox
                x:Name="tbxTarget"
                extensions:TextBoxMask.Mask="99:59:59"
                Header="Target"
                Text="{Binding Text, ElementName=tbxSource}"
                />
    </StackPanel>
</Page>
ghost commented 4 years ago

Hello RosarioPulella, 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 🙌

Rosuavio commented 3 years ago

We should check if this is still an issue. Also adding a test for this once #3580 is merged should help.