I have an application (WPF using C#) that I'm working on where I have a login window that is opened first (Set as the StartUri). Once the user clicks on the PasswordBox, a new window appears that contains numeric buttons for entering the numeric password (it's going to be a touchscreen application). The data entered then is added to an Array List. Once the User clicks OK, the password they entered needs to show up in the login window that was first opened. I need to do this without opening a new login window s开发者_Python百科ince the login window will still be running in the background. Is there an easy way to access the login windows PasswordBox and add the Array List to it? These windows are both part of the same namespace.
Can both windows use the same ViewModel or DataContext? Then you could just bind both controls to the same field
<myControls:NumericPasswordEntryControl
DataContext="{Binding ElementName=MyLoginWindow, Path=DataContext}" />
精彩评论