Binding textbox from one WPF window to another - wpf

I am unsure on how to bind the text in a textbox from one WPF window to another textbox in another window.
The premise is basically when I click the button on one WPF window after entering data in the textbox in that window, it should be visible in the WPF window which is being opened.
I would appreciate if someone could point me in the right direction :)

Related

wpf windows disappear when popup opened

first picture -before click the combobox
As the first picture shows,I have a child window which has lots of comboboxs.
second picture -after click the combobox
Once I click the combobox and the combobox popup opened,then the child window will disappear, as the second picture shows.
In my opinion,the child window behaviors like come behind the mainwindow, like its zindex has changed.
Can anyboby has a clue,thanks a lot.

Silverlight TextBox cant get focus

I have several controls in my silverlight view including telerik and my own controls(Custom controls).in this view there is a TextBox called AppointmentSubject which needs to be focused when i open this view.this textbox is also a custom control.I did following thing inside the View_Loaded method.
System.Windows.Browser.HtmlPage.Plugin.Focus();
//TextBoxName.Focus()
AppointmentSubject.Focus();
But AppointmentSubject only gets focused when i open the view second time.Any idea how i achieve it right first time?

disable all input controls in a WPF Window

Is there a way to make an entire WPF Window inert after a button click?
The window is invoked via Window.ShowDialog() and after use, the window is no longer needed for interaction but I leave it open to remind the user of the inputs in TextBox's, ListBox's, and give visual feedback via OxyPlot and so on. I leave it to the user to close the window manually.
One solution is to disable all buttons but that's tedious and it still leaves TextBox's functioning. That's not optimal because for anything to be functioning creates the wrong impression that the Window remains for anything other than looking at. It would be better for every control to be non-functioning by a single setting.
I did it by putting a name on the WPF window code behind and then setting .IsEnabled false upon the appropriate button click. All buttons, combo boxes, text boxes, and even OxyPlot became inert at that point and most parts were greyed out.
Consider creating a dedicated boolean dependency property in your code-behind or viewmodel and binding IsEnabled of every TextBox to the property.

WPF combobox in a dialog window - can not select items falling beyond height of window

I have a dialog window in WPF with a ComboBox. When the ComboBox items are more, they show beyond the height of the parent dialog window (in open state).
I am not able to select these items with the mouse (which are falling outside parent dialog window).
One possible solution is to increase height of the parent dialog window, but it doesn't look good.
Can someone help?
Try setting MaxDropDownHeightof your ComboBox
<ComboBox MaxDropDownHeight="100" />

WPF Mouse behavior when ComboBox is focused

When the WPF ComboBox is clicked and in-focus, the only interaction that occurs after that can be with the ComboBox. If anything else is interacted with, including the window functions (minimize, restore, close, resize) and any control in the window, the action is ignored and the ComboBox loses focus.
In addition, MouseEnter and MouseLeave on the window buttons are still active, but when MouseEnter on the window border(?) occurs, the mouse pointer does not change to the resize pointer. This behavior makes sense because of the ComboBox's use of the popup control. The popup control exists independently of the main visual tree and if i.e. the window moves or gets resized, the popup remains fixed floating above the main window.
I have tried using Reflector, to see what the ComboBox is doing, but I have not been able to find what I am looking for. Basically, I do not know if this behavior is coming from the window, the ComboBox, or if it has something to do with the popup. How can I solve this problem?
You're right on in your description there, the popup keeps all action focus until it itself loses focus. If you're trying to change the functionality of the ComboBox you may want to look at creating your own ControlTemplate that behaves differently and does not keep the default action of the popup control.
Hope this helps, not entirely sure what you're trying to do.
I know this question is old, but for anyone coming here looking for the answer, it is to use Mouse.Capture.
The ComboBox sets Mouse.Capture(comboBox, CaptureMode.SubTree) in OnIsDropDownOpenChanged. This ensures that all mouse events are captured by the ComboBox. When the Popup is closed Mouse.Capture(null) releases the mouse capture.

Resources