Wednesday, July 16, 2008

Pop up and tabs control in Expression Blend

I found this on the forum and thought it could be very helpful. Let me know if it is!
Hello,I have a question about the Popup. I don't see any object which is inside of the Popup control. Let's say if I have a grid with a few buttons inside a Popup, those objects would not be visible. Right now, my work around is that I comment out Popup tags temporarily (beginning and end separately) so I can see my grid with buttons, will do my changes and uncomment Popup tags, so I can test my application. The behavior of the Popup is exactly the same as the TabControl (see my other post about TabControl display problem). During the design time Popup content is not visible. On the run time everything shows properly.Is it a bug, or my Blend 2.5 is not installed properly?Thank you,Adam

Adam,If you select your Popup object in Objects and Timeline tree, see if the Width and Height values on the Layout palette are zero. If they are, click on the crossed-arrow buttons to the right of the Width and Height to set them to Auto. Now you should be able to see your Popup and the objects inside it. Let me know if that works for you.Jonathan [MSFT]

Pop up or drop down in silverlight 2.0 beta 2

It took me SO long to find out how to make this! I was lucky enough to have the help of Jeetendra from the Microsoft forum. Here is a link to the blend project so you can download it yourself and see how it works. It is easily customized and don't forget to ask any questions if needed!

Friday, July 11, 2008

ComboBox customize - and mouse states

So make a normal combobox (from the asset library). Now right click it and choose 'Edit Control Parts (Template)' and Edit Copy. Name it whatever you feel like. Now right click [ToggleButton].
and do the same. now there should be something called Chrome that is a ButtonChrome. you can either change the colors to your choce or if you are like me and want a round cornered button then you have to make 'Chrome' have invisible colors. Dont change the Opacity under the appearance panel. You have to choose every color that 'Chrome' has and change the 'A' to 0% (remember.. for every color stop it has). So now it is invisible. Now you double click the grid (in objects and timeline) then make a square. Make the square so it is a little larger than Chrome was so it can cover it completely. You might have to move the square behind any text that you had in the button. Now round the corners (of the square) as you want them. YAY! you have a customized combobox button! Hmmm but you want to have some sort of roll over effect right?

Here is how you give it some custom mouse states.

Stay where you are inside of the combobox. (or read the top and go back to where you were). Now add a timeline named MouseOver. Change the square to the color you want to see when the mouse is over the button. now make another timeline named MouseDown. Do the same. Ok now you want these to work. So look at your trigger pallet. Click on IsMouseOver=True. Press plus sign next to 'Actions when activating' . Now use the little drop down adn choose the timeline you just created named MouseOver. Keep the other part as 'Begin'. Now scroll down a little and do the same for 'Actions when Deactivating' but choose your timeline MouseOver and instead of Begin choose Stop. Try it out!! Your mouse over state should work great! Now you need to do the same for your MouseDown timeline except you need to add a property under the triggers pallett. change 'IsChecked' to IsPressed' and do the same as above except choose your timeline MouseDown. Then when you are done test it! YAY! Let me know if you have any questions or suggestions!