Exemple #1
0
        void WatchForContentChanges()
        {
            // If the content of the command bar changes while it's collapsed, we need to
            // react and update the visibility (e.g., if the bar is placed at the bottom and
            // has no commands, then is moved to the top and now includes the title)

            // There's no event on CommandBar when the content changes, so we'll bind our own
            // dependency property to Content and update our visibility when it changes
            var binding = new Microsoft.UI.Xaml.Data.Binding
            {
                Source = this,
                Path   = new PropertyPath(nameof(Content)),
                Mode   = Microsoft.UI.Xaml.Data.BindingMode.OneWay
            };

            BindingOperations.SetBinding(this, s_contentChangeWatcher, binding);
        }
Exemple #2
0
 public BrushedElement(FrameworkElement element, WBinding brushBinding = null, Brush brush = null)
 {
     Element      = element;
     BrushBinding = brushBinding;
     Brush        = brush;
 }