I. Multimedia
1. SL supports multimedia using the "mediaelement" class.
2. Set the file to "embedded resources ".
3. Define the mediaelement object in XAML.
Small instance
Mediaelement media = new mediaelement ();
Stream stream = assembly. getexecutingassembly (). getmanifestresourcestream (
"Myslpro.love1.wav"); // capture the video stream from the application assembly
Media. setsource (Stream); // sets the media source.
Media. autoplay = false; // playback control
Media. Stop ();
Media. Play ();
2. Add a tooltip
1. Use the "tooltipservice" control to act on other controls, such as buttons, Textbox, and panel ).
2. usage. In XAML, place it between two labels ". In the background code, declare the object for dynamic settings.
Instance:
<Textbox width = "50" Height = "40" text = "You guess">
<Tooltipservice. tooltip>
<Image Source = "/images/gile.jpg">
</Image>
</Tooltipservice. tooltip>
</Textbox>
Background code:
Tooltipservice. settooltip (bt_test, "click ");
3. Right-click the menu
In SL, You can intercept the default context menu of SL and display the custom menu as follows:
1. Set the "windowless" attribute to "true" on the web page for loading SL ".
2. On the XAML page, set the "attachevent" attribute of the browser document object and add the required event operations to the "oncontextmenu" event. Of course, you can also add events to the background method of APP. XAML so that users can perform their own operations on any XAML page.
Brief example:
System. Windows. browser. htmlpage. Document. attachevent ("oncontextmenu", this. oncontextmenu );
Private void oncontextmenu (Object sender, system. Windows. browser. htmleventargs E)
{
MessageBox. Show ("You are clicking" + E. offsetx + "," + E. offsety );
E. preventdefault ();
}
Next, write data binding. I have been writing for more than an hour, so I have to work on the project.
Latest database, transfer array