Derik Whittaker

Syndication

News


Help my Slider control does not work inside a Grid in WP7

Ok, so I am trying to build out an UI where I use the <Slider> UX control to indicate passing time (this is for the Dimecasts.net WP7 application).  But the oddest thing happened, when I put the slider control onto my page it did not show up.  I thought maybe I was doing something wrong so I dropped the control onto a sample application and everything worked just fine... Odd

Here is the Xaml that I tried the first time around.

image

If you look towards the bottom of the Xaml you will see the Slider control.  This should work but it does not..odd.  Now when I put this into my sample application it worked just fine.  After looking at the code for a minute it dawned on me in my sample app I did not have the Slider in a grid.  So I put it into a grid and sure enough it stopped being visible again.  I did a bit of searching on bing and google but i could not find an answer.  So I turned to Twitter and sure enough I got a suggestion from @sirleamont (see below)

image

 

After the suggestion from @sirleamont I created the Xaml as below and surprise it worked :)

 

image

The only change I made is to wrap the Slider control inside a StackPanel.  Something still seems odd here, but hey it works.  If anyone knows exactly why this is the case please let me know.

Till next time,


Posted 12-27-2010 12:34 PM by Derik Whittaker

[Advertisement]

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)