ItemDetailViewModel.cs 568 Bytes
Newer Older
Martin Finkel's avatar
Martin Finkel committed
1
using LibVLCSharp.Shared;
2 3 4 5 6 7
using LocalNetwork.Models;

namespace LocalNetwork.ViewModels
{
    public class ItemDetailViewModel : BaseViewModel
    {
Martin Finkel's avatar
Martin Finkel committed
8 9 10 11 12 13 14 15 16 17 18
        readonly Item _item;

        public ItemDetailViewModel(Item item)
        {
            _item = item;
            MediaPlayer = new MediaPlayer(item.Media);
            MediaPlayer.Play();
        }

        private MediaPlayer _mediaPlayer;
        public MediaPlayer MediaPlayer
19
        {
Martin Finkel's avatar
Martin Finkel committed
20 21
            get => _mediaPlayer;
            private set => SetProperty(ref _mediaPlayer, value);
22 23
        }
    }
Martin Finkel's avatar
Martin Finkel committed
24
}