예제 #1
0
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
            {
                return;
            }

            var app        = (App)Application.Current;
            var mainWindow = MainWindow.GetInstance();

            IsLoading = true;

            try
            {
                var tracks = await app.plexClient.GetTracks(Playlist);

                Tracks.FromArray(tracks);
            }
            catch (Exception exception)
            {
                MessageBox.Show("Could not fetch data from remote server.\n" + exception.Message, "PlexFlux", MessageBoxButton.OK, MessageBoxImage.Error);
            }

            IsLoading = false;
        }