Archive

Archives pour 08/2020

ToolTips with StringFormat when it’s don’t work

If you want bind a tooltip with value and have a StringFormat of a slider for exemple… the StringFormat is not apply (for tag or another property it’s the same behavior)
For solve it use this code

tag is set for see result

Categories: Non classé Tags:

ToolTip on moving thumb for slider

I try to find a solution for having in slider a tooltip moving under thumb when i drag it

after reading somes post like :https://stackoverflow.com/questions/1178134/wpf-adding-a-tooltip-to-the-track-of-a-slider
i think that restyle slider is not a good solution when you using already restyled slider as mahapp for example
and microsoft good explain for tooltip position : https://docs.microsoft.com/fr-fr/dotnet/framework/wpf/controls/how-to-position-a-tooltip

So i find a better solution (more simple) with an attached property

and using like this

we can find many improvment about this helper, but this is the first draft

Categories: Non classé Tags:

Draw lines at real pixel position

If you want to draw lines in OnRender function for sample, you have a antialiasing and you can’t have a real position (at pixel)

with this code (find in https://stackoverflow.com/questions/6018106/wpf-drawingcontext-seems-ignore-snaptodevicepixels) you can solve it

and code sample

 

 

Categories: Non classé Tags:

Converter is a Markup

If you want simplify your code it’s better to make a converter who is also a markup

Previous code for converter

Previous code for xaml

And new code for converter

and xaml 

see the difference

Categories: Non classé Tags: