In this article I will show you how you can show movie clip when popping up tool tip.You can use this when create Explorer kind of UI and want to preview movies inside it or media player which shows movie preview when mouse hover is there.Technology:
.net framework 4.0 WPFImplementation:
First of all let me show you what we are trying to build as sample.
Let's start with creating a new C# WPF Application By going to File >>New project>>Visual C# >>Windows>>WPF Application
we want to display tool tip of the button control when user mouse hover the button the movie preview should be displayed as shown in the picture WPF allow us to nesting the controls that is advantage.Drag drop 1 button control from the tool box set its properties like below
now we want to show tool tip for that we need to Set button's ToolTip property like below by mentioning the tag inside the Button Tag so our modified button code will look like below .
Now take one stack panel and inside it we have defined one border element that will provide border to our Media Element in which we are going to show the preview video. So modified final code of the button will look like
Here we have used two element Border and the Media element media element is used to show movie so we have to set its properties like source defines what movie it will show volume defines sound volume ..we have defined MediaElement inside the border element so that border will be shown outside of the media element as shown in screen shot ..
We have achieved the leaf like of shape by setting border Corner radius property :)
That's it what the project and it does what I have told.
In sample project attached I have not provided the movie because of very huge size of movie. Use any movie path in source property of the mediaelement from your computer to run the project correctly.