forked from DerPate2010/Xbmc2ndScr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayToVm.cs
46 lines (38 loc) · 1.12 KB
/
PlayToVm.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
using System.Windows.Input;
using Okra.Core;
using Xbmc2S.RT.UPnP;
namespace Xbmc2S.Model
{
public class PlayToVm
{
protected readonly PlayableItemVm _playableItem;
private readonly MediaRendererDevice _renderer;
public PlayToVm(PlayableItemVm playableItem, MediaRendererDevice renderer):this(playableItem)
{
_renderer = renderer;
Label = renderer.FriendlyName;
}
protected PlayToVm(PlayableItemVm playableItem)
{
_playableItem = playableItem;
Play = new DelegateCommand(PlayExecuted);
}
protected virtual void PlayExecuted()
{
_playableItem.PlayTo(_renderer);
}
public string Label { get; protected set; }
public ICommand Play { get; private set; }
}
public class PlayToLocalVm:PlayToVm
{
public PlayToLocalVm(PlayableItemVm playableItem):base(playableItem)
{
Label = "This device";
}
protected override void PlayExecuted()
{
_playableItem.PlayToLocal();
}
}
}