I found this on the forum and thought it could be very helpful. Let me know if it is!
QUESTION:
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
ANSWER:
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]
Wednesday, July 16, 2008
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!
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!
Thursday, May 22, 2008
Sliding / Scrolling Viewer
Thanks to WilliamStacey over at the Blend Forum for help on this:
Make a StackPanel inside a ScrollViewer. Make the StackPanel layout horizontal and add your pictures or icons or whatever you want! Size it to view all (Auto for W and H). Set your ScrollViewer to Horizontal scrollbar and remove Vertical scrollbar. You could add your own custom buttons below to scroll using events.
There is also a ButtonGallary sample in Blend 2 (under Help/WelcomeScreen) that could be what your looking.
Make a StackPanel inside a ScrollViewer. Make the StackPanel layout horizontal and add your pictures or icons or whatever you want! Size it to view all (Auto for W and H). Set your ScrollViewer to Horizontal scrollbar and remove Vertical scrollbar. You could add your own custom buttons below to scroll using events.
There is also a ButtonGallary sample in Blend 2 (under Help/WelcomeScreen) that could be what your looking.
Friday, April 11, 2008
How to Make Buttons in Silverlight 2.0
Yes.. it is very very annoying when you are a designer and you use silverlight 2.0 in blend.. why? NO CUSTOM BUTTONS! Well.. now I will teach you how through code. No.. its not as hard as it seems.. it is quite easy! Its just hard when you ask a coder because they talk like they are from mars. But I am an earthling so here it is in earthling designer terms:
Make a new silverlight 2.0 application and name it 'SilverlightApplication4'
So lets say you want to make 2 buttons. draw 2 different squares in blend.
Name them! Name one 'rectangle' and the other 'rectangle1'. It is very important you name them.
ok now you need to make the states for the rectangle button. make these different timelines:
'rectangleMouseOver' 'rectangleMouseDown' 'rectangleMouseUp'
in each timeline make the rectangle a different color. lets say.. in one timeline red.. the other green.. and the last purple.
Now you need to make the states for the other btn 'rectangle1'. So do the same thing except name the timelines 'rectangle1MouseOver' 'rectangle1MouseDown' 'rectangle1MouseUp' change the colors like before.
ok now its time for the scary dreaded code! First you need to right click 'rectangle' and view xaml.
Now put this code in right after x:Name="rectangle"
MouseEnter="rectangle_MouseEnter" MouseLeave="rectangle_MouseLeave" MouseLeftButtonDown="rectangle_MouseLeftButtonDown" MouseLeftButtonUp="rectangle_MouseLeftButtonUp"
Now do the same for the other btn "rectangle1" except when you copy the code in you need to make it say "rectangle1" = whatever... not "rectangle" = whatever.
Ok now on to the last coding.
Click on the project tab in the upper right of blend. find where it says page.xaml and click on the little arrow next to it to drop down the list. You should see Page.xaml.cs. Double click it.
Ok now you need to make that code look like this:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SilverlightApplication4
{
public partial class Page : UserControl
{
public Page()
{
// Required to initialize variables
InitializeComponent();
}
private void rectangle_MouseEnter(object sender, MouseEventArgs e)
{
this.MouseOver.Begin();
}
private void rectangle_MouseLeave(object sender, MouseEventArgs e)
{
this.MouseLeave.Begin();
}
private void rectangle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.MouseDown.Begin();
}
private void rectangle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
this.MouseUp.Begin();
}
}
}
That will make your first rectangle work!
Now to make the second one work please findthe last part that says:
private void rectangle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e){this.MouseUp.Begin();}
But before the last 2 "}}"
Add in this code:
private void rectangle1_MouseEnter(object sender, MouseEventArgs e){this.MouseOver.Begin();}private void rectangle1_MouseLeave(object sender, MouseEventArgs e){this.MouseLeave.Begin();}private void rectangle1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e){this.MouseDown.Begin();}private void rectangle1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e){this.MouseUp.Begin();}
There you go.. if anyone has any problems please let me know!
Make a new silverlight 2.0 application and name it 'SilverlightApplication4'
So lets say you want to make 2 buttons. draw 2 different squares in blend.
Name them! Name one 'rectangle' and the other 'rectangle1'. It is very important you name them.
ok now you need to make the states for the rectangle button. make these different timelines:
'rectangleMouseOver' 'rectangleMouseDown' 'rectangleMouseUp'
in each timeline make the rectangle a different color. lets say.. in one timeline red.. the other green.. and the last purple.
Now you need to make the states for the other btn 'rectangle1'. So do the same thing except name the timelines 'rectangle1MouseOver' 'rectangle1MouseDown' 'rectangle1MouseUp' change the colors like before.
ok now its time for the scary dreaded code! First you need to right click 'rectangle' and view xaml.
Now put this code in right after x:Name="rectangle"
MouseEnter="rectangle_MouseEnter" MouseLeave="rectangle_MouseLeave" MouseLeftButtonDown="rectangle_MouseLeftButtonDown" MouseLeftButtonUp="rectangle_MouseLeftButtonUp"
Now do the same for the other btn "rectangle1" except when you copy the code in you need to make it say "rectangle1" = whatever... not "rectangle" = whatever.
Ok now on to the last coding.
Click on the project tab in the upper right of blend. find where it says page.xaml and click on the little arrow next to it to drop down the list. You should see Page.xaml.cs. Double click it.
Ok now you need to make that code look like this:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace SilverlightApplication4
{
public partial class Page : UserControl
{
public Page()
{
// Required to initialize variables
InitializeComponent();
}
private void rectangle_MouseEnter(object sender, MouseEventArgs e)
{
this.MouseOver.Begin();
}
private void rectangle_MouseLeave(object sender, MouseEventArgs e)
{
this.MouseLeave.Begin();
}
private void rectangle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.MouseDown.Begin();
}
private void rectangle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
this.MouseUp.Begin();
}
}
}
That will make your first rectangle work!
Now to make the second one work please findthe last part that says:
private void rectangle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e){this.MouseUp.Begin();}
But before the last 2 "}}"
Add in this code:
private void rectangle1_MouseEnter(object sender, MouseEventArgs e){this.MouseOver.Begin();}private void rectangle1_MouseLeave(object sender, MouseEventArgs e){this.MouseLeave.Begin();}private void rectangle1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e){this.MouseDown.Begin();}private void rectangle1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e){this.MouseUp.Begin();}
There you go.. if anyone has any problems please let me know!
Tuesday, March 18, 2008
Creating a Frame to host other websites
This is a tutorial to show you how to make a frame in blend. Create a rectangle the size you would like your new frame. Right click the rectangle and view XAML. type the following ABOVE the rectangle tag/code :
*Frame Source="http://www.google.com"/*
JUST REMEMBER: dont use '*' like I did.. use '<' and '>' in their place. I had to use * so the code would show up for you in blogger.
*Frame Source="http://www.google.com"/*
JUST REMEMBER: dont use '*' like I did.. use '<' and '>' in their place. I had to use * so the code would show up for you in blogger.
expandable control with window
Do you have a user control in your project that just wont expand with the window(when tested)?
Then here is what you do:
First click on the control in your project and make sure it is set to stretch and also auto. Now if that does not work go open up your user control and check if the user control and layout root are set to stretch and Auto.
that should do it! ;)
Then here is what you do:
First click on the control in your project and make sure it is set to stretch and also auto. Now if that does not work go open up your user control and check if the user control and layout root are set to stretch and Auto.
that should do it! ;)
Thursday, December 6, 2007
Loop a timeline - repeat timeline
Need to know how to loop a timeline in expression blend? Here is how!
in the objects and timeline click the arrow next to the object you are animating. If there is something in the drop down with another arrow click it.. repeat! The ones that do not have arrows you will be able to right click them and set the repeat count to whatever you want. There is a little icon when you set the repeat count that will let you set it to infinite if needed.
in the objects and timeline click the arrow next to the object you are animating. If there is something in the drop down with another arrow click it.. repeat! The ones that do not have arrows you will be able to right click them and set the repeat count to whatever you want. There is a little icon when you set the repeat count that will let you set it to infinite if needed.
Wednesday, November 28, 2007
How to center a control or object within a grid within the page
I have a grid with a control in it. I want the control ( or object ) to be centered in the grid when the window is expanded. This is how I did it:
The grid
Width is set to : Auto
Height to: 705.5 (yours will be different, it is whatever you want/need)
Row 1
Row Span 1
Column 0
ColumnSpan 2
Horizontal Alignment Center
Vertical Alignment Center
Margin
<--172.176
-->2.131
(up)10
(dwn)-22.5
My control :
Width 533
Height 600
Row 0
Row Span 1
Column 0
Column Span 1
Horizontal Alignment Stretch
Vertical Alignment Stretch
Margin
<--41.25
-->48.75
(up3.25
(dwn)102.25
The grid
Width is set to : Auto
Height to: 705.5 (yours will be different, it is whatever you want/need)
Row 1
Row Span 1
Column 0
ColumnSpan 2
Horizontal Alignment Center
Vertical Alignment Center
Margin
<--172.176
-->2.131
(up)10
(dwn)-22.5
My control :
Width 533
Height 600
Row 0
Row Span 1
Column 0
Column Span 1
Horizontal Alignment Stretch
Vertical Alignment Stretch
Margin
<--41.25
-->48.75
(up3.25
(dwn)102.25
Friday, October 26, 2007
timeline does not automatically play. Stop Timeline
Took me a long time to figure this one out!
When you create a new timeline, Blend creates by default an Event trigger which starts the animation when the scene is loaded.
Here is how you can delete it:-
open the Triggers palette- select the "Window.Loaded" event; (the bottom area of the palette will show all the actions for the "Window.Loaded" Event trigger)- click on the "-Trigger" button
In a similar way you can add an Event Trigger to start the animation when the button is clicked:- create the button- select the button- click on "+ Event"- select "button" in the first field (when button) and Click in the second field (in the end it will say: When button.Click is raised)- click on the "+" button- select Storyboard1.Begin as the action
You may also start the animation from code if you want: - add an Event in the property inspector OnButtonClick to the button - insert the following code (replace Storyboard1 with the name of your storyboard private void OnButtonClick(object sender, RoutedEventArgs e) { Storyboard storyboard = this.FindResource("Storyboard1") as Storyboard; storyboard.Begin(this); }
Thanks Adrian! You helped out a ton!
When you create a new timeline, Blend creates by default an Event trigger which starts the animation when the scene is loaded.
Here is how you can delete it:-
open the Triggers palette- select the "Window.Loaded" event; (the bottom area of the palette will show all the actions for the "Window.Loaded" Event trigger)- click on the "-Trigger" button
In a similar way you can add an Event Trigger to start the animation when the button is clicked:- create the button- select the button- click on "+ Event"- select "button" in the first field (when button) and Click in the second field (in the end it will say: When button.Click is raised)- click on the "+" button- select Storyboard1.Begin as the action
You may also start the animation from code if you want: - add an Event in the property inspector OnButtonClick to the button - insert the following code (replace Storyboard1 with the name of your storyboard private void OnButtonClick(object sender, RoutedEventArgs e) { Storyboard storyboard = this.FindResource("Storyboard1") as Storyboard; storyboard.Begin(this); }
Thanks Adrian! You helped out a ton!
Thursday, October 18, 2007
Slider binded to text block with NO DECIMALS!
put this:
IsSnapToTickEnabled="True"
into your XAML for the slider
(right click the slider and click view XAML.. then put that into the part of XAML for the slider)
Works great.. no decimals or extra numbers!
Expression Blend
IsSnapToTickEnabled="True"
into your XAML for the slider
(right click the slider and click view XAML.. then put that into the part of XAML for the slider)
Works great.. no decimals or extra numbers!
Expression Blend
Monday, October 15, 2007
Flash in blend
here is the only tutorial I have ran across so far that teaches how to put flash in blend (by making a flash player)
http://blogs.msdn.com/jijia/archive/2007/06/07/wpf-flash-activex.aspx
Its in another language but there is a ton of pictures and a tiny bit of english.. good luck!
http://blogs.msdn.com/jijia/archive/2007/06/07/wpf-flash-activex.aspx
Its in another language but there is a ton of pictures and a tiny bit of english.. good luck!
Slider that changes text block value
1. Make a slider (in the asset library) and name it "mySlider"
2. Make a text block name it "myTextBlock"
3. Click the small square in common properties tab next to text field
4.In the context menu, click Data Binding.
5.The Create Data Binding dialog box appears. On the Element Property tab, choose the mySlider (in the Scene elements column).
6.In the column to the right, choose the property Value.
7.Click Finish. An orange border appears around the text box of the property that has been bound
Im working on figuring out how to make it not use decimals
2. Make a text block name it "myTextBlock"
3. Click the small square in common properties tab next to text field
4.In the context menu, click Data Binding.
5.The Create Data Binding dialog box appears. On the Element Property tab, choose the mySlider (in the Scene elements column).
6.In the column to the right, choose the property Value.
7.Click Finish. An orange border appears around the text box of the property that has been bound
Im working on figuring out how to make it not use decimals
Monday, October 1, 2007
TimeLine Changes
Here is something very important I learned today about timelines by reading the user guide:
Ease In The ease in value modifies how the property value changes as time approaches the keyframe. You can set the degree of ease by specifying a value between 0% (no ease) and 100% (full ease, which is half the time distance between the previous keyframe and the edited keyframe).
Ease Out The ease out value modifies how the property values changes as time moves away from the keyframe. You can set the degree of ease by specifying a value between 0% (no ease) and 100% (full ease, which is half the time distance between the edited keyframe and the next keyframe).
Hold Out Hold out doesn’t interpolate changes over time; rather it makes an abrupt change to the new property value when the play head reaches the keyframe where the change occurs.
Linear Linear interpolation changes the property value in equal increments between the keyframes. The interpolation between two keyframes will be linear if the Ease Out value is 0% for the first keyframe and the Ease In value is 0% for the second keyframe.
You can modify keyframe interpolation values by right-clicking a keyframe on the timeline.
What I was trying to figure out was how to make a little icon stop changing inbetween frames. For example I have a picture of a cloud on frame 1 and would like it to be invisible on frame 5. my problem was on frames 2 to 4 it would slowly change to invisible instead of only changing on frame 5 to invisible all of a sudden like I wanted it to. So what I found the solution to be was on the keyframe(white circle thing) before the keyframe of the change I had to right click it and click on "hold out". Which makes nothing happen UNTIL frame 5 like I wanted. sheesh! Just remember to right click the key frame before instead of the keyframe you wanted the abrupt change on. Make sense?
Ease In The ease in value modifies how the property value changes as time approaches the keyframe. You can set the degree of ease by specifying a value between 0% (no ease) and 100% (full ease, which is half the time distance between the previous keyframe and the edited keyframe).
Ease Out The ease out value modifies how the property values changes as time moves away from the keyframe. You can set the degree of ease by specifying a value between 0% (no ease) and 100% (full ease, which is half the time distance between the edited keyframe and the next keyframe).
Hold Out Hold out doesn’t interpolate changes over time; rather it makes an abrupt change to the new property value when the play head reaches the keyframe where the change occurs.
Linear Linear interpolation changes the property value in equal increments between the keyframes. The interpolation between two keyframes will be linear if the Ease Out value is 0% for the first keyframe and the Ease In value is 0% for the second keyframe.
You can modify keyframe interpolation values by right-clicking a keyframe on the timeline.
What I was trying to figure out was how to make a little icon stop changing inbetween frames. For example I have a picture of a cloud on frame 1 and would like it to be invisible on frame 5. my problem was on frames 2 to 4 it would slowly change to invisible instead of only changing on frame 5 to invisible all of a sudden like I wanted it to. So what I found the solution to be was on the keyframe(white circle thing) before the keyframe of the change I had to right click it and click on "hold out". Which makes nothing happen UNTIL frame 5 like I wanted. sheesh! Just remember to right click the key frame before instead of the keyframe you wanted the abrupt change on. Make sense?
Sunday, September 30, 2007
Another Link
www.learnexpressionstudio.com
Another great site too learn Expression Blend! I hear they have video tutorials
Another great site too learn Expression Blend! I hear they have video tutorials
Tuesday, September 18, 2007
Mouse Over text color change
This is what Fred told me over at the expression forum.. thanks a ton!
If you want to change the color when the mouse is over the combobox, you need the IsMouseOver event.Click on the +Property button in the triggers panel and a new trigger is added. Choose the IsMouseOver event from the list, and change the foreground color.
Or as we say in xaml...
A nice tool to help you with editing styles and templates is called ShowMeTheTemplate. You can download it from http://www.sellsbrothers.com/tools/.This program shows you the content of every component.
Saturday, September 15, 2007
combo box pop up color change
To change the color of the text in the pop up list thingy of your cobobox: find the combobox in your objectsAndTimeline... press the little arrow next to it.. choose the words you would like to change the coor of.. change the color in properties! YAY!
Change text color of combobox button when pressed
To change a combo box text color when it is pressed:
Go into the template of the combobox, into template of [toggle button], find your text block (if it is a content presenter change it to a text block instead) and look at the interaction,triggers panel.. find the trigger that says "IsChecked=True". Click it so it will then be recording... now change the color of your text block under properties.. TAADAAA!!! Test it out!!
Im working on how to change the rollover color as well instead of just the click color change...
Go into the template of the combobox, into template of [toggle button], find your text block (if it is a content presenter change it to a text block instead) and look at the interaction,triggers panel.. find the trigger that says "IsChecked=True". Click it so it will then be recording... now change the color of your text block under properties.. TAADAAA!!! Test it out!!
Im working on how to change the rollover color as well instead of just the click color change...
Friday, September 14, 2007
Subscribe to:
Posts (Atom)