public class QuickAccessCommand
{
private ImageSource _imageSource;
private ICommand _command;
public ImageSource ImageSource
{
get { return _imageSource; }
set { _imageSource = value; }
}
public ICommand Command
{
get { return _command; }
set { _command = value; }
}
}
...
...
...
private void OnChangeQuickAccessButtonClick( object source, RoutedEventArgs e )
{
this.ribbon.QuickAccessToolBarItems.Clear();
foreach( MyCommand myCommand in this.CustomizeQuickAccessToolBarWindow.UserSelectedCommands )
{
RibbonControls.Button toolBarButton = new RibbonControls.Button( quickAccessCommand.Command );
toolBarButton.ImageSourceSmall = myCommand.ImageSource;
this.ribbon.QuickAccessToolBarItems.Add( toolBarButton );
}
}
"UserSelectedCommands" is of type ObservableCollection<MyCommand>
[Modified at 08/30/2007 07:30 AM]