I have a ToggleButton. Whenever someone checks it, It will set a value to registry (regedit.exe) and If someone uncheck, It will remove the value.

Now, when I run the application again, I want to check whether the value is on the Registry or not so I make the ToggleButton Checked (If the value is there) or unchecked (If it's not there).

```
if (registry.GetValue("AppName") == null)
{
    Toggle.IsChecked = false;

}
else
{
   Toggle.IsChecked = true;
}

```

The problem here is that after checking and finding the value in registry, It wil put 'IsChecked' to true, and that will trigger 'Checked' and make it write in registry again.