MusicPlayerPage.xaml.cs 1.72 KB
Newer Older
1 2 3
using System.Collections.Generic;
using System.Diagnostics;
using Windows.UI;
4
using Windows.UI.Input;
5 6
using Windows.UI.Text;
using Windows.UI.Xaml;
7
using Windows.UI.Xaml.Controls;
8
using Windows.UI.Xaml.Input;
9
using Windows.UI.Xaml.Navigation;
10
using Microsoft.Graphics.Canvas.Text;
11
using Microsoft.Xaml.Interactivity;
12 13 14
using VLC.Slideshow.Texts;
using VLC.ViewModels;
using VLC.Helpers;
15

Thomas Nigro's avatar
Thomas Nigro committed
16
namespace VLC.UI.Views.MusicPages
17 18 19 20 21 22
{
    public sealed partial class MusicPlayerPage : Page
    {
        public MusicPlayerPage()
        {
            this.InitializeComponent();
23 24 25 26 27 28
            this.Loaded += MusicPlayerPage_Loaded;
        }

        void MusicPlayerPage_Loaded(object sender, RoutedEventArgs e)
        {
            Responsive();
29
            this.SizeChanged += OnSizeChanged;
30
            this.Unloaded += OnUnloaded;
Martin Finkel's avatar
Martin Finkel committed
31
            Locator.MediaPlaybackViewModel.SliderBindingEnabled = true;
32
        }
Martin Finkel's avatar
Martin Finkel committed
33

34 35
        private void Slideshower_Loaded_1(object sender, RoutedEventArgs e)
        {
36
            Locator.Slideshow.Initialize(ref Slideshower);
37
        }
38

39 40 41
        #region layout
        private void OnSizeChanged(object sender, SizeChangedEventArgs sizeChangedEventArgs)
        {
42
            Responsive();
43
        }
44 45 46 47 48 49 50 51

        private void OnUnloaded(object sender, RoutedEventArgs routedEventArgs)
        {
            this.SizeChanged -= OnSizeChanged;
        }

        void Responsive()
        {
52
            if (Window.Current.Bounds.Width < 640)
53
            {
54
                VisualStateUtilities.GoToState(this, "Narrow", false);
55 56 57
            }
            else
            {
58
                VisualStateUtilities.GoToState(this, "Wide", false);
59 60
            }
        }
61 62 63 64
        #endregion

        #region interactions
        #endregion
65 66
    }
}