L
L
lightman2014-09-19 21:49:01
Domain Name System
lightman, 2014-09-19 21:49:01

C# WPF - how could the control bind to the registry?

I got someone else's program written in WPF (I have not worked with this technology before).
It already had a Combobox, I added a Checkbox and quickly added saving / loading the state of both controls (SelectedIndex and Checked, respectively) to the registry using the standard methods RegistryKey.SetValue() and RegistryKey.GetValue()
Both values ​​are stored in one section ( "folder") of the registry, but in different keys.
Saving proceeds normally - the necessary values ​​\u200b\u200bare in the registry. But something strange happens when loading. When I assign Combobox.SelectedIndex = <value> then on the same line where (I go through the debugger) in the registry (!) the saving for another control (!) changes - if it was false, then it becomes true.
It seems that my controls are somehow attached to the registry, and to the same section.
Any ideas how this could be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aush, 2014-09-19
@aush

If you wish, you can write something like this.
Your description is completely insufficient to understand what the problem is. Try to reproduce the situation with a minimal example and show it. If you can’t make an example, try to gradually throw out everything irrelevant from your program until the effect starts to disappear and, again, post an example or at least the main pieces of code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question