|
All these years I though I was good at WPF!
After a 2 year break (doing web dev at the moment) I am working on a WPF control (a menu and ribbon aggregate control). Obviously such control need good focus handling (focus scope, focus navigation, blab bla bla..)
To my horror I discover I suck at writing code handling focus!
Oh well, learning....
My latest bug.. my MenuItems can have whatever control as child control (to provide same experience as Office2013 popup, which look like hosting menu item and whatever), now the current show stopper is... my tab navigation stop on random control!
Why, Oh, why! I am doooooomed!
|
|
|
|
|
I've found that probnlems like this have one of two causes - either you're relying too much on the fram,ework to take care of you, or you're trying to hard to make the framekwork handle it all for you.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Yeah, well have to do some experimentation!
Never ever even used KeyboardNavigation attached property until now... so I guess I need to do some learning!
The problem is, my MenuItem navigate well (I handle OnKeyDown) but now if I plug, say a slider in the middle, I want the focus thing to still navigate nicely! Hooo!
Well... experimenting in progress...
|
|
|
|
|
The fact that you realize you suck is proof you don´t suck .
Most of us suck as well and DON´T realize it, which is far more dangerous.
|
|
|
|
|
|
Sounds like you have an element in there with an IsTabStop="true" that's capturing the focus and not releasing it. My suspicion is that you've got a TaControl in there that's displaying content with the tab stop set to true and this is capturing the tabbing behaviour.
|
|
|
|
|
My custom control is in a ContentPresenter.. mmm.. that makes me think I should look at the UI hierarchy in the nice newfangled WPF debugger tool! And look at those properties!
You gave me a good idea Peter!
|
|
|
|
|
And that would do it. It's not as though I do WPF pretty much every day after all.
|
|
|
|
|
I might go back to it, applied to a job in Brisbane!
BTW, the thing is in GitHub if you are bored:
http://github.com/superlloyd/MenuRibbon[^]
keyboard handling is pretty rough at the moment, but looks is alright, I reckon....
|
|
|
|
|
Cool. I'll download it and have a look.
|
|
|
|
|
It looks like you are right! I have an element with IsTabStop = true!
But, but.. why!!!
Anyhow thanks for the tip!
|
|
|
|
|
IsTabStop = true is the default value!
|
|
|
|
|
|
I wrote a menu for Silverlight and establishing focus/etc. was not an easy task.
Although I use the menu I don't consider to be good enough to publish.
I will offer this advice: Use the code unraveling tool (the name escapes me) that shows you the source code for successful controls. It is a great way to learn the MS way of doing things and it is an education in and of itself.
|
|
|
|
|
|
Super Lloyd wrote: To my horror I discover I suck at writing code Nah, that's just how WPF handles things.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Nah! I love WPF!
Of course it's imperfect and we love to complain about it.. but like democracy, everything else sucks more!
|
|
|
|
|
This is a very nice WebGL visualisation of Wikipedia (*).
http://wiki.polyfra.me/#[^]
(click on the "home" button to see the whole thing).
(*) only 100000 articles.
I'd rather be phishing!
|
|
|
|
|
Very nice indeed!
Nice share Maximilien!
|
|
|
|
|
Is there a way of finding out if those people/asteriods flying by are "hot chicks" and if so start a conversation with one of them? Lot's of asteroids floating around the Elvis star.
Nothing in help about hot chick asteroids.
Please advise.
Rage against the narrative.
|
|
|
|
|
No change (I still can't do anything with any of the programability components of the database), and ol' Mr. One Eye is getting tired, and starting to show significant wear.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Since you were in the military, you should be familiar with their general policies and procedures. To that extent, what you are experiencing shouldn't come as a surprise.
Furthermore, in the military, did they have requirements that certain qualifications be met BEFORE allowing personnel to perform particular duties? Even if an individual can show competence, without completing the required testing to confirm competence, restrictions may apply.
|
|
|
|
|
Hey Tim,
Got a notification for your reply to the LeBron thread, but you seem to have deleted it. Trying to be less controversial?
|
|
|
|
|
Probably a typo on my part... not enough caffeine. Someone seems to have edited it for me, which is fine in this case.
|
|
|
|
|
Looks like it was auto-marked as spam, and someone approved it.
|
|
|
|