Will Pittenger
✅ How to deserialize JSON in .NET when my base class is generic?
I've been reconfiguring the code to evaluate the
JsonElement
s myself. The simple deserialization couldn't handle the complex nature of what I was loading. The more I looked at it, I needed more data types. (ClientEventInfo
isn't that complex.) So some of the other event info classes will be only abstract
so derived types can add more fields. I'll start with a Type
enum to decide which abstract
base class is involved. Each of those declares a series of subtypes as more enums. Eventually, I'll know the correct type.14 replies
❔ ✅ WPF Class derivation where both classes have XAML pages
Well, it didn't work. I ran into an error specifically for this situation. https://learn.microsoft.com/en-us/troubleshoot/developer/dotnet/framework/general/error-mc6017-define-class-xaml
5 replies
✅ WPF Custom control should have contents as DockPanel, but it shows up at runtime as ScrollViewer
As is, I put a
Ctnts
property into the abstract
class and mapped it to the ScrollViewer
's Content
property. I may simply change that so there's a panel that's hidden unless it receives content. What I called Ctnts
would be renamed Hdr
and mapped to the new panel's Content
property.9 replies
✅ WPF Custom control should have contents as DockPanel, but it shows up at runtime as ScrollViewer
I finally figured out what was going on. A couple months ago,, I wrote a base class (that I derived from a couple times) that created the
ScrollViewer
. I found it by searching for "ScrollViewer" in my files. Until a few hours ago, I was thinking it would appear only in a XAML file. But this was in a class that didn't have a XAML as it was abstract
and I was going to have the derived class provide the XAML. But for some strange reason I don't remember, I put the ScrollViewer
in the CS file's OnInitialized
which promptly erased the contents from the XAML. In some situations, I'll want all views to have a ScrollViewer
as the content of the window with its content provided provided by an implementation. But in this situation, the derived class will be providing what you could think of as the "non-client" area never mind this isn't a Window
. Basically, some versions will be adding a bar along the top. At least I know what was going on. I'm considering moving things around a bit.9 replies
✅ WPF Custom control should have contents as DockPanel, but it shows up at runtime as ScrollViewer
Well, the code runs just fine. Took two
ItemsControl
instances each needing a Template Selector. However, I still have the Live Property Explorer reporting the contents of my user control is a ScrollViewer
rather than a DockPanel
. The problem is I'm trying to figure out why the controls I was adding on the fly (now done with the ItemsControl
weren't showing up.9 replies
✅ Abstract classes as the WPF DesignContext?
Well, I took the DesignInstance stuff out for now. I'm back to trying to resolve https://discord.com/channels/143867839282020352/1170760309410107473.
34 replies