user-controls

Can I update the value of a WPF binding from the C# code behind?

此生再无相见时 提交于 2020-12-25 02:03:55
问题 I’m learning C# and building a UI that reads and writes integers to an XML config file. The UI uses a variety of custom user controls. I have a 3 radiobutton user control that binds to a single int variable (control returns 0,1,2). The control uses an event to trigger the update. It looks at the 3 isChecked properties to determine the new int value. But I don’t know how to update the original binding value from the code behind. It's once removed so to speak because there are two binds..one in

Can I update the value of a WPF binding from the C# code behind?

99封情书 提交于 2020-12-25 01:59:49
问题 I’m learning C# and building a UI that reads and writes integers to an XML config file. The UI uses a variety of custom user controls. I have a 3 radiobutton user control that binds to a single int variable (control returns 0,1,2). The control uses an event to trigger the update. It looks at the 3 isChecked properties to determine the new int value. But I don’t know how to update the original binding value from the code behind. It's once removed so to speak because there are two binds..one in

Can I update the value of a WPF binding from the C# code behind?

牧云@^-^@ 提交于 2020-12-25 01:57:06
问题 I’m learning C# and building a UI that reads and writes integers to an XML config file. The UI uses a variety of custom user controls. I have a 3 radiobutton user control that binds to a single int variable (control returns 0,1,2). The control uses an event to trigger the update. It looks at the 3 isChecked properties to determine the new int value. But I don’t know how to update the original binding value from the code behind. It's once removed so to speak because there are two binds..one in

How to identify whether visibility of the control is changed by user or not?

十年热恋 提交于 2020-11-30 00:14:03
问题 My usercontrol inherits System.Windows.Forms.Control class. The following link describes the "Visible" property of control Control.Visible As per the above link, if control is present in inactive tab, then Control.Visible will return false even though we did not set it programmatically Question: How do I identify whether visibility was disabled by user or other controls? Note: I tried overriding the Visible property of Contorl but it's not overridable. Explanation If my control is present in

How to identify whether visibility of the control is changed by user or not?

懵懂的女人 提交于 2020-11-30 00:13:52
问题 My usercontrol inherits System.Windows.Forms.Control class. The following link describes the "Visible" property of control Control.Visible As per the above link, if control is present in inactive tab, then Control.Visible will return false even though we did not set it programmatically Question: How do I identify whether visibility was disabled by user or other controls? Note: I tried overriding the Visible property of Contorl but it's not overridable. Explanation If my control is present in

How to avoid EN_CHANGE notifications when sending WM_SETTEXT?

你。 提交于 2020-08-24 07:06:06
问题 I have a CEdit derived control that displays the string "N/A" when the undelying data is null. I recently added code to empty the control(SetWindowText("");) when it gains focus and set if back to "N/A"(SetWindowText("N/A")) when the focus is lost if the user left the control empty. The only problem is that setting the window text to "" or "N/A" triggers EN_CHANGE, so my dialog thinks that the data has changed. How can I avoid EN_CHANGE from being fired when calling SetWindowText (WM_SETTEXT)

Loading a WPF control embedded in a DLL in runtime

懵懂的女人 提交于 2020-08-23 09:11:17
问题 In my WPF project, I have a dll that contains several WPF UserControls. I would like, in runtime, to be able to check a parameter in the database (already implemented) and according to that parameter (which is a string) to be able to load a specific UserControl to my View. The UserControl is actually a Canvas, so it basically just places the correct Canvas on the View according to the database entry. I don't know if I was clear, so please ask me if you didn't understand the question. Thanks