Exemple #1
0
 public void NotifyCompositionCapabilitiesChanged(bool areEffectsSupported, bool areEffectsFast)
 {
     if (ContentFrame.Content is SampleHost host)
     {
         SamplePage page = (SamplePage)host.Content;
         page.OnCapabiliesChanged(areEffectsSupported, areEffectsFast);
     }
 }
        private async void HandleCapabilitiesChangedAsync(CompositionCapabilities sender, object args)
        {
            _areEffectsSupported = _capabilities.AreEffectsSupported();
            _areEffectsFast      = _capabilities.AreEffectsFast();

            if (_currentFrame.Content is SampleHost host)
            {
                SamplePage page = (SamplePage)host.Content;
                page.OnCapabiliesChanged(_areEffectsSupported, _areEffectsFast);
            }

            SampleDefinitions.RefreshSampleList();


            //
            // Let the user know that the display config has changed and some samples may or may
            // not be available
            //

            if (!_areEffectsSupported || !_areEffectsFast)
            {
                string message;

                if (!_areEffectsSupported)
                {
                    message = "Your display configuration may have changed.  Your current graphics hardware does not support effects.  Some samples will not be available";
                }
                else
                {
                    message = "Your display configuration may have changed. Your current graphics hardware does not support advanced effects.  Some samples will not be available";
                }

                var messageDialog = new MessageDialog(message);
                messageDialog.Commands.Add(new UICommand("Close"));

                // Show the message dialog
                await messageDialog.ShowAsync();
            }
        }