Custom variantion wp7 slider - silverlight

How would you guys go about creating a slider where the thumb stays centered, but the image or background of the slider slides with a slide gesture.
The only real example I could find is here, in the second screenshot:
http://www.windowsphone.com/en-US/apps/5ffe35e4-8e43-e011-854c-00237de2db9e
Basically the slider "thumb" would stay in place, but the numbers on the scale move with a finger swipe.
Just looking for some direction here on how you would approach this. What control would you recommend I start with? Or would it be easier to create a custom control?

I haven't tried it but a slider might be too hard because of the way it is constructed; the area/scale that you want to slide consists of two repeat buttons and those do not easily slide. So it might be best to NOT use the slider because the code of the Slider class expects these template parts to be present.
I'd try with plain, templated control. The thumb is pure decoration. I'd add the 'scale' in a scrollview without scrollbars.

Related

Codename One Slider marker

I have some questions about sliders,
Im using a slider and i want a marker to be present on it like:
http://1.bp.blogspot.com/-HDNFnyRU2Cw/TcuMbBaL70I/AAAAAAAAAGc/7eWN1qnZbAw/s1600/seek.JPG
it draws the image at the bottom of the slider, not on top of it, searched for a setThumbImagePosition or something like that ,but didnt find it, is there a way to use sliders with markers on the top of them?(like the image shown)
Is there a way to show divisions on the slider?(for example this)
https://raw.githubusercontent.com/channguyen/range-slider-view/master/screenshots/sc.png
Whats the best practice to create thicker sliders?
Check out this post notice that in order to create the stars effect properly we wrap the slider in a flow layout to prevent it from growing. You can use background images just like we do in the stars slider but you need to place the slider in a flow layout of similar layout that doesn't let it grow beyond its preferred size.

Customize slider

I need to customize the appearance of the slider in order to use it in touchscreen mode. The slider's thumb needs to be 60 - 80 px high.
From all the suggestions around I understand that I will have to modify the slider's control template.
What I was wondering: where can I get the slider's control template? I want the slider to look the same as it does originally, just with a bigger thumb.
In Expression blend you can edit a copy of the original template , it's a good place to start for all control template modifications.
or you can search for the original template on the web :
Slider Tempalte and Style
You don't need Blend to edit a Template.
Right click your slider in VS Designer Edit Template -> Edit a copy..., go ahead and play with it. If you're familiar with XAML it should not take too long for you to get it right.
Just remember that WPF/WP is all about DPI independence. If you fix a Height and Width at a certain value, in some screens the control may look small/large!

Image glimmer or sparkle animation

I've been searching for awhile, but haven't been able to find anything. I'd like to be able to add kind of a glimmer or sparkly animation on an image element in wpf.
Essentially the effect here I'm after here is the same that you get with trading cards that are "foil's".
I'd like to have an image, and then be able to add this animation to it at will. I'm thinking maybe some kind of user control, or template possibly. Hopefully generic enough that I can just toss an image at it and it will just overlay the image and run.
Any ideas?
A simple construction that easily can be turned into a control is by nesting the image in a Grid and adding a second Grid (on top) as a sibling.
De second grid can be given a linear gradient brush that is primarily transparent but does contain a white glimmer.
This brush can be animated; you could move it and change the opacity of the grid/brush.
This way you do not change the image.

silverlight slider flow direction for vertical orientation

Is there a way to change the flow direction of the slider for the vertical orientation? If not, is there a way to change the background color to a color without it having that weird shaded effect? I want the bright color of the slider to be on top and the shaded portion to be on the bottom.
Thanks for all the great responses, but I ended up solving this one on my own. After much research, I finally discovered that I should edit the slider's template and that it can be easily done in Expression Blend. I found a pretty good tutorial for editing templates here. Once I started editing the template, I went to the vertical fill portion of the vertical slider and changed the transparency to 20% and changed the vertical track portion of the the vertical slider to 100%. This is where the shaded effect comes from. Then, I just switched the Fill properties for the vertical fill and the vertical track, so that the top part would be referenced by the slider's Foreground property and the bottom (now shaded part) would be referenced by the slider's Background property.

Silverlight 4: how to highlight control on mouse over

My aim is to get fine control "animation" when it is mouse-over-ed. For example, I have a "map" of controls (game map that represent different type of terrain), each of them is an image with trees/rocks/hills on the green grass or water (lake or see) image of blue/cyan color. When user point any image with mouse it should get shiny: either get more bright background or get a shiny border.
It is hard to say what exactly I want to have (either background change or border), I would like to try each of them and see what is the most appropriate for me.
I am going to have a custom control (MapTile) that will represent a map tile. I know how to catch MouseEnter/MouseLeave events, but not sure how to change control style and if it is a good idea to work with control style in CodeBehind, probably there are better XAML-based solutions.
Could you please help with a solution that provide few goals:
Goal1: Add highlighted border around the control (it will be squares/rectangles, or circles; use what is easier) on mouse enter, remove border on move leave;
Goal2: Change some properties of my CustomControl (for example, background color).
Thank you very much!
1. How to han
You might find it easiest to get hold of Expression Blend and use it to create a custom template for your control.
The Learn Expression Blend page would be a good place to start. Look for tutorials on customising buttons and this is the same sort of thing that you want to do.
You need to use an attached behavior on your control. You don't need to learn Blend for this.
Check this one as an example, but you can search the site for Mouse Over for other examples.
http://gallery.expression.microsoft.com/en-us/MouseOver3D

Resources