コード例 #1
0
        /// <summary>
        /// Initializes an instance of the <c>Step14Window</c> class.
        /// </summary>
        public Step14Window()
        {
            // Register UI providers for existing built-in commands
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Copy,
                                            new RibbonCommandUIProvider("Copy", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Copy16.png", "Copy the selection and put it on the Clipboard."));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Cut,
                                            new RibbonCommandUIProvider("Cut", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Cut16.png", "Cut the selection from the document and put it on the Clipboard."));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Paste,
                                            new RibbonCommandUIProvider("Paste", "pack://application:,,,/SampleBrowser;component/Images/Icons/Paste32.png", "pack://application:,,,/SampleBrowser;component/Images/Icons/Paste16.png", "Paste the contents of the Clipboard."));

            InitializeComponent();
        }
コード例 #2
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////
        // UI PROVIDER REGISTRATION
        /////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Registers <see cref="IRibbonCommandUIProvider"/> objects with existing built-in commands.
        /// </summary>
        public static void RegisterUIProvidersForNonRibbonCommands()
        {
            RibbonCommandUIManager.Register(EditingCommands.AlignCenter,
                                            new RibbonCommandUIProvider("Center", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/AlignTextCenter16.png", "Center text."));
            RibbonCommandUIManager.Register(EditingCommands.AlignJustify,
                                            new RibbonCommandUIProvider("Justify", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/AlignTextJustify16.png", "Align text to both the left and right margins, adding extra space between words as necessary.\r\n\r\nThis creates a clean look along the left and right sides of the page."));
            RibbonCommandUIManager.Register(EditingCommands.AlignLeft,
                                            new RibbonCommandUIProvider("Align Text Left", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/AlignTextLeft16.png", "Align text to the left."));
            RibbonCommandUIManager.Register(EditingCommands.AlignRight,
                                            new RibbonCommandUIProvider("Align Text Right", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/AlignTextRight16.png", "Align text to the right."));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Close,
                                            new RibbonCommandUIProvider("Close", "pack://application:,,,/SampleBrowser;component/Images/Icons/Close32.png", "pack://application:,,,/SampleBrowser;component/Images/Icons/Close16.png"));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Copy,
                                            new RibbonCommandUIProvider("Copy", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Copy16.png", "Copy the selection and put it on the Clipboard."));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Cut,
                                            new RibbonCommandUIProvider("Cut", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Cut16.png", "Cut the selection from the document and put it on the Clipboard."));
            RibbonCommandUIManager.Register(EditingCommands.DecreaseFontSize,
                                            new RibbonCommandUIProvider("Shrink Font", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/ShrinkFont16.png", "Decrease the font size."));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Find,
                                            new RibbonCommandUIProvider("Find:", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Find16.png", "Finds text in the text editor."));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Help,
                                            new RibbonCommandUIProvider("About Ribbon", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Help16.png", "See the About window for this product."));
            RibbonCommandUIManager.Register(EditingCommands.IncreaseFontSize,
                                            new RibbonCommandUIProvider("Grow Font", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/GrowFont16.png", "Increase the font size."));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.New,
                                            new RibbonCommandUIProvider("New", "pack://application:,,,/SampleBrowser;component/Images/Icons/New32.png", "pack://application:,,,/SampleBrowser;component/Images/Icons/New16.png"));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Open,
                                            new RibbonCommandUIProvider("Open", "pack://application:,,,/SampleBrowser;component/Images/Icons/Open32.png", "pack://application:,,,/SampleBrowser;component/Images/Icons/Open16.png"));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Paste,
                                            new RibbonCommandUIProvider("Paste", "pack://application:,,,/SampleBrowser;component/Images/Icons/Paste32.png", "pack://application:,,,/SampleBrowser;component/Images/Icons/Paste16.png", "Paste the contents of the Clipboard."));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Redo,
                                            new RibbonCommandUIProvider("Redo", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Redo16.png"));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Save,
                                            new RibbonCommandUIProvider("Save", "pack://application:,,,/SampleBrowser;component/Images/Icons/Save32.png", "pack://application:,,,/SampleBrowser;component/Images/Icons/Save16.png"));
            RibbonCommandUIManager.Register(EditingCommands.ToggleBold,
                                            new RibbonCommandUIProvider("Bold", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Bold16.png", "Make the selected text bold."));
            RibbonCommandUIManager.Register(EditingCommands.ToggleItalic,
                                            new RibbonCommandUIProvider("Italic", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Italic16.png", "Italicize the selected text."));
            RibbonCommandUIManager.Register(EditingCommands.ToggleSubscript,
                                            new RibbonCommandUIProvider("Subscript", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Subscript16.png", "Create small letters below the text baseline."));
            RibbonCommandUIManager.Register(EditingCommands.ToggleSuperscript,
                                            new RibbonCommandUIProvider("Superscript", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Superscript16.png", "Create small letters above the line of text."));
            RibbonCommandUIManager.Register(EditingCommands.ToggleUnderline,
                                            new RibbonCommandUIProvider("Underline", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Underline16.png", "Underline the selected text."));
            RibbonCommandUIManager.Register(System.Windows.Input.ApplicationCommands.Undo,
                                            new RibbonCommandUIProvider("Undo", null, "pack://application:,,,/SampleBrowser;component/Images/Icons/Undo16.png"));
        }