Example #1
0
        public CommandBar()
        {
            PrimaryCommands   = new ObservableVector <ICommandBarElement>();
            SecondaryCommands = new ObservableVector <ICommandBarElement>();

            CommandBarTemplateSettings = new CommandBarTemplateSettings(this);
        }
Example #2
0
        public CommandBar()
        {
            PrimaryCommands   = new ObservableVector <ICommandBarElement>();
            SecondaryCommands = new ObservableVector <ICommandBarElement>();

            PrimaryCommands.VectorChanged   += (s, e) => UpdateCommands();
            SecondaryCommands.VectorChanged += (s, e) => UpdateCommands();

            CommandBarTemplateSettings = new CommandBarTemplateSettings(this);

            Loaded      += (s, e) => RegisterEvents();
            Unloaded    += (s, e) => UnregisterEvents();
            SizeChanged += (s, e) => _contentHeight = e.NewSize.Height;

            this.RegisterPropertyChangedCallback(IsEnabledProperty, (s, e) => UpdateCommonState());
            this.RegisterPropertyChangedCallback(ClosedDisplayModeProperty, (s, e) => UpdateDisplayModeState());
            this.RegisterPropertyChangedCallback(IsOpenProperty, (s, e) =>
            {
                // TODO: Consider the content of _secondaryItemsControl when IsDynamicOverflowEnabled is supported.
                var hasSecondaryItems = SecondaryCommands.Any();
                if (hasSecondaryItems)
                {
                    if (_overflowPopup is {} popup)
                    {
                        popup.IsOpen = true;
                    }
                }
Example #3
0
        public CommandBar()
        {
            PrimaryCommands   = new ObservableVector <ICommandBarElement>();
            SecondaryCommands = new ObservableVector <ICommandBarElement>();

            CommandBarTemplateSettings = new CommandBarTemplateSettings(this);

            Loaded   += (s, e) => RegisterEvents();
            Unloaded += (s, e) => UnregisterEvents();
        }
Example #4
0
        public CommandBar()
        {
            PrimaryCommands   = new ObservableVector <ICommandBarElement>();
            SecondaryCommands = new ObservableVector <ICommandBarElement>();

            CommandBarTemplateSettings = new CommandBarTemplateSettings(this);

            Loaded      += (s, e) => RegisterEvents();
            Unloaded    += (s, e) => UnregisterEvents();
            SizeChanged += (s, e) => _contentHeight = e.NewSize.Height;
        }