예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ShellView" /> class.
        /// </summary>
        public ShellView()
        {
            InitializeComponent();

            BackdropMaterial.SetApplyToRootOrPageBackground(this, true);

            InitializeView();
        }
예제 #2
0
        private void SetupBackdrop(bool on)
        {
            var testFrame = this.Frame as TestFrame;
            var current   = BackdropMaterial.GetApplyToRootOrPageBackground(testFrame);

            if (current != on)
            {
                if (on)
                {
                    testFrame.SetValue(BackdropMaterial.ApplyToRootOrPageBackgroundProperty, true);
                }
                else
                {
                    // Undo the material and set up a binding to put the background property back to its theme-aware value.
                    testFrame.SetValue(BackdropMaterial.ApplyToRootOrPageBackgroundProperty, false);
                    testFrame.SetBinding(Control.BackgroundProperty,
                                         new Windows.UI.Xaml.Data.Binding {
                        Source = testFrame.BackupThemeBackground, Path = new PropertyPath("Background")
                    });
                }
            }
        }