Example #1
0
        public BaseVM()
        {
            _commands = new CommandMap();

            //usage:
            //XML: <MenuItem Header="Save" Command="{Binding Commands.SaveCommand}"/>
            //Constructor of VM: _commands.AddCommand("NewExpenseCommand", x => MessageBox.Show("Not yet implemented", "New Expense Claim"));
        }
Example #2
0
            /// <summary>
            /// Get the ICommand from the parent command map
            /// </summary>
            /// <param name="component"></param>
            /// <returns></returns>
            public override object GetValue(object component)
            {
                CommandMap map = component as CommandMap;

                if (null == map)
                {
                    throw new ArgumentException("component is not a CommandMap instance", "component");
                }

                return(map.Commands[this.Name]);
            }
Example #3
0
 /// <summary>
 /// Store the command map for later
 /// </summary>
 /// <param name="descriptor"></param>
 /// <param name="map"></param>
 public CommandMapDescriptor(ICustomTypeDescriptor descriptor, CommandMap map)
     : base(descriptor)
 {
     _map = map;
 }