aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Plugins.DefaultTheme/Controls/Details/ItemPerformers.xaml.cs
blob: 9ad5fdcac3014922e9c231c8f7fce99043a2cdec (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using MediaBrowser.Model.DTO;
using MediaBrowser.UI;
using MediaBrowser.UI.Controller;
using MediaBrowser.UI.ViewModels;
using System.Collections.ObjectModel;

namespace MediaBrowser.Plugins.DefaultTheme.Controls.Details
{
    /// <summary>
    /// Interaction logic for ItemPerformers.xaml
    /// </summary>
    public partial class ItemPerformers : BaseDetailsControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ItemPerformers" /> class.
        /// </summary>
        public ItemPerformers()
        {
            InitializeComponent();
        }

        /// <summary>
        /// The _itemsResult
        /// </summary>
        private ItemsResult _itemsResult;
        /// <summary>
        /// Gets or sets the children of the Folder being displayed
        /// </summary>
        /// <value>The children.</value>
        public ItemsResult ItemsResult
        {
            get { return _itemsResult; }

            private set
            {
                _itemsResult = value;
                OnPropertyChanged("ItemsResult");

                Items = DtoBaseItemViewModel.GetObservableItems(ItemsResult.Items);
            }
        }

        /// <summary>
        /// The _display children
        /// </summary>
        private ObservableCollection<DtoBaseItemViewModel> _items;
        /// <summary>
        /// Gets the actual children that should be displayed.
        /// Subclasses should bind to this, not ItemsResult.
        /// </summary>
        /// <value>The display children.</value>
        public ObservableCollection<DtoBaseItemViewModel> Items
        {
            get { return _items; }

            private set
            {
                _items = value;
                //lstItems.ItemsSource = value;
                OnPropertyChanged("Items");
            }
        }
        
        /// <summary>
        /// Called when [item changed].
        /// </summary>
        protected override async void OnItemChanged()
        {
            ItemsResult = await UIKernel.Instance.ApiClient.GetAllPeopleAsync(App.Instance.CurrentUser.Id, itemId: Item.Id);
        }
    }
}