tailieunhanh - C# 2005 Programmer’s Reference - chapter 20

Tham khảo tài liệu 'c# 2005 programmer’s reference - chapter 20', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 448 CHAPTER 20 Silverlight LISTING continued Pause else if IsPlaying false Play private void buttonStop_Click object sender RoutedEventArgs e IsPlaying false Play This is all the code you need to create your own media player on a website see Figure . As you can see it uses the familiar XAML and .NET code you are already used to. FIGURE It requires very little effort to play most common types of media in a Silverlight application. Build a Download and Playback Progress Bar 449 Build a Download and Playback Progress Bar Scenario Problem You want to display a progress bar that shows how much of the video is buffered as well as the current playback position. Solution One thing every media content downloader needs is a bar that shows both download progress and playback position. Thankfully Silverlight fully supports the concept of custom controls. Listing shows the XAML and Listing shows the code-behind for this control. LISTING UserControl x Class xmlns http winfx 2006 xaml presentation xmlns x http winfx 2006 xaml Width 400 Height 300 Canvas x Name LayoutRoot Background White Line x Name DownloadProgress X1 0 Y1 0 X2 0 Y2 0 Stroke DarkGray 0 2 StrokeThickness 3 Line x Name PlaybackProgress X1 0 Y1 0 X2 0 Y2 0 Stroke DarkGreen 0 2 StrokeThickness 3 Canvas UserControl LISTING using System using using using namespace VideoPlayer public partial class PlayDownloadProgressControl UserControl public PlayDownloadProgressControl InitializeComponent 450 CHAPTER 20 Silverlight LISTING continued public void UpdatePlaybackProgress .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.