<!-- Please be sure to read the
[Contribute](https://github.com/reactiveui/reactiveui#contribute)
section of the README -->
**What kind of change does this PR introduce?**
<!-- Bug fix, feature, docs update, ... -->
This PR fixes winforms designer serialization of `ViewModelControlHost`
and `RoutedControlHost` in `ReactiveUI.WinForms`.
**What is the current behavior?**
<!-- You can also link to an open issue here. -->
`DesignerSerializationVisibility.Content` causes multiple issues:
* `The object 'viewModelControlHost1' returned null for the property
'ViewModel' but this is not allowed` when trying to save (observed on
`net481`).
* Setting `DefaultContent` in the designer produces code that does not
compile (observed on `net10.0-windows10.0.19041.0`).
There are similar issues with other properties.
The attribute also makes no sense on `DefaultCacheViewsEnabled`, because
it's a static property.
**What is the new behavior?**
<!-- If this is a feature change -->
Just turn off serialization for non-primitive properties.
This also makes things consistent with `ReactiveUserControl.ViewModel`.
Drop the attribute on `DefaultCacheViewsEnabled`.
**What might this PR break?**
This shouldn't break anything, the serialization did not work.
**Please check if the PR fulfills these requirements**
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
**Other information**:
Manual testing was performed on `net481` and
`net10.0-windows10.0.19041.0`.
`DesignerSerializationVisibility.Content` was introduced in #3933,
probably because of a new analyzer error (`WFO1000`).
Before that change the properties defaulted to
`DesignerSerializationVisibility.Visible`, but that did not make sense
either.
The only property that could actually be set in the designer was
`DefaultContent`, but doing that resulted in a fatal
`ObjectDisposedException` when trying to reopen the designer.
Co-authored-by: Chris Pulman <chris.pulman@yahoo.com>