Пример #1
0
        /* ----------------------------------------------------------------- */
        ///
        /// RibbonViewModel
        ///
        /// <summary>
        /// Initializes a new instance of the RibbonViewModel
        /// class with the specified arguments.
        /// </summary>
        ///
        /// <param name="src">Bindable data.</param>
        /// <param name="messenger">Messenger object.</param>
        ///
        /* ----------------------------------------------------------------- */
        public RibbonViewModel(MainBindable src, IMessenger messenger) : base(messenger)
        {
            Insert = new RibbonElement(
                () => Properties.Resources.MenuInsert,
                () => Properties.Resources.TooltipInsert,
                () => !src.Busy.Value && src.IsOpen(),
                nameof(Insert)
                );

            Remove = new RibbonElement(
                () => Properties.Resources.MenuRemove,
                () => Properties.Resources.TooltipRemove,
                () => !src.Busy.Value && src.IsOpen(),
                nameof(Remove)
                );

            FrameOnly = this.Create(
                () => src.Settings.FrameOnly,
                e => src.Settings.FrameOnly = e,
                () => Properties.Resources.MenuFrameOnly
                );
        }