C#
C#

help

Root Question Message

Dawnbomb
Dawnbomb12/22/2022
WPF properties not defined - settings 'not supported'

i presume this is because in .net7 settings was moved out of properties and into solution explorer, but i don't know how to refer to it now. Help 😠
Alexicon
Alexicon12/22/2022
What you have is correct but I suspect based on your error messages you did not add the properties namespace in your xaml.

At the top of the xaml document you will see things like this:

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"


These are xaml namespaces, similar to using statements in C#. You need to add your properties namespace to this section like this:

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:{yourproject}.Properties"


just replace {yourproject} with whatever your projects namespace is.

You can find a working example of what this looks like here: https://github.com/AlexLexicon/Discord.Example.BindingSettings
Dawnbomb
Dawnbomb12/22/2022
WPF doesn't default to it's applications accessing it's own properties by default? ....i swear i'm trying to like wpf....i swear i'm trying to like wpf....
Dawnbomb
Dawnbomb12/22/2022
@263748259850223616 Now i get the name "Setting" does not exist, but...eh?
Dawnbomb
Dawnbomb12/22/2022
Alexicon
Alexicon12/22/2022
in your binding try Settings with an 's' at the end?
Dawnbomb
Dawnbomb12/22/2022
Didn't work, although im pretty sure its supposed to be looking for ColorMode
Dawnbomb
Dawnbomb12/22/2022
i just included Setting (now Settings) there to test incase
Alexicon
Alexicon12/22/2022
what part did you change?
Alexicon
Alexicon12/22/2022
You changed the source to "properties:Settings.Default"
Dawnbomb
Dawnbomb12/22/2022
oh
Dawnbomb
Dawnbomb12/22/2022
I didn't realize i had done that as i tested various things
Dawnbomb
Dawnbomb12/22/2022
but still errors
Dawnbomb
Dawnbomb12/22/2022
Dawnbomb
Dawnbomb12/22/2022
i now realize i was missing an s on both of them
Dawnbomb
Dawnbomb12/22/2022
so that wasn't from testing...fuk
Alexicon
Alexicon12/22/2022
your still getting that most recent error?
Dawnbomb
Dawnbomb12/22/2022
oh
Dawnbomb
Dawnbomb12/22/2022
i just had to build
Alexicon
Alexicon12/22/2022
: )
Dawnbomb
Dawnbomb12/22/2022
I will ask for more help another time surely, also oh boy is getting human help so much faster then 5 hours of google when you don't know what your looking for in the depths of code terms being so specific
Dawnbomb
Dawnbomb12/22/2022
but
Dawnbomb
Dawnbomb12/22/2022
thank you!!!
Dawnbomb
Dawnbomb12/22/2022
(I will close this post in a bit, just leaving it open to make sure you read the thank you)
Alexicon
Alexicon12/22/2022
no problem
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy