Refrehing the list or some other item in user control from child window is easy. All you need to do is wire up the child_closed event for child window and that s it. How about refreshing the list in another user control from this child window? There is no relation between the child window and the user control that we want to update. So, we cannot use child_closed event for that user control. Let s talk about the scenerio,
- Assigned Activites (User Control 1) , child window: CLM Activity
- Unassigned Activities (User Control 2)
- Activities ( User Control and it hosts UC1 and UC2)
What we want is, when we click ok button in "CLM Activity" child window, we will refresh UC1 and UC2.
- In Order to that,first, we ll define an event in assigned activities
- Then wire up this event to child window as follows. Child_Closed event is no longer need to be used
- Define OnPopupClosed event in assigned Activities user control. So, once the child window is closed, this event will be raised and Activities are refreshed in assigned activites screen.
- In Activities which is the host user control for the others, We ll wire up the same event handler for assigned activities.
- This event is also raised as well as OnPopupClosed event in Assigned Activities when the child windo is closed. RefreshSelf method refreshes the list in Unassigned Activities user control.
These are the steps to refresh the user control (unassigned activities ) from the other user control (assigned activities).
Exsilio Homepage | Software Development
Expression Blend is a powerful tool. It will write the necessary code for you. It is very easy to add mouse over behavior to any kind of control with silverlight. In the below example, Our goal is to add "MouseOver" and "MouseLeave" behavior to an image. Here are the steps;
1.Write click over the file that you want to add behavior and select "Open in Expression blend..."
2.In the "States" tab of Expression Blend, click on "add states group" icon to create a visual state of the control.
3.Give a name to Visual State Group and specify the Default Transition
4. Click on Add State icon right next to Visual state group that you ve created and give a name to the state. If you notice, VisualState state recording is on. What ever the style you apply on the image is recorded in this period. When you done styling the image (ex: making the border thicker, making it invisible etc.) click on Base at the top to finish.
5. At the end we ll have two states defined (NormalSearch, MouseOverSearch)
6.Switch to Assets tab and in the Behaviors menu select "Go to State Action"
7. Drag and drop "Go to state action" over the image that you want to add behavior
8.Do the same thing for imgExpandHover image.
9.When [GoToStateAction] for imgExpand is selected go to properties at right side of the screen and select "MouseEnter" for event name and "MouseOverSearch" for State Name
10. For imgExpandHover image,select "MouseLeave" as event name and "NormalSearch" for State Name
It will add all the necessary code automatically in .xaml file. We ve just created two states for two images. Initially, imgExpand is visible and imgExpandHover is invisible. In [GotoStateAction] part, events are defined for mouse enter and mouse leave behavior. What it does is, when you hover over the imgExpand, it ll be invisible and imgExpandHover image will be visible. When you do mouse leave from the image, imgExpand will be visible again and imgExpandHover will be invisible. imgExpandHover image has a border around it.So, when you mouse over the image you ll see that its border get thichker. That is basically what we wanted achieve.
Tags: Microsoft Expression Blend
Powered by Exsilio Solutions