Open valimaties opened 3 years ago
I think this may be a bug in the WPF designer, does it work when you run the application? If you are new to WPF sadly one thing to learn is that the designer is full of false warnings. Many developers disable it altogether and write xaml using text editor only.
Please report back if it works as intended when you run the app, if so I don't think there is much we can do about it.
Hi Johan.
It's not a warning, it's an error. I cannot compile. I use the latest VS preview version, if matters 🙁
I found a workaround, by using GotFocus
event, till I figure out what's going on.
PS: also, the designer crushes a lot... I will temporary delete this library to see if it is something wit it or it's from VS 🙁 very annoying
Try clone and build this: https://github.com/JohanLarsson/SelectOnFocusRepro I get some false errors but it builds and runs fine.
About how we can fix this it may be tricky if it is a bug in the designer.
I tried explicit fully qualified but still getting the error. xmlns:select="clr-namespace:Gu.Wpf.NumericInput.Select;assembly=Gu.Wpf.NumericInput"
One thing we could try is deprecate this API and add a new class
public static class Select
{
attached property AllOnKeyboardFocus
}
Changing class name could potentially make the designer less confused.
I tried your solution. Indeed, it work, as it compile and run app, but still get that strange error. Did you opened a ticked on Microsoft's developers community?
Thanks!
I did not open a ticket, if you feel like doing it feel free to use the repro linked above,
Hi. I'm a newbie in WPF. Can you tell me why VS it tells me that
SelectAllOnGotKeyboardFocus
is not recognized?My project is built as .Net 5 project. Does it matter? It does not tells me that is incompatible!
Thanks!