/
Page.xaml.cs
56 lines (52 loc) · 1.76 KB
/
Page.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//-----------------------------------------------------------------------
// <copyright file="Page.xaml.cs" company="Larry Olson">
// (c) Copyright Larry Olson.
// This source is subject to the Microsoft Public License (Ms-PL)
// See http://code.msdn.microsoft.com/ManagedMediaHelpers/Project/License.aspx
// All other rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace Mp3MediaStreamSourceDemo
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Media;
/// <summary>
/// A Page of a Silvelight Application.
/// </summary>
public partial class Page : UserControl
{
/// <summary>
/// Initializes a new instance of the Page class.
/// </summary>
public Page()
{
InitializeComponent();
}
/// <summary>
/// Event handler for the Button on the Page.
/// </summary>
/// <param name="sender">
/// The button which was clicked.
/// </param>
/// <param name="e">
/// The state when this event was generated.
/// </param>
private void OpenMedia(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog();
Mp3MediaStreamSource mediaSource = new Mp3MediaStreamSource(ofd.File.OpenRead());
me.SetSource(mediaSource);
}
}
}