Skip to content

2 IpField controls bound to same IpAddress string results in lost focus #1

Description

@zanderman112

Hi!

I am making an app that allows users to change settings for another piece of software.

We provide a section at the top of "most commonly changed settings" that we know will get modified often, however we then have different sections on the page for specific areas. An IP Address is one that will get changed often so we have 2 IpFields added in our xaml, one in the common section, and one in the "Communication" section.

Both of these IpField controls are bound to the same property in the viewmodel called IpAddress.

The bug is that when I am typing into one of the IpFields, as soon as I enter a character, the IpField I was typing in loses focus, and then both IpFields have the single character that I typed in them, but I cannot type further without clicking into the control again.

My relevant xaml looks something like this and any advice you might have for this is super helpful:

<UserControl d:DataContext="{d:DesignInstance Type=MyViewModel}">
   <Expander Name="CommonSettings">
       <IpField IpAddress={Binding IpAddress}/>
   </Expander
   
   <!-- This expander is a section specifically for communication related controls -->
   <Expander Name="CommunicationSettings">
         <!-- Notice I am binding to the same property as above on my view model-->
         <IpField IpAddress={Binding IpAddress}/>
         
         <!-- more controls related to communication -->
   </Expander
   
   <Expander Name="SomeMoreSettings">
       <!-- more controls -->
   </Expander
   <!-- 
           Note that there are MANY expanders here, and the common section above is meant to put a lot of the common settings 
           but that each individual section also has the settings as well
    -->
</UserControl>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions