✅ Abstract classes as the WPF DesignContext?
Does it matter if the value in
d:DesignContext="{d:DesignInstance Type=X}"
is an abstract
class. I can't get the WPF design to acknowledge my type. I know some of you guys have said not to rely on it, but it does help from time to time and I at least like the design context set. I've tried deleting the bin and obj folders for that project and restarting VS. Didn't help.
Then inside BestChat.Platform.Conversations.dll, we have BestChat.Platform.Conversations.AbstractConversation
. Those appear to match to me.
14 Replies
if you've tried it and it doesn't work, I'd have to say "yes, it matters"
In which case, the error should be the class was abstract.
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
Please remember I don't need design time data. Just making sure the property names are valid.
yeah, the syntax is fine
I use it myself, regularly
but yeah, doesn't work for abstract classes
oh
wait
no
@TeBeClone is right, the alternative syntax does work
use
{x:Type}
to do the type lookup
works fineI tried that.
then you're doing something else wrong
even works with an abstract generic
I now get intellisense on all the other bindings
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
Except I tried
d:DataContext="{d:DesignInstance Type={x:Type OurDataCtxt:AbstractConversation}}"
too.¯\_(ツ)_/¯
wOrKs On My MaChInE
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
.NET 7.0 in VS 2022?
this one's actually net6.0-windows
but it shouldn't matter
so long as it's .NET 5+
or was it 6 when WPF was added?
Well, I took the DesignInstance stuff out for now. I'm back to trying to resolve https://discord.com/channels/143867839282020352/1170760309410107473.
Discord
Discord - A New Way to Chat with Friends & Communities
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.