<telerik:RadRibbonWindow
    x:Class="XplorePlane.Views.MainWindowB"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:spreadsheet="clr-namespace:Telerik.Windows.Controls.Spreadsheet;assembly=Telerik.Windows.Controls.Spreadsheet"
    xmlns:spreadsheetControls="clr-namespace:Telerik.Windows.Controls.Spreadsheet.Controls;assembly=Telerik.Windows.Controls.Spreadsheet"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:views="clr-namespace:XplorePlane.Views"
    x:Name="ParentWindow"
    Title="XplorePlane"
    Width="1280"
    Height="798"
    d:DesignWidth="1280"
    Background="#F5F5F5"
    WindowStartupLocation="CenterScreen"
    mc:Ignorable="d">
    <Window.Resources>
        <telerik:IconSources
            x:Key="IconPaths"
            DarkBasePath="/Telerik.Windows.Controls.Spreadsheet;component/Images/Dark/"
            LightBasePath="/Telerik.Windows.Controls.Spreadsheet;component/Images/Light/" />

        <spreadsheetControls:BoolToVisibilityValueConverter x:Key="BoolToVisibilityValueConverter" />
        <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
    </Window.Resources>
    <Grid x:Name="LayoutRoot">

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="28" />
        </Grid.RowDefinitions>

        <telerik:RadRibbonView
            x:Name="ribbonView"
            Title="XplorePlane"
            Grid.ColumnSpan="3"
            VerticalAlignment="Center"
            ApplicationButtonVisibility="Collapsed"
            ApplicationName=""
            BackstageClippingElement="{Binding ElementName=LayoutRoot}"
            HeaderBackground="LightGray">

            <telerik:RadRibbonView.Resources>
                <spreadsheet:FunctionsProvider x:Key="FunctionsProvider" />
            </telerik:RadRibbonView.Resources>

            <telerik:RadRibbonTab Header="主页">
                <telerik:RadRibbonGroup
                    telerik:ScreenTip.Title="Clipboard"
                    Header="文件"
                    IsEnabled="{Binding Path=ClipboardGroup.IsEnabled}">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="0" Variant="Large" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonSplitButton
                        x:Name="PasteButton"
                        telerik:ScreenTip.Description="Paste the contents of the Clipboard."
                        telerik:ScreenTip.Title="Paste (Ctrl+V)"
                        Command="{Binding Path=Paste.Command}"
                        IsEnabled="{Binding Path=Paste.IsEnabled}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/pasteActive.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Paste">
                        <telerik:RadRibbonSplitButton.DropDownContent>
                            <telerik:RadContextMenu Padding="0" BorderThickness="0">
                                <telerik:RadMenuGroupItem
                                    Background="Transparent"
                                    BorderThickness="0"
                                    Header="Paste">
                                    <telerik:RadMenuItem
                                        Command="{Binding Path=Paste.Command}"
                                        Header="Paste"
                                        IsEnabled="{Binding Path=Paste.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/pasteNormal.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem
                                        Command="{Binding Path=PasteFormulas.Command}"
                                        CommandParameter="Formulas"
                                        Header="Formulas"
                                        IsEnabled="{Binding Path=PasteFormulas.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/pasteFormulas.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem
                                        Command="{Binding Path=PasteFormulasAndNumberFormats.Command}"
                                        CommandParameter="FormulasAndNumberFormats"
                                        Header="Formulas &amp; Number Formatting"
                                        IsEnabled="{Binding Path=PasteFormulasAndNumberFormats.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/pasteFormulasNumberFormatting.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem
                                        Command="{Binding Path=PasteColumnWidths.Command}"
                                        CommandParameter="ColumnWidths"
                                        Header="Column Widths"
                                        IsEnabled="{Binding Path=PasteColumnWidths.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/pasteKeepSourceColumnWidths.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuGroupItem>
                                <telerik:RadMenuGroupItem
                                    Margin="-1"
                                    Background="Transparent"
                                    BorderThickness="0"
                                    Header="Paste Values">
                                    <telerik:RadMenuItem
                                        Command="{Binding Path=PasteValues.Command}"
                                        CommandParameter="Values"
                                        Header="Values"
                                        IsEnabled="{Binding Path=PasteValues.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/pasteValues.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem
                                        Command="{Binding Path=PasteValuesAndNumberFormats.Command}"
                                        CommandParameter="ValuesAndNumberFormats"
                                        Header="Values &amp; Number Formatting"
                                        IsEnabled="{Binding Path=PasteValuesAndNumberFormats.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/pasteValuesNumberFormatting.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuGroupItem>
                                <telerik:RadMenuGroupItem
                                    Margin="-1"
                                    Background="Transparent"
                                    BorderThickness="0"
                                    Header="Other Paste Options">
                                    <telerik:RadMenuItem
                                        Command="{Binding Path=PasteFormatting.Command}"
                                        CommandParameter="Formats"
                                        Header="Formatting"
                                        IsEnabled="{Binding Path=PasteFormatting.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/pasteFormatting.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuGroupItem>
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonSplitButton.DropDownContent>
                    </telerik:RadRibbonSplitButton>
                    <StackPanel>
                        <telerik:RadRibbonButton
                            telerik:ScreenTip.Description="Cut the selection and put it on the Clipboard."
                            telerik:ScreenTip.Title="Cut"
                            Command="{Binding Path=Cut.Command}"
                            IsEnabled="{Binding Path=Cut.IsEnabled}"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/cut.png,
                                                              IconSources={StaticResource IconPaths}}"
                            Text="Cut" />

                        <telerik:RadRibbonButton
                            telerik:ScreenTip.Description="Copy the selection and put it on the Clipboard."
                            telerik:ScreenTip.Title="Copy"
                            Command="{Binding Path=Copy.Command}"
                            IsEnabled="{Binding Path=Copy.IsEnabled}"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/copy.png,
                                                              IconSources={StaticResource IconPaths}}"
                            Text="Copy" />
                    </StackPanel>
                </telerik:RadRibbonGroup>

                <telerik:RadRibbonGroup
                    telerik:ScreenTip.Description="Show the Font tab of the Format Cells dialog box."
                    telerik:ScreenTip.Title="Format Cells: Font"
                    DialogLauncherCommand="{Binding Path=ShowFormatCellsDialog.Command}"
                    DialogLauncherCommandParameter="Font"
                    DialogLauncherVisibility="{Binding Path=ShowFormatCellsDialog.IsEnabled, Converter={StaticResource BoolToVisibilityValueConverter}}"
                    Header="快捷工具"
                    IsEnabled="{Binding Path=FontGroup.IsEnabled}">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="0" Variant="Large" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadOrderedWrapPanel>
                        <StackPanel Orientation="Horizontal">
                            <StackPanel.Resources>
                                <spreadsheetControls:UnitToDipConverter x:Key="unitToDipConverter" />
                                <spreadsheetControls:DipToUnitConverter x:Key="dipToUnitConverter" />
                                <spreadsheetControls:ThemeFontTypeToTextConverter x:Key="themeFontTypeToTextConverter" />
                            </StackPanel.Resources>

                            <telerik:RadRibbonComboBox
                                Width="152"
                                telerik:RadComboBoxExtensions.UIInteractionCommand="{Binding Path=SetFontFamily.Command}"
                                telerik:RadComboBoxExtensions.UIInteractionCommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem}"
                                telerik:ScreenTip.Description="Change the font family."
                                telerik:ScreenTip.Title="Font"
                                CanAutocompleteSelectItems="False"
                                CanKeyboardNavigationSelectItems="False"
                                IsEditable="False"
                                IsEnabled="{Binding Path=SetFontFamily.IsEnabled}"
                                ItemsSource="{Binding ElementName=radSpreadsheet, Path=FontsProvider.RegisteredFonts}"
                                MaxDropDownHeight="400"
                                ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                                SelectedValue="{Binding Path=SetFontFamily.SelectedValue, Mode=TwoWay}">
                                <telerik:RadRibbonComboBox.ItemTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="Auto" />
                                            </Grid.ColumnDefinitions>
                                            <TextBlock
                                                FontFamily="{Binding Path=FontFamily}"
                                                FontSize="12"
                                                Text="{Binding Path=FontFamily.Source}" />
                                            <TextBlock
                                                Grid.Column="1"
                                                FontFamily="{Binding Path=FontFamily}"
                                                FontSize="12"
                                                Text="{Binding Path=ThemeFontType, Converter={StaticResource themeFontTypeToTextConverter}}" />
                                        </Grid>
                                    </DataTemplate>
                                </telerik:RadRibbonComboBox.ItemTemplate>
                                <telerik:RadRibbonComboBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <VirtualizingStackPanel Width="210" />
                                    </ItemsPanelTemplate>
                                </telerik:RadRibbonComboBox.ItemsPanel>
                            </telerik:RadRibbonComboBox>

                            <telerik:RadRibbonComboBox
                                Width="62"
                                Margin="-1,0,0,0"
                                telerik:RadComboBoxExtensions.UIInteractionCommand="{Binding Path=SetFontSize.Command}"
                                telerik:RadComboBoxExtensions.UIInteractionCommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem, Converter={StaticResource unitToDipConverter}, ConverterParameter=Point}"
                                telerik:ScreenTip.Description="Change the size of your text."
                                telerik:ScreenTip.Title="Font Size"
                                CanAutocompleteSelectItems="False"
                                CanKeyboardNavigationSelectItems="False"
                                IsEditable="False"
                                IsEnabled="{Binding Path=SetFontSize.IsEnabled}"
                                IsTabStop="False"
                                ItemsSource="{Binding ElementName=radSpreadsheet, Path=FontsProvider.FontSizes}"
                                MaxDropDownHeight="400"
                                SelectedValue="{Binding Path=SetFontSize.SelectedValue, Mode=TwoWay, Converter={StaticResource dipToUnitConverter}, ConverterParameter=Point}" />
                        </StackPanel>

                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonButton
                                telerik:ScreenTip.Description="Increase the font size."
                                telerik:ScreenTip.Title="Increase Font Size"
                                Command="{Binding Path=IncreaseFontSize.Command}"
                                CommandParameter="{Binding Path=IncreaseFontSize.SelectedValue}"
                                IsEnabled="{Binding Path=IncreaseFontSize.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/fontSizeIncrease.png,
                                                                  IconSources={StaticResource IconPaths}}" />

                            <telerik:RadRibbonButton
                                telerik:ScreenTip.Description="Decrease the font size."
                                telerik:ScreenTip.Title="Decrease Font Size"
                                Command="{Binding Path=DecreaseFontSize.Command}"
                                CommandParameter="{Binding Path=DecreaseFontSize.SelectedValue}"
                                IsEnabled="{Binding Path=DecreaseFontSize.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/fontSizeDecrease.png,
                                                                  IconSources={StaticResource IconPaths}}" />
                        </telerik:RadButtonGroup>

                        <telerik:RadButtonGroup x:Name="FontStylesGroup">
                            <telerik:RadButtonGroup.Resources>
                                <spreadsheetControls:UnderlineTypeToBooleanConverter x:Key="underlineTypeToBooleanConverter" />
                            </telerik:RadButtonGroup.Resources>

                            <telerik:RadRibbonToggleButton
                                telerik:ScreenTip.Description="Make the selected text bold."
                                telerik:ScreenTip.Title="Bold (Ctrl+B)"
                                Command="{Binding Path=SetIsBold.Command}"
                                CommandParameter="{Binding Path=SetIsBold.SelectedValue}"
                                IsChecked="{Binding Path=SetIsBold.SelectedValue, Mode=TwoWay}"
                                IsEnabled="{Binding Path=SetIsBold.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/bold.png,
                                                                  IconSources={StaticResource IconPaths}}" />

                            <telerik:RadRibbonToggleButton
                                telerik:ScreenTip.Description="Italicize the selected text."
                                telerik:ScreenTip.Title="Italic (Ctrl+I)"
                                Command="{Binding Path=SetIsItalic.Command}"
                                CommandParameter="{Binding Path=SetIsItalic.SelectedValue}"
                                IsChecked="{Binding Path=SetIsItalic.SelectedValue, Mode=TwoWay}"
                                IsEnabled="{Binding Path=SetIsItalic.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/italic.png,
                                                                  IconSources={StaticResource IconPaths}}" />

                            <telerik:RadRibbonToggleButton
                                telerik:ScreenTip.Description="Underline the selected text."
                                telerik:ScreenTip.Title="Underline (Ctrl+U)"
                                Command="{Binding Path=SetUnderline.Command}"
                                CommandParameter="{Binding Path=SetUnderline.SelectedValue}"
                                IsChecked="{Binding Path=SetUnderline.SelectedValue, Mode=TwoWay, Converter={StaticResource underlineTypeToBooleanConverter}, ConverterParameter=Single}"
                                IsEnabled="{Binding Path=SetUnderline.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/underline.png,
                                                                  IconSources={StaticResource IconPaths}}" />
                        </telerik:RadButtonGroup>

                        <telerik:RadButtonGroup>
                            <spreadsheetControls:BordersMenu RadSpreadsheet="{Binding ElementName=radSpreadsheet, Mode=OneTime}" SelectedItemImage="{telerik:IconResource IconRelativePath=16/bottomBorder.png, IconSources={StaticResource IconPaths}}" />
                        </telerik:RadButtonGroup>
                        <telerik:RadButtonGroup>
                            <telerik:RadColorPicker
                                telerik:ScreenTip.Description="Color the background of selected cells."
                                telerik:ScreenTip.Title="Fill Color"
                                AutomaticColor="Transparent"
                                BorderThickness="0"
                                Command="{Binding Path=SetFillColor.Command}"
                                CommandParameter="{Binding Path=SetFillColor.SelectedValue}"
                                HeaderPaletteItemsSource="{Binding ElementName=radSpreadsheet, Path=ColorPalette.HeaderPaletteItemsSource}"
                                IsEnabled="{Binding Path=SetFillColor.IsEnabled}"
                                IsRecentColorsActive="True"
                                MainPaletteItemsSource="{Binding ElementName=radSpreadsheet, Path=ColorPalette.MainPaletteItemsSource}"
                                MainPaletteOrientation="{Binding ElementName=radSpreadsheet, Path=ColorPalette.MainPaletteOrientation}"
                                NoColorText="No Fill"
                                RecentColorsVisibility="Visible"
                                SelectedColor="{Binding Path=SetFillColor.SelectedValue, Mode=TwoWay}">
                                <telerik:RadColorPicker.ContentTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <Image
                                                Width="16"
                                                Source="{telerik:IconResource IconRelativePath=16/bucket.png,
                                                                              IconSources={StaticResource IconPaths}}"
                                                Stretch="None" />
                                            <Rectangle
                                                Height="4"
                                                HorizontalAlignment="Stretch"
                                                VerticalAlignment="Bottom">
                                                <Rectangle.Fill>
                                                    <SolidColorBrush Color="{Binding}" />
                                                </Rectangle.Fill>
                                            </Rectangle>
                                        </Grid>
                                    </DataTemplate>
                                </telerik:RadColorPicker.ContentTemplate>
                                <telerik:RadColorPicker.AdditionalContent>
                                    <telerik:RadButton
                                        Margin="0,-1,0,0"
                                        HorizontalContentAlignment="Left"
                                        spreadsheetControls:RadControlsExtensions.ShouldCloseParentPopupOnClick="True"
                                        Background="Transparent"
                                        BorderThickness="0"
                                        Command="{Binding Path=ShowMoreColorsDialog.Command}"
                                        CommandParameter="{Binding Path=SetFillColor}"
                                        IsEnabled="{Binding Path=ShowMoreColorsDialog.IsEnabled}">
                                        <StackPanel Orientation="Horizontal">
                                            <Image
                                                Width="16"
                                                Height="16"
                                                Source="{telerik:IconResource IconRelativePath=16/color.png,
                                                                              IconSources={StaticResource IconPaths}}" />
                                            <TextBlock
                                                Margin="10,0,0,0"
                                                FontWeight="Normal"
                                                Text="More Colors..." />
                                        </StackPanel>
                                    </telerik:RadButton>
                                </telerik:RadColorPicker.AdditionalContent>
                            </telerik:RadColorPicker>

                            <telerik:RadColorPicker
                                telerik:ScreenTip.Description="Change the text color."
                                telerik:ScreenTip.Title="Text Highlight Color"
                                BorderThickness="0"
                                Command="{Binding Path=SetForeColor.Command}"
                                CommandParameter="{Binding Path=SetForeColor.SelectedValue}"
                                HeaderPaletteItemsSource="{Binding ElementName=radSpreadsheet, Path=ColorPalette.HeaderPaletteItemsSource}"
                                IsEnabled="{Binding Path=SetForeColor.IsEnabled}"
                                MainPaletteItemsSource="{Binding ElementName=radSpreadsheet, Path=ColorPalette.MainPaletteItemsSource}"
                                MainPaletteOrientation="{Binding ElementName=radSpreadsheet, Path=ColorPalette.MainPaletteOrientation}"
                                NoColorText="Automatic"
                                SelectedColor="{Binding Path=SetForeColor.SelectedValue, Mode=TwoWay}">
                                <telerik:RadColorPicker.ContentTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <Image
                                                Width="16"
                                                Source="{telerik:IconResource IconRelativePath=16/foregroundColor.png,
                                                                              IconSources={StaticResource IconPaths}}"
                                                Stretch="None" />
                                            <Rectangle
                                                Height="3"
                                                HorizontalAlignment="Stretch"
                                                VerticalAlignment="Bottom">
                                                <Rectangle.Fill>
                                                    <SolidColorBrush Color="{Binding}" />
                                                </Rectangle.Fill>
                                            </Rectangle>
                                        </Grid>
                                    </DataTemplate>
                                </telerik:RadColorPicker.ContentTemplate>
                                <telerik:RadColorPicker.AdditionalContent>
                                    <telerik:RadButton
                                        Margin="0,-1,0,0"
                                        HorizontalContentAlignment="Left"
                                        spreadsheetControls:RadControlsExtensions.ShouldCloseParentPopupOnClick="True"
                                        Background="Transparent"
                                        BorderThickness="0"
                                        Command="{Binding Path=ShowMoreColorsDialog.Command}"
                                        CommandParameter="{Binding Path=SetForeColor}"
                                        IsEnabled="{Binding Path=ShowMoreColorsDialog.IsEnabled}">
                                        <StackPanel Orientation="Horizontal">
                                            <Image
                                                Width="16"
                                                Height="16"
                                                Source="{telerik:IconResource IconRelativePath=16/color.png,
                                                                              IconSources={StaticResource IconPaths}}" />
                                            <TextBlock
                                                Margin="10,0,0,0"
                                                FontWeight="Normal"
                                                Text="More Colors..." />
                                        </StackPanel>
                                    </telerik:RadButton>
                                </telerik:RadColorPicker.AdditionalContent>
                            </telerik:RadColorPicker>
                        </telerik:RadButtonGroup>
                    </telerik:RadOrderedWrapPanel>
                </telerik:RadRibbonGroup>

                <telerik:RadRibbonGroup
                    telerik:ScreenTip.Description="Show the Alignment tab of the Format Cells dialog box."
                    telerik:ScreenTip.Title="Format Cells: Alignment"
                    DialogLauncherCommand="{Binding Path=ShowFormatCellsDialog.Command}"
                    DialogLauncherCommandParameter="Alignment"
                    DialogLauncherVisibility="{Binding Path=ShowFormatCellsDialog.IsEnabled, Converter={StaticResource BoolToVisibilityValueConverter}}"
                    Header="硬件"
                    IsEnabled="{Binding Path=AlignmentGroup.IsEnabled}">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="0" Variant="Large" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonGroup.Resources>
                        <spreadsheetControls:RadHorizontalAlignmentToBooleanConverter x:Key="horizontalAlignmentToBooleanConverter" />
                        <spreadsheetControls:RadVerticalAlignmentToBooleanConverter x:Key="verticalAlignmentToBooleanConverter" />
                    </telerik:RadRibbonGroup.Resources>

                    <telerik:RadOrderedWrapPanel>
                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonToggleButton
                                telerik:ScreenTip.Description="Align the text to the top of the cell."
                                telerik:ScreenTip.Title="Top Align"
                                Command="{Binding Path=SetVerticalAlignment.Command}"
                                CommandParameter="{Binding Path=SetVerticalAlignment.SelectedValue}"
                                IsChecked="{Binding Path=SetVerticalAlignment.SelectedValue, Mode=TwoWay, Converter={StaticResource verticalAlignmentToBooleanConverter}, ConverterParameter=Top}"
                                IsEnabled="{Binding Path=SetVerticalAlignment.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/alignTop.png,
                                                                  IconSources={StaticResource IconPaths}}" />

                            <telerik:RadRibbonToggleButton
                                telerik:ScreenTip.Description="Align text so that it is centered between the top and the bottom of the cell."
                                telerik:ScreenTip.Title="Middle Align"
                                Command="{Binding Path=SetVerticalAlignment.Command}"
                                CommandParameter="{Binding Path=SetVerticalAlignment.SelectedValue}"
                                IsChecked="{Binding Path=SetVerticalAlignment.SelectedValue, Mode=TwoWay, Converter={StaticResource verticalAlignmentToBooleanConverter}, ConverterParameter=Center}"
                                IsEnabled="{Binding Path=SetVerticalAlignment.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/alignMiddle.png,
                                                                  IconSources={StaticResource IconPaths}}" />

                            <telerik:RadRibbonToggleButton
                                telerik:ScreenTip.Description="Align the text to the bottom of the cell."
                                telerik:ScreenTip.Title="Bottom Align"
                                Command="{Binding Path=SetVerticalAlignment.Command}"
                                CommandParameter="{Binding Path=SetVerticalAlignment.SelectedValue}"
                                IsChecked="{Binding Path=SetVerticalAlignment.SelectedValue, Mode=TwoWay, Converter={StaticResource verticalAlignmentToBooleanConverter}, ConverterParameter=Bottom}"
                                IsEnabled="{Binding Path=SetVerticalAlignment.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/alignBottom.png,
                                                                  IconSources={StaticResource IconPaths}}" />
                        </telerik:RadButtonGroup>
                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonToggleButton
                                telerik:ScreenTip.Description="Align text to the left."
                                telerik:ScreenTip.Title="Align Text Left"
                                Command="{Binding Path=SetHorizontalAlignment.Command}"
                                CommandParameter="{Binding Path=SetHorizontalAlignment.SelectedValue}"
                                IsChecked="{Binding Path=SetHorizontalAlignment.SelectedValue, Mode=TwoWay, Converter={StaticResource horizontalAlignmentToBooleanConverter}, ConverterParameter=Left}"
                                IsEnabled="{Binding Path=SetHorizontalAlignment.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/alignLeft.png,
                                                                  IconSources={StaticResource IconPaths}}" />

                            <telerik:RadRibbonToggleButton
                                telerik:ScreenTip.Description="Center text."
                                telerik:ScreenTip.Title="Center"
                                Command="{Binding Path=SetHorizontalAlignment.Command}"
                                CommandParameter="{Binding Path=SetHorizontalAlignment.SelectedValue}"
                                IsChecked="{Binding Path=SetHorizontalAlignment.SelectedValue, Mode=TwoWay, Converter={StaticResource horizontalAlignmentToBooleanConverter}, ConverterParameter=Center}"
                                IsEnabled="{Binding Path=SetHorizontalAlignment.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/alignCenter.png,
                                                                  IconSources={StaticResource IconPaths}}" />

                            <telerik:RadRibbonToggleButton
                                telerik:ScreenTip.Description="Align text to the right."
                                telerik:ScreenTip.Title="Align Text Right"
                                Command="{Binding Path=SetHorizontalAlignment.Command}"
                                CommandParameter="{Binding Path=SetHorizontalAlignment.SelectedValue}"
                                IsChecked="{Binding Path=SetHorizontalAlignment.SelectedValue, Mode=TwoWay, Converter={StaticResource horizontalAlignmentToBooleanConverter}, ConverterParameter=Right}"
                                IsEnabled="{Binding Path=SetHorizontalAlignment.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/alignRight.png,
                                                                  IconSources={StaticResource IconPaths}}" />
                        </telerik:RadButtonGroup>

                        <telerik:RadButtonGroup>
                            <telerik:RadRibbonButton
                                telerik:ScreenTip.Description="Decrease the margin between the border and the text in the cell."
                                telerik:ScreenTip.Title="Decrease Indent"
                                Command="{Binding Path=DecreaseIndent.Command}"
                                CommandParameter="{Binding Path=DecreaseIndent.SelectedValue}"
                                IsEnabled="{Binding Path=DecreaseIndent.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/indentDecrease.png,
                                                                  IconSources={StaticResource IconPaths}}" />

                            <telerik:RadRibbonButton
                                telerik:ScreenTip.Description="Increase the margin between the border and the text in the cell."
                                telerik:ScreenTip.Title="Increase Indent"
                                Command="{Binding Path=IncreaseIndent.Command}"
                                CommandParameter="{Binding Path=IncreaseIndent.SelectedValue}"
                                IsEnabled="{Binding Path=IncreaseIndent.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/indentIncrease.png,
                                                                  IconSources={StaticResource IconPaths}}" />
                        </telerik:RadButtonGroup>
                    </telerik:RadOrderedWrapPanel>

                    <telerik:Separator />

                    <telerik:RadOrderedWrapPanel>
                        <telerik:RadOrderedWrapPanel.Resources>
                            <telerik:InvertedBooleanConverter x:Key="InvertedBooleanConverter" />
                        </telerik:RadOrderedWrapPanel.Resources>
                        <telerik:RadRibbonToggleButton
                            telerik:ScreenTip.Description="Make all content visible within a cell by displaying it on multiple lines."
                            telerik:ScreenTip.Title="Wrap Text"
                            Command="{Binding Path=SetIsWrapped.Command}"
                            CommandParameter="{Binding Path=SetIsWrapped.SelectedValue}"
                            IsChecked="{Binding Path=SetIsWrapped.SelectedValue, Mode=TwoWay}"
                            IsEnabled="{Binding Path=SetIsWrapped.IsEnabled}"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/wrapText.png,
                                                              IconSources={StaticResource IconPaths}}"
                            Text="Wrap Text" />

                        <telerik:RadRibbonSplitButton
                            x:Name="MergeAndCenterButton"
                            telerik:ScreenTip.Description="Joins the selected cells into one larger cell and centers the contents in the new cell.&#10;                                                                                      This is often used to create labels that span multiple columns."
                            telerik:ScreenTip.Title="Merge &amp; Center"
                            Command="{Binding Path=MergeAndCenter.Command}"
                            CommandParameter="{Binding Path=MergeAndCenter.SelectedValue, Converter={StaticResource InvertedBooleanConverter}}"
                            IsChecked="{Binding Path=MergeAndCenter.SelectedValue, Mode=TwoWay}"
                            IsEnabled="{Binding Path=MergeAndCenter.IsEnabled}"
                            IsToggle="True"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/mergeAndCenter.png,
                                                              IconSources={StaticResource IconPaths}}"
                            Text="Merge &amp; Center">

                            <telerik:RadRibbonSplitButton.DropDownContent>
                                <telerik:RadContextMenu Padding="0" BorderThickness="0">
                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Joins the selected cells into one larger cell and centers the contents in the new cell.&#10;                                                                     This is often used to create labels that span multiple columns."
                                        telerik:ScreenTip.Title="Merge &amp; Center"
                                        Command="{Binding Path=MergeAndCenter.Command}"
                                        CommandParameter="{Binding Path=MergeAndCenter.SelectedValue}"
                                        Header="Merge &amp; Center"
                                        IsChecked="{Binding Path=MergeAndCenter.SelectedValue, Mode=TwoWay}"
                                        IsEnabled="{Binding Path=MergeAndCenter.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/mergeAndCenter.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Merge each row of the selected cells into a larger cell."
                                        telerik:ScreenTip.Title="Merge Across"
                                        Command="{Binding Path=MergeAcross.Command}"
                                        Header="Merge Across"
                                        IsEnabled="{Binding Path=MergeAcross.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/mergeAcross.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Merge the selected cells into one cell."
                                        telerik:ScreenTip.Title="Merge Cells"
                                        Command="{Binding Path=Merge.Command}"
                                        Header="Merge Cells"
                                        IsEnabled="{Binding Path=Merge.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/merge.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Split the selected cells into new multiple cells."
                                        telerik:ScreenTip.Title="Unmerge Cells"
                                        Command="{Binding Path=Unmerge.Command}"
                                        Header="Unmerge Cells"
                                        IsEnabled="{Binding Path=Unmerge.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/unmerge.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadContextMenu>
                            </telerik:RadRibbonSplitButton.DropDownContent>
                        </telerik:RadRibbonSplitButton>
                    </telerik:RadOrderedWrapPanel>
                </telerik:RadRibbonGroup>

                <telerik:RadRibbonGroup
                    telerik:ScreenTip.Description="Show the Number tab of the Format Cells dialog box."
                    telerik:ScreenTip.Title="Format Cells: Number"
                    DialogLauncherCommand="{Binding Path=ShowFormatCellsDialog.Command}"
                    DialogLauncherCommandParameter="Number"
                    DialogLauncherVisibility="{Binding Path=ShowFormatCellsDialog.IsEnabled, Converter={StaticResource BoolToVisibilityValueConverter}}"
                    Header="CNC"
                    IsEnabled="{Binding Path=NumberGroup.IsEnabled}">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="0" Variant="Large" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadOrderedWrapPanel>

                        <spreadsheetControls:NumberFormatAutoCompleteComboBox
                            telerik:ScreenTip.Description="Choose how the values in a cell are displayed: as a percentage, as currency, as a date or time, etc."
                            telerik:ScreenTip.Title="Number Format"
                            CellValueFormat="{Binding ElementName=radSpreadsheet, Path=CommandDescriptors.SetFormat.SelectedValue, Mode=TwoWay}"
                            IsEnabled="{Binding ElementName=radSpreadsheet, Path=CommandDescriptors.SetFormat.IsEnabled, Mode=TwoWay}"
                            RadSpreadsheet="{Binding ElementName=radSpreadsheet, Mode=OneTime}" />

                        <telerik:RadButtonGroup Margin="0,0,3,0">
                            <telerik:RadRibbonSplitButton
                                x:Name="AccountingNumberFormatButton"
                                telerik:ScreenTip.Description="Choose an alternate currency format for the selected cell. &#13;&#13;For instance, choose Euros instead of Dollars."
                                telerik:ScreenTip.Title="Accounting Number Format"
                                Command="{Binding Path=SetStyle.Command}"
                                CommandParameter="Currency"
                                IsEnabled="{Binding Path=SetStyle.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/accountingNumberFormat.png,
                                                                  IconSources={StaticResource IconPaths}}">
                                <telerik:RadRibbonSplitButton.DropDownContent>
                                    <telerik:RadContextMenu Padding="0" BorderThickness="0">
                                        <telerik:RadMenuItem
                                            Command="{Binding Path=SetFormat.Command}"
                                            CommandParameter="_([$$-409]* #,##0.00_);_([$$-409]* (#,##0.00);_([$$-409]* &quot;-&quot;??_);_(@_)"
                                            Header="$ English (U.S.)"
                                            IsEnabled="{Binding Path=SetFormat.IsEnabled, Mode=TwoWay}" />

                                        <telerik:RadMenuItem
                                            Command="{Binding Path=SetFormat.Command}"
                                            CommandParameter="_-[$&#163;-809]* #,##0.00_-;-[$&#163;-809]* #,##0.00_-;_-[$&#163;-809]* &quot;-&quot;??_-;_-@_-"
                                            Header="&#163; English (U.K.)"
                                            IsEnabled="{Binding Path=SetFormat.IsEnabled, Mode=TwoWay}" />

                                        <telerik:RadMenuItem
                                            Command="{Binding Path=SetFormat.Command}"
                                            CommandParameter="_([$&#8364;-2] * #,##0.00_);_([$&#8364;-2] * (#,##0.00);_([$&#8364;-2] * &quot;-&quot;??_);_(@_)"
                                            Header="&#8364; Euro (&#8364; 123)"
                                            IsEnabled="{Binding Path=SetFormat.IsEnabled, Mode=TwoWay}" />

                                        <telerik:RadMenuItem
                                            Command="{Binding Path=SetFormat.Command}"
                                            CommandParameter="_ [$&#165;-804]* #,##0.00_ ;_ [$&#165;-804]* -#,##0.00_ ;_ [$&#165;-804]* &quot;-&quot;??_ ;_ @_ "
                                            Header="&#165; Chinese (PRC)"
                                            IsEnabled="{Binding Path=SetFormat.IsEnabled, Mode=TwoWay}" />

                                        <telerik:RadMenuItem
                                            Command="{Binding Path=SetFormat.Command}"
                                            CommandParameter="_ [$fr.-100C] * #,##0.00_ ;_ [$fr.-100C] * -#,##0.00_ ;_ [$fr.-100C] * &quot;-&quot;??_ ;_ @_ "
                                            Header="fr. French (Switzerland)"
                                            IsEnabled="{Binding Path=SetFormat.IsEnabled, Mode=TwoWay}" />

                                        <telerik:RadMenuSeparatorItem />

                                        <telerik:RadMenuItem
                                            Command="{Binding Path=ShowFormatCellsDialogNumberTab.Command}"
                                            CommandParameter="_($* #,##0.00_);_($* (#,##0.00);_($* &quot;-&quot;??_);_(@_)"
                                            Header="More Accounting Formats..."
                                            IsEnabled="{Binding Path=ShowFormatCellsDialogNumberTab.IsEnabled, Mode=TwoWay}" />
                                    </telerik:RadContextMenu>
                                </telerik:RadRibbonSplitButton.DropDownContent>
                            </telerik:RadRibbonSplitButton>
                            <telerik:RadRibbonButton
                                telerik:ScreenTip.Description="Display the value of the cell as a percentage."
                                telerik:ScreenTip.Title="Percent Style (Ctrl+Shift+%)"
                                Command="{Binding Path=SetStyle.Command}"
                                CommandParameter="Percent"
                                IsEnabled="{Binding Path=SetStyle.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/percent.png,
                                                                  IconSources={StaticResource IconPaths}}" />
                            <telerik:RadRibbonButton
                                telerik:ScreenTip.Description="Display the value of the cell with a thousands separator. &#13;&#13;This will change the format of the cell to Accounting without a currency symbol."
                                telerik:ScreenTip.Title="Comma Style"
                                Command="{Binding Path=SetStyle.Command}"
                                CommandParameter="Comma"
                                IsEnabled="{Binding Path=SetStyle.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/edit-comma.png,
                                                                  IconSources={StaticResource IconPaths}}" />
                        </telerik:RadButtonGroup>

                        <telerik:RadButtonGroup>

                            <telerik:RadRibbonButton
                                telerik:ScreenTip.Description="Show more precise values by showing more decimal places."
                                telerik:ScreenTip.Title="Increase Decimal"
                                Command="{Binding Path=IncreaseDecimalPlaces.Command}"
                                IsEnabled="{Binding Path=IncreaseDecimalPlaces.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/decimal.png,
                                                                  IconSources={StaticResource IconPaths}}" />
                            <telerik:RadRibbonButton
                                telerik:ScreenTip.Description="Show less precise values by showing fewer decimal places."
                                telerik:ScreenTip.Title="Decrease Decimal"
                                Command="{Binding Path=DecreaseDecimalPlaces.Command}"
                                IsEnabled="{Binding Path=DecreaseDecimalPlaces.IsEnabled}"
                                Size="Small"
                                SmallImage="{telerik:IconResource IconRelativePath=16/decimalDecrease.png,
                                                                  IconSources={StaticResource IconPaths}}" />
                        </telerik:RadButtonGroup>
                    </telerik:RadOrderedWrapPanel>
                </telerik:RadRibbonGroup>

                <telerik:RadRibbonGroup Header="高级" IsEnabled="{Binding Path=CellsGroup.IsEnabled}">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="0" Variant="Large" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonDropDownButton
                        x:Name="InsertCellsButton"
                        telerik:ScreenTip.Description="Insert cells, rows, or columns into the sheet or table."
                        telerik:ScreenTip.Title="Insert Cells"
                        IsEnabled="{Binding Path=CellsGroupInsert.IsEnabled}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/cellsInsert.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Insert">

                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadContextMenu Padding="0" BorderThickness="0">
                                <telerik:RadMenuItem
                                    telerik:ScreenTip.Description="Add new rows, columns, cells or sheets to your workbook.&#10;                                                                                         New rows will be added above the selection and new columns will be added to the left of the selection.&#10;                                                                                         Add three columns at once by selecting three existing columns first; this also works with rows."
                                    telerik:ScreenTip.Title="Insert Cells"
                                    Command="{Binding Path=InsertCells.Command}"
                                    Header="Insert Cells..."
                                    IsEnabled="{Binding Path=InsertCells.IsEnabled, Mode=TwoWay}">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/cellsInsert.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>

                                <telerik:RadMenuSeparatorItem />

                                <telerik:RadMenuItem
                                    Command="{Binding Path=InsertRows.Command}"
                                    Header="Insert Sheet Rows"
                                    IsEnabled="{Binding Path=InsertRows.IsEnabled, Mode=TwoWay}">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/rowsInsert.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>

                                <telerik:RadMenuItem
                                    Command="{Binding Path=InsertColumns.Command}"
                                    Header="Insert Sheet Columns"
                                    IsEnabled="{Binding Path=InsertColumns.IsEnabled, Mode=TwoWay}">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/columnsInsert.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>

                                <telerik:RadMenuSeparatorItem />

                                <telerik:RadMenuItem
                                    Command="{Binding Path=InsertSheet.Command}"
                                    CommandParameter="Worksheet"
                                    Header="Insert Sheet"
                                    IsEnabled="{Binding Path=InsertSheet.IsEnabled, Mode=TwoWay}"
                                    ToolTipService.ToolTip="Insert Worksheet (F11)">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/sheetInsert.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonDropDownButton
                        x:Name="DeleteCellsButton"
                        telerik:ScreenTip.Description="Delete cells, rows, or columns from the sheet or table."
                        telerik:ScreenTip.Title="Delete Cells"
                        IsEnabled="{Binding Path=CellsGroupDelete.IsEnabled}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/cellsRemove.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Delete">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadContextMenu Padding="0" BorderThickness="0">

                                <telerik:RadMenuItem
                                    telerik:ScreenTip.Description="Delete rows, columns or cells."
                                    telerik:ScreenTip.Title="Delete Cells"
                                    Command="{Binding Path=RemoveCells.Command}"
                                    Header="Delete Cells..."
                                    IsEnabled="{Binding Path=RemoveCells.IsEnabled, Mode=TwoWay}">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/cellsRemove.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>

                                <telerik:RadMenuSeparatorItem />

                                <telerik:RadMenuItem
                                    Command="{Binding Path=RemoveRows.Command}"
                                    Header="Delete Sheet Rows"
                                    IsEnabled="{Binding Path=RemoveRows.IsEnabled, Mode=TwoWay}">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/rowsRemove.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>

                                <telerik:RadMenuItem
                                    Command="{Binding Path=RemoveColumns.Command}"
                                    Header="Delete Sheet Columns"
                                    IsEnabled="{Binding Path=RemoveColumns.IsEnabled, Mode=TwoWay}">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/columnsRemove.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>

                                <telerik:RadMenuSeparatorItem />

                                <telerik:RadMenuItem
                                    Command="{Binding Path=RemoveSheet.Command}"
                                    Header="Delete Sheet"
                                    IsEnabled="{Binding Path=RemoveSheet.IsEnabled, Mode=TwoWay}">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/sheetRemove.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonDropDownButton
                        x:Name="FormatButton"
                        telerik:ScreenTip.Description="Change the row height or column width, organize sheets, or protect or hide cells."
                        telerik:ScreenTip.Title="Format"
                        IsEnabled="{Binding Path=CellsGroupFormat.IsEnabled}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/cellsFormat.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Format">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadContextMenu Padding="0" BorderThickness="0">
                                <telerik:RadMenuGroupItem
                                    Margin="-1"
                                    Background="Transparent"
                                    BorderThickness="0"
                                    Header="Cells Size">

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=SetRowsHeight.Command}"
                                        Header="Row Height..."
                                        IsEnabled="{Binding Path=SetRowsHeight.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/rowHeight.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=AutoFitRowsHeight.Command}"
                                        Header="AutoFit Row Height"
                                        IsEnabled="{Binding Path=AutoFitRowsHeight.IsEnabled, Mode=TwoWay}" />

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=SetDefaultRowHeight.Command}"
                                        Header="Default Height..."
                                        IsEnabled="{Binding Path=SetDefaultRowHeight.IsEnabled, Mode=TwoWay}" />

                                    <telerik:RadMenuSeparatorItem />

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=SetColumnsWidth.Command}"
                                        Header="Column Width..."
                                        IsEnabled="{Binding Path=SetColumnsWidth.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/columnWidth.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=AutoFitColumnsWidth.Command}"
                                        Header="AutoFit Column Width"
                                        IsEnabled="{Binding Path=AutoFitColumnsWidth.IsEnabled, Mode=TwoWay}" />

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=SetDefaultColumnWidth.Command}"
                                        Header="Default Width..."
                                        IsEnabled="{Binding Path=SetDefaultColumnWidth.IsEnabled, Mode=TwoWay}" />

                                    <telerik:RadMenuSeparatorItem />

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Datasheet formatting"
                                        Command="{Binding Path=ShowFormatCellsDialog.Command}"
                                        Header="Format Cells..."
                                        IsEnabled="{Binding Path=ShowFormatCellsDialog.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/formatCells.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuGroupItem>
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                </telerik:RadRibbonGroup>

                <telerik:RadRibbonGroup Header="扩展" IsEnabled="{Binding Path=EditingGroup.IsEnabled}">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="0" Variant="Large" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadOrderedWrapPanel>

                        <telerik:RadRibbonDropDownButton
                            x:Name="FillButton"
                            telerik:ScreenTip.Description="Continue a pattern into one or more adjacent cells. &#13;&#13;You can fill cells in any direction and into any range of adjacent cells."
                            telerik:ScreenTip.Title="Fill"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/fillDown.png,
                                                              IconSources={StaticResource IconPaths}}"
                            Text="Fill">
                            <telerik:RadRibbonDropDownButton.DropDownContent>
                                <telerik:RadContextMenu Padding="0" BorderThickness="0">

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=FillDown.Command}"
                                        Header="Down"
                                        IsEnabled="{Binding Path=FillDown.IsEnabled, Mode=TwoWay}"
                                        ToolTipService.ToolTip="Fill Down (Ctrl+D)">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/fillDown.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                    <telerik:RadMenuItem
                                        Command="{Binding Path=FillRight.Command}"
                                        Header="Right"
                                        IsEnabled="{Binding Path=FillRight.IsEnabled, Mode=TwoWay}"
                                        ToolTipService.ToolTip="Fill Right (Ctrl+R)">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/fillRight.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=FillUp.Command}"
                                        Header="Up"
                                        IsEnabled="{Binding Path=FillUp.IsEnabled, Mode=TwoWay}"
                                        ToolTipService.ToolTip="Fill Up">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/fillUp.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=FillLeft.Command}"
                                        Header="Left"
                                        IsEnabled="{Binding Path=FillLeft.IsEnabled, Mode=TwoWay}"
                                        ToolTipService.ToolTip="Fill Left">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/fillLeft.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=ShowSeriesDialog.Command}"
                                        Header="Series..."
                                        IsEnabled="{Binding Path=ShowSeriesDialog.IsEnabled, Mode=TwoWay}"
                                        ToolTipService.ToolTip="Fill Series" />
                                </telerik:RadContextMenu>
                            </telerik:RadRibbonDropDownButton.DropDownContent>
                        </telerik:RadRibbonDropDownButton>

                        <telerik:RadRibbonDropDownButton
                            x:Name="ClearButton"
                            telerik:ScreenTip.Description="Delete everything from the cell, or selectively remove the formatting, the contents, or the comments."
                            telerik:ScreenTip.Title="Clear"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/clear.png,
                                                              IconSources={StaticResource IconPaths}}"
                            Text="Clear">
                            <telerik:RadRibbonDropDownButton.DropDownContent>
                                <telerik:RadContextMenu Padding="0" BorderThickness="0">

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Clear everything from the selected cells. &#13;&#13;All contents, formatting, and comments are cleared from the selected cells."
                                        telerik:ScreenTip.Title="Clear All"
                                        Command="{Binding Path=Clear.Command}"
                                        Header="Clear All"
                                        IsEnabled="{Binding Path=Clear.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/clear.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Clear only the formatting that is applied to the selected cells."
                                        telerik:ScreenTip.Title="Clear Formats"
                                        Command="{Binding Path=Clear.Command}"
                                        CommandParameter="Formats"
                                        Header="Clear Formats"
                                        IsEnabled="{Binding Path=Clear.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/clearFormats.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Clear only the contents in the selected cells. &#13;&#13;The formatting and comments are not cleared."
                                        telerik:ScreenTip.Title="Clear Contents (Del)"
                                        Command="{Binding Path=Clear.Command}"
                                        CommandParameter="Contents"
                                        Header="Clear Contents"
                                        IsEnabled="{Binding Path=Clear.IsEnabled, Mode=TwoWay}" />

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Clear the hyperlinks from the selected cells."
                                        telerik:ScreenTip.Title="Clear Hyperlinks"
                                        Command="{Binding Path=Clear.Command}"
                                        CommandParameter="Hyperlinks"
                                        Header="Clear Hyperlinks"
                                        IsEnabled="{Binding Path=Clear.IsEnabled, Mode=TwoWay}" />

                                    <telerik:RadMenuSeparatorItem />

                                    <telerik:RadMenuItem
                                        Command="{Binding Path=RemoveHyperlink.Command}"
                                        Header="Remove Hyperlink"
                                        IsEnabled="{Binding Path=RemoveHyperlink.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/removeHyperlink.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadContextMenu>
                            </telerik:RadRibbonDropDownButton.DropDownContent>
                        </telerik:RadRibbonDropDownButton>
                    </telerik:RadOrderedWrapPanel>

                    <telerik:RadRibbonDropDownButton
                        telerik:ScreenTip.Description="Organize your data so it's easier to analize. You can sort the selected data from smallest to largest, largest to smallest or filter out specific values."
                        telerik:ScreenTip.Title="Sort &amp; Filter"
                        IsEnabled="{Binding Path=SortAndFilterGroup.IsEnabled, Mode=TwoWay}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/sortAndFilter.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Sort &amp; Filter">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadContextMenu Padding="0" BorderThickness="0">
                                <telerik:RadMenuGroupItem
                                    Margin="-1"
                                    Background="Transparent"
                                    BorderThickness="0">

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Lowest to highest."
                                        telerik:ScreenTip.Title="Sort A to Z"
                                        Command="{Binding Path=Sort.Command}"
                                        CommandParameter="Ascending"
                                        Header="Sort A to Z"
                                        IsEnabled="{Binding Path=Sort.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/sortAscending.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Highest to lowest."
                                        telerik:ScreenTip.Title="Sort Z to A"
                                        Command="{Binding Path=Sort.Command}"
                                        CommandParameter="Descending"
                                        Header="Sort Z to A"
                                        IsEnabled="{Binding Path=Sort.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/sortDescending.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Shows the Sort dialog box to sort data based on several criteria at once."
                                        telerik:ScreenTip.Title="Sort"
                                        Command="{Binding Path=ShowSortingDialog.Command}"
                                        CommandParameter="Descending"
                                        Header="Custom sort..."
                                        IsEnabled="{Binding Path=ShowSortingDialog.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/customSort.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuSeparatorItem />

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Turn on filtering for the selected cells. Then, click the arrow in the column header to narrow down the data."
                                        telerik:ScreenTip.Title="Filter"
                                        Command="{Binding Path=SetFilterRange.Command}"
                                        Header="Filter"
                                        IsEnabled="{Binding Path=SetFilterRange.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/filter.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Clear the filter for the current range of data."
                                        telerik:ScreenTip.Title="Clear"
                                        Command="{Binding Path=ClearFilters.Command}"
                                        Header="Clear"
                                        IsEnabled="{Binding Path=ClearFilters.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/filterClear.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>

                                    <telerik:RadMenuItem
                                        telerik:ScreenTip.Description="Reapply the filter on the current range so that changes you've made are included."
                                        telerik:ScreenTip.Title="Reapply"
                                        Command="{Binding Path=ReapplyFilters.Command}"
                                        Header="Reapply"
                                        IsEnabled="{Binding Path=ReapplyFilters.IsEnabled, Mode=TwoWay}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/filterReapply.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadMenuGroupItem>
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonButton
                        telerik:ScreenTip.Description="Use advanced search options to replace text or pick other ways to narrow your search."
                        telerik:ScreenTip.Title="Find"
                        Command="{Binding Path=ShowFindAndReplaceDialog.Command}"
                        CommandParameter="Find"
                        Content="Find"
                        LargeImage="{telerik:IconResource IconRelativePath=32/findAndSelect.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large" />
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup
                    Height="92"
                    DialogLauncherCommand="{Binding ShowPageSetupDialog.Command}"
                    DialogLauncherCommandParameter="Page"
                    DialogLauncherVisibility="{Binding ShowPageSetupDialog.IsEnabled, Converter={StaticResource BoolToVisibilityValueConverter}}"
                    Header="扫描模式">

                    <StackPanel Margin="2">
                        <TextBlock Margin="0,0,0,2" Text="Gridlines" />
                        <telerik:RadWrapPanel Height="68" Orientation="Vertical">
                            <CheckBox
                                Margin="2"
                                Command="{Binding ShowGridlines.Command}"
                                Content="View"
                                IsChecked="{Binding ShowGridlines.SelectedValue, Mode=TwoWay}"
                                IsEnabled="{Binding ShowGridlines.IsEnabled}" />
                            <CheckBox
                                Margin="2"
                                Command="{Binding PrintGridlines.Command}"
                                Content="Print"
                                IsChecked="{Binding PrintGridlines.SelectedValue, Mode=TwoWay}"
                                IsEnabled="{Binding PrintGridlines.IsEnabled}" />
                        </telerik:RadWrapPanel>
                    </StackPanel>

                    <telerik:Separator />

                    <StackPanel Margin="2">
                        <TextBlock Margin="0,0,0,2" Text="Headings" />
                        <telerik:RadWrapPanel Height="68" Orientation="Vertical">
                            <CheckBox
                                Margin="2"
                                Command="{Binding ShowRowColumnHeadings.Command}"
                                Content="View"
                                IsChecked="{Binding ShowRowColumnHeadings.SelectedValue, Mode=TwoWay}"
                                IsEnabled="{Binding ShowRowColumnHeadings.IsEnabled}" />
                            <CheckBox
                                Margin="2"
                                Command="{Binding PrintRowColumnHeadings.Command}"
                                Content="Print"
                                IsChecked="{Binding PrintRowColumnHeadings.SelectedValue, Mode=TwoWay}"
                                IsEnabled="{Binding PrintRowColumnHeadings.IsEnabled}" />
                        </telerik:RadWrapPanel>
                    </StackPanel>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>

            <telerik:RadRibbonTab Header="插入">
                <telerik:RadRibbonGroup Header="Links" IsEnabled="{Binding Path=LinksGroup.IsEnabled}">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="0" Variant="Large" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonButton
                        telerik:ScreenTip.Description="Create a link in your document for quick access to webpages and files.&#13;&#13;Hyperlinks can also take you to places in your document."
                        telerik:ScreenTip.Title="Add a Hyperlink"
                        Command="{Binding Path=ShowHyperlinkDialog.Command}"
                        Content="Hyperlink"
                        IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/insertHyperlink.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large" />
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup Header="Illustrations">
                    <telerik:RadRibbonButton
                        telerik:ScreenTip.Description="Insert pictures from your computer or from other computers that you're connected to."
                        telerik:ScreenTip.Title="From File"
                        Command="{Binding Path=InsertPicture.Command}"
                        Content="Pictures"
                        IsEnabled="{Binding Path=InsertPicture.IsEnabled}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/picturesIcon.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large" />
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>

            <telerik:RadRibbonTab Header="布局">
                <telerik:RadRibbonGroup
                    telerik:ScreenTip.Title="Themes"
                    Header="Themes"
                    IsEnabled="{Binding Path=ThemesGroup.IsEnabled}">
                    <telerik:RadRibbonDropDownButton
                        telerik:ScreenTip.Description="Pick a new theme to give your document instant style and just the right personality. &#13;&#13;Each theme uses a unique set of colors, fonts and effects to create a consistent look and feel."
                        telerik:ScreenTip.Title="Themes"
                        IsOpen="{Binding ElementName=ThemeGallery, Path=IsParentDropDownOpened, Mode=TwoWay}"
                        Size="Large"
                        Text="Themes">
                        <telerik:RadRibbonDropDownButton.Content>
                            <spreadsheetControls:SmallThemePreviewControl RadSpreadsheet="{Binding ElementName=radSpreadsheet, Mode=OneTime}" />
                        </telerik:RadRibbonDropDownButton.Content>
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <spreadsheetControls:ThemeGallery x:Name="ThemeGallery" RadSpreadsheet="{Binding ElementName=radSpreadsheet, Mode=OneTime}" />
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                    <telerik:RadOrderedWrapPanel>
                        <telerik:RadRibbonDropDownButton
                            Width="73"
                            HorizontalContentAlignment="Stretch"
                            telerik:ScreenTip.Description="Quickly change all the colors used in your document by picking a different color palette. &#13;&#13;This will update the colors available to you in the color picker along with any theme colors in your document. No matter what palette you choose, your document will look perfectly coordinated."
                            telerik:ScreenTip.Title="Theme Colors"
                            IsOpen="{Binding ElementName=ColorGallery, Path=IsParentDropDownOpened, Mode=TwoWay}"
                            Size="Medium"
                            Text="Colors">
                            <telerik:RadRibbonDropDownButton.Content>
                                <spreadsheetControls:SmallThemeColorPreviewControl RadSpreadsheet="{Binding ElementName=radSpreadsheet, Mode=OneTime}" />
                            </telerik:RadRibbonDropDownButton.Content>
                            <telerik:RadRibbonDropDownButton.DropDownContent>
                                <spreadsheetControls:ColorGallery x:Name="ColorGallery" RadSpreadsheet="{Binding ElementName=radSpreadsheet, Mode=OneTime}" />
                            </telerik:RadRibbonDropDownButton.DropDownContent>
                        </telerik:RadRibbonDropDownButton>

                        <telerik:RadRibbonDropDownButton
                            Width="73"
                            HorizontalContentAlignment="Stretch"
                            telerik:ScreenTip.Description="Quickly change the text in your document by picking a new font set. &#13;&#13;This is an easy way to change all of your text at once. For this to work, your text must be formatted using the 'body' and 'heading' fonts."
                            telerik:ScreenTip.Title="Theme Fonts"
                            IsOpen="{Binding ElementName=FontGallery, Path=IsParentDropDownOpened, Mode=TwoWay}"
                            Size="Medium"
                            Text="Fonts">
                            <telerik:RadRibbonDropDownButton.Content>
                                <spreadsheetControls:SmallThemeFontPreviewControl RadSpreadsheet="{Binding ElementName=radSpreadsheet, Mode=OneTime}" />
                            </telerik:RadRibbonDropDownButton.Content>
                            <telerik:RadRibbonDropDownButton.DropDownContent>
                                <spreadsheetControls:FontGallery x:Name="FontGallery" RadSpreadsheet="{Binding ElementName=radSpreadsheet, Mode=OneTime}" />
                            </telerik:RadRibbonDropDownButton.DropDownContent>
                        </telerik:RadRibbonDropDownButton>
                    </telerik:RadOrderedWrapPanel>
                </telerik:RadRibbonGroup>
                <telerik:RadRibbonGroup
                    DialogLauncherCommand="{Binding Path=ShowPageSetupDialog.Command}"
                    DialogLauncherCommandParameter="Page"
                    DialogLauncherVisibility="{Binding Path=ShowPageSetupDialog.IsEnabled, Converter={StaticResource BoolToVisibilityValueConverter}}"
                    Header="Page Setup">
                    <telerik:RadRibbonDropDownButton
                        x:Name="PrintAreaButton"
                        telerik:ScreenTip.Description="Select an area of the sheet you'd like to print."
                        telerik:ScreenTip.Title="Print Area"
                        LargeImage="{telerik:IconResource IconRelativePath=32/printArea.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Print Area">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadContextMenu Padding="0" BorderThickness="0">
                                <telerik:RadMenuItem
                                    Command="{Binding Path=SetPrintArea.Command}"
                                    Header="Set Print Area"
                                    IsEnabled="{Binding Path=SetPrintArea.IsEnabled}">
                                    <telerik:RadMenuItem.Icon>
                                        <Image
                                            Width="16"
                                            Source="{telerik:IconResource IconRelativePath=16/setPrintArea.png,
                                                                          IconSources={StaticResource IconPaths}}"
                                            Stretch="None" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem Command="{Binding Path=ClearPrintArea.Command}" Header="Clear Print Area" />
                                <telerik:RadMenuItem
                                    Command="{Binding Path=AddToPrintArea.Command}"
                                    Header="Add to Print Area"
                                    IsEnabled="{Binding Path=AddToPrintArea.IsEnabled, Mode=TwoWay}" />
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                    <telerik:RadRibbonDropDownButton
                        x:Name="BreaksButton"
                        telerik:ScreenTip.Description="Add a break where you want the next page to begin in the printed copy. &#13;&#13;Your page break will be inserted above and to the left of your selection."
                        telerik:ScreenTip.Title="Breaks"
                        LargeImage="{telerik:IconResource IconRelativePath=32/breaks.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Breaks">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadContextMenu Padding="0" BorderThickness="0">
                                <telerik:RadMenuItem
                                    Command="{Binding Path=InsertPageBreak.Command}"
                                    Header="Insert Page Break"
                                    IsEnabled="{Binding Path=InsertPageBreak.IsEnabled, Mode=TwoWay}" />
                                <telerik:RadMenuItem
                                    Command="{Binding Path=RemovePageBreak.Command}"
                                    Header="Remove Page Break"
                                    IsEnabled="{Binding Path=RemovePageBreak.IsEnabled, Mode=TwoWay}" />
                                <telerik:RadMenuSeparatorItem />
                                <telerik:RadMenuItem Command="{Binding Path=ResetAllPageBreaks.Command}" Header="Reset All Page Breaks" />
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>

            <telerik:RadRibbonTab Header="公式">
                <telerik:RadRibbonGroup
                    telerik:ScreenTip.Title="Function Library"
                    Header="Function Library"
                    IsEnabled="{Binding Path=FunctionLibraryGroup.IsEnabled}">
                    <telerik:RadRibbonButton
                        telerik:ScreenTip.Description="Edit the formula in current cell by choosing functions and editing the arguments."
                        telerik:ScreenTip.Title="Insert Function"
                        CollapseToSmall="WhenGroupIsSmall"
                        Command="{Binding Path=ShowInsertFunctionDialog.Command}"
                        IsEnabled="{Binding Path=ShowInsertFunctionDialog.IsEnabled}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/insertFunction.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Insert Function" />

                    <telerik:Separator />

                    <telerik:RadRibbonDropDownButton
                        x:Name="AutoSumButton"
                        telerik:ScreenTip.Description="Click here to display the results of simple calculations, such as Average or Maximum Value, after the selected cells."
                        telerik:ScreenTip.Title="Auto Sum"
                        LargeImage="{telerik:IconResource IconRelativePath=32/autoSum.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Auto Sum">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadContextMenu Padding="0" BorderThickness="0">

                                <telerik:RadMenuItem
                                    telerik:ScreenTip.Description="Display the sum of the selected cells directly after the selected cells"
                                    telerik:ScreenTip.Title="Sum"
                                    Command="{Binding Path=ApplyFunction.Command}"
                                    CommandParameter="Sum"
                                    Header="Sum"
                                    IsEnabled="{Binding Path=ApplyFunction.IsEnabled, Mode=TwoWay}">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Source="{telerik:IconResource IconRelativePath=16/sum.png, IconSources={StaticResource IconPaths}}" Stretch="None" />
                                    </telerik:RadMenuItem.Icon>
                                </telerik:RadMenuItem>

                                <telerik:RadMenuItem
                                    Command="{Binding Path=ApplyFunction.Command}"
                                    CommandParameter="Average"
                                    Header="Average"
                                    IsEnabled="{Binding Path=ApplyFunction.IsEnabled, Mode=TwoWay}" />

                                <telerik:RadMenuItem
                                    Command="{Binding Path=ApplyFunction.Command}"
                                    CommandParameter="Max"
                                    Header="Max"
                                    IsEnabled="{Binding Path=ApplyFunction.IsEnabled, Mode=TwoWay}" />

                                <telerik:RadMenuItem
                                    Command="{Binding Path=ApplyFunction.Command}"
                                    CommandParameter="Min"
                                    Header="Min"
                                    IsEnabled="{Binding Path=ApplyFunction.IsEnabled, Mode=TwoWay}" />

                                <telerik:RadMenuSeparatorItem />

                                <telerik:RadMenuItem
                                    Command="{Binding Path=ShowInsertFunctionDialog.Command}"
                                    Header="More Functions..."
                                    IsEnabled="{Binding Path=ShowInsertFunctionDialog.IsEnabled, Mode=TwoWay}" />
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonDropDownButton
                        x:Name="RecentlyUsed"
                        telerik:ScreenTip.Description="Browse and select from a list of recently used functions."
                        telerik:ScreenTip.Title="Recently Used"
                        LargeImage="{telerik:IconResource IconRelativePath=32/recentlyUsed.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Recently Used">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <spreadsheetControls:FunctionsMenu
                                Category="MostRecentlyUsed"
                                DataContext="{Binding}"
                                Items="{Binding Source={StaticResource FunctionsProvider}, Path=MostRecentlyUsed}" />
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonDropDownButton
                        x:Name="Financial"
                        telerik:ScreenTip.Description="Add a financial function to your sheet."
                        telerik:ScreenTip.Title="Financial"
                        LargeImage="{telerik:IconResource IconRelativePath=32/financial.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Financial">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <spreadsheetControls:FunctionsMenu
                                BorderThickness="0"
                                Category="Financial"
                                DataContext="{Binding}"
                                Items="{Binding Source={StaticResource FunctionsProvider}, Path=Financial}" />
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonDropDownButton
                        x:Name="Logical"
                        telerik:ScreenTip.Description="Add a logical function to your sheet."
                        telerik:ScreenTip.Title="Logical"
                        LargeImage="{telerik:IconResource IconRelativePath=32/logical.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Logical">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <spreadsheetControls:FunctionsMenu
                                BorderThickness="0"
                                Category="Logical"
                                DataContext="{Binding}"
                                Items="{Binding Source={StaticResource FunctionsProvider}, Path=Logical}" />
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonDropDownButton
                        x:Name="Text"
                        telerik:ScreenTip.Description="Add a text function to your sheet."
                        telerik:ScreenTip.Title="Text"
                        LargeImage="{telerik:IconResource IconRelativePath=32/text.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Text">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <spreadsheetControls:FunctionsMenu
                                BorderThickness="0"
                                Category="Text"
                                DataContext="{Binding}"
                                Items="{Binding Source={StaticResource FunctionsProvider}, Path=Text}" />
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonDropDownButton
                        x:Name="DateAndTime"
                        telerik:ScreenTip.Description="Add a time function to your sheet."
                        telerik:ScreenTip.Title="Date &amp; Time"
                        LargeImage="{telerik:IconResource IconRelativePath=32/dateTime.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Date &amp; Time">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <spreadsheetControls:FunctionsMenu
                                BorderThickness="0"
                                Category="DateTime"
                                DataContext="{Binding}"
                                Items="{Binding Source={StaticResource FunctionsProvider}, Path=DateTime}" />
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonDropDownButton
                        x:Name="LookupAndReference"
                        telerik:ScreenTip.Description="Add a lookup or reference function to your sheet."
                        telerik:ScreenTip.Title="Lookup &amp; Reference"
                        LargeImage="{telerik:IconResource IconRelativePath=32/lookupReference.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Lookup &amp; Reference">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <spreadsheetControls:FunctionsMenu
                                BorderThickness="0"
                                Category="LookupReference"
                                DataContext="{Binding}"
                                Items="{Binding Source={StaticResource FunctionsProvider}, Path=LookupReference}" />
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonDropDownButton
                        x:Name="MathAndTrig"
                        telerik:ScreenTip.Description="Add a math or trigonometry function to your sheet."
                        telerik:ScreenTip.Title="Math &amp; Trig"
                        LargeImage="{telerik:IconResource IconRelativePath=32/mathTrig.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Math &amp; Trig">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <spreadsheetControls:FunctionsMenu
                                BorderThickness="0"
                                Category="MathTrig"
                                DataContext="{Binding}"
                                Items="{Binding Source={StaticResource FunctionsProvider}, Path=MathTrig}" />
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>

                    <telerik:RadRibbonDropDownButton
                        x:Name="MoreFunctionsButton"
                        telerik:ScreenTip.Description="Browse more functions from categories like Statistical, Engineering or Information."
                        telerik:ScreenTip.Title="More Functions"
                        LargeImage="{telerik:IconResource IconRelativePath=32/moreFunctions.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="More Functions">
                        <telerik:RadRibbonDropDownButton.DropDownContent>
                            <telerik:RadContextMenu Padding="0" BorderThickness="0">
                                <telerik:RadMenuItem Header="Statistical">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/statistical.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                    <telerik:RadMenuGroupItem BorderThickness="0">
                                        <spreadsheetControls:FunctionsMenu
                                            Margin="0"
                                            Category="Statistical"
                                            DataContext="{Binding}"
                                            Items="{Binding Source={StaticResource FunctionsProvider}, Path=Statistical}" />
                                    </telerik:RadMenuGroupItem>
                                </telerik:RadMenuItem>

                                <telerik:RadMenuItem Header="Engineering">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/engineering.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                    <telerik:RadMenuGroupItem BorderThickness="0">
                                        <spreadsheetControls:FunctionsMenu
                                            Margin="0"
                                            Category="Engineering"
                                            DataContext="{Binding}"
                                            Items="{Binding Source={StaticResource FunctionsProvider}, Path=Engineering}" />
                                    </telerik:RadMenuGroupItem>
                                </telerik:RadMenuItem>

                                <telerik:RadMenuItem Header="Information">
                                    <telerik:RadMenuItem.Icon>
                                        <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/information.png, IconSources={StaticResource IconPaths}}" />
                                    </telerik:RadMenuItem.Icon>
                                    <telerik:RadMenuGroupItem BorderThickness="0">
                                        <spreadsheetControls:FunctionsMenu
                                            Margin="0"
                                            Category="Information"
                                            DataContext="{Binding}"
                                            Items="{Binding Source={StaticResource FunctionsProvider}, Path=Information}" />
                                    </telerik:RadMenuGroupItem>
                                </telerik:RadMenuItem>
                            </telerik:RadContextMenu>
                        </telerik:RadRibbonDropDownButton.DropDownContent>
                    </telerik:RadRibbonDropDownButton>
                </telerik:RadRibbonGroup>

                <telerik:RadRibbonGroup Header="Defined Names" IsEnabled="{Binding Path=FunctionLibraryGroup.IsEnabled}">

                    <telerik:RadRibbonButton
                        telerik:ScreenTip.Description="Create, edit delete and find all the names used in the workbook. &#13;&#13;Names can be used in formulas as substitutes for cell references. &#13;&#13;For example:=SUM(Sales) instead of =SUM(C20:D30)."
                        telerik:ScreenTip.Title="Name Manager"
                        CollapseToSmall="WhenGroupIsSmall"
                        Command="{Binding Path=ShowNameManagerDialog.Command}"
                        IsEnabled="{Binding Path=ShowNameManagerDialog.IsEnabled}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/nameManager.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Name Manager" />

                    <telerik:RadOrderedWrapPanel VerticalAlignment="Top">
                        <telerik:RadRibbonSplitButton
                            telerik:ScreenTip.Description="Define and apply names."
                            telerik:ScreenTip.Title="Define Name"
                            Command="{Binding Path=ShowCreateDefinedNameDialog.Command}"
                            IsEnabled="{Binding Path=ShowCreateDefinedNameDialog.IsEnabled}"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/defineName.png,
                                                              IconSources={StaticResource IconPaths}}"
                            Text="Define Name">
                            <telerik:RadRibbonSplitButton.DropDownContent>
                                <telerik:RadContextMenu Padding="0" BorderThickness="0">
                                    <telerik:RadMenuItem
                                        Command="{Binding Path=ShowCreateDefinedNameDialog.Command}"
                                        Header="Define Name"
                                        IsEnabled="{Binding Path=ShowCreateDefinedNameDialog.IsEnabled}">
                                        <telerik:RadMenuItem.Icon>
                                            <Image Width="16" Source="{telerik:IconResource IconRelativePath=16/defineName.png, IconSources={StaticResource IconPaths}}" />
                                        </telerik:RadMenuItem.Icon>
                                    </telerik:RadMenuItem>
                                </telerik:RadContextMenu>
                            </telerik:RadRibbonSplitButton.DropDownContent>
                        </telerik:RadRibbonSplitButton>
                    </telerik:RadOrderedWrapPanel>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>

            <telerik:RadRibbonTab Header="关于">
                <telerik:RadRibbonGroup Header="Sort &amp; Filter" IsEnabled="{Binding Path=SortAndFilterGroup.IsEnabled}">

                    <telerik:RadOrderedWrapPanel>
                        <telerik:RadRibbonButton
                            telerik:ScreenTip.Description="Lowest to highest."
                            telerik:ScreenTip.Title="Sort A to Z"
                            Command="{Binding Path=Sort.Command}"
                            CommandParameter="Ascending"
                            IsEnabled="{Binding Path=Sort.IsEnabled}"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/sortAscending.png,
                                                              IconSources={StaticResource IconPaths}}" />

                        <telerik:RadRibbonButton
                            telerik:ScreenTip.Description="Highest to lowest."
                            telerik:ScreenTip.Title="Sort Z to A"
                            Command="{Binding Path=Sort.Command}"
                            CommandParameter="Descending"
                            IsEnabled="{Binding Path=Sort.IsEnabled}"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/sortDescending.png,
                                                              IconSources={StaticResource IconPaths}}" />
                    </telerik:RadOrderedWrapPanel>

                    <telerik:RadRibbonButton
                        telerik:ScreenTip.Description="Shows the Sort dialog box to sort data based on several criteria at once."
                        telerik:ScreenTip.Title="Sort"
                        Command="{Binding Path=ShowSortingDialog.Command}"
                        IsEnabled="{Binding Path=ShowSortingDialog.IsEnabled}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/sort.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Sort" />

                    <telerik:Separator />

                    <telerik:RadRibbonToggleButton
                        telerik:ScreenTip.Description="Turn on filtering for the selected cells. Then, click the arrow in the column header to narrow down the data."
                        telerik:ScreenTip.Title="Filter"
                        Command="{Binding Path=SetFilterRange.Command}"
                        IsChecked="{Binding Path=SetFilterRange.SelectedValue, Mode=TwoWay}"
                        IsEnabled="{Binding Path=SetFilterRange.IsEnabled}"
                        LargeImage="{telerik:IconResource IconRelativePath=32/filter.png,
                                                          IconSources={StaticResource IconPaths}}"
                        Size="Large"
                        Text="Filter" />
                    <telerik:RadOrderedWrapPanel>
                        <telerik:RadRibbonButton
                            telerik:ScreenTip.Description="Clear"
                            telerik:ScreenTip.Title="Clear the filter for the current range of data."
                            Command="{Binding Path=ClearFilters.Command}"
                            IsEnabled="{Binding Path=ClearFilters.IsEnabled}"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/filterClear.png,
                                                              IconSources={StaticResource IconPaths}}"
                            Text="Clear" />
                        <telerik:RadRibbonButton
                            telerik:ScreenTip.Description="Reapply"
                            telerik:ScreenTip.Title="Reapply the filter on the current range so that changes you've made are included."
                            Command="{Binding Path=ReapplyFilters.Command}"
                            IsEnabled="{Binding Path=ReapplyFilters.IsEnabled}"
                            Size="Medium"
                            SmallImage="{telerik:IconResource IconRelativePath=16/filterReapply.png,
                                                              IconSources={StaticResource IconPaths}}"
                            Text="Reapply" />
                    </telerik:RadOrderedWrapPanel>
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>

            <telerik:RadRibbonTab Header="工具">
                <telerik:RadRibbonGroup Header="图像处理">
                    <telerik:RadRibbonGroup.Variants>
                        <telerik:GroupVariant Priority="0" Variant="Large" />
                    </telerik:RadRibbonGroup.Variants>
                    <telerik:RadRibbonButton
                        Command="{Binding OpenImageProcessingCommand}"
                        Size="Large"
                        Text="图像处理" />
                    <telerik:RadRibbonButton
                        Command="{Binding OpenPipelineEditorCommand}"
                        Size="Large"
                        Text="流水线编辑器" />
                </telerik:RadRibbonGroup>
            </telerik:RadRibbonTab>

            <telerik:RadRibbonView.ContextualGroups>
                <telerik:RadRibbonContextualGroup
                    x:Name="PictureTools"
                    Header="Picture Tools"
                    IsActive="{Binding Path=PictureToolsTab.IsEnabled, Mode=OneWay}" />
            </telerik:RadRibbonView.ContextualGroups>
        </telerik:RadRibbonView>

        <!--  Row 1: 主内容区 - 比例布局  -->
        <Grid
            Grid.Row="1"
            Grid.ColumnSpan="3"
            Margin="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="180" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="350" />
            </Grid.ColumnDefinitions>

            <!--  左侧: 计划导航  -->
            <views:NavigationPanelView Grid.Column="0" />

            <!--  中间: 2D Viewport  -->
            <Border
                Grid.Column="1"
                BorderBrush="#DDDDDD"
                BorderThickness="1,0,1,0">
                <views:ViewportPanelView />
            </Border>

            <!--  右侧: 属性面板 = 内容区 + 垂直图标Tab栏  -->
            <Grid Grid.Column="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <!--  左侧: 内容区  -->
                <Grid Grid.Column="0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="300" />
                    </Grid.RowDefinitions>
                    <!--  顶部: 射线源  -->
                    <views:RaySourcePanelView Grid.Row="0" />
                    <!--  中间: 运动控制 / 探测器 / 图像 通过Tab切换  -->
                    <views:MotionControlPanelView
                        x:Name="MotionPanel"
                        Grid.Row="1"
                        Visibility="Visible" />
                    <views:DetectorPanelView
                        x:Name="DetectorPanel"
                        Grid.Row="1"
                        Visibility="Collapsed" />
                    <views:ImagePanelView
                        x:Name="ImagePanel"
                        Grid.Row="1"
                        Visibility="Collapsed" />
                    <!--  底部: Overview  -->
                    <views:NavigationPropertyPanelView Grid.Row="3" />
                </Grid>

                <!--  右侧: 垂直图标Tab栏  -->
                <Border
                    Grid.Column="1"
                    Width="36"
                    Background="#5A6A7A">
                    <StackPanel VerticalAlignment="Top">
                        <!--  关闭  -->
                        <ToggleButton
                            x:Name="BtnClose"
                            Width="36"
                            Height="36"
                            Background="Transparent"
                            BorderThickness="0"
                            Cursor="Hand"
                            ToolTip="关闭面板">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontSize="16"
                                FontWeight="Bold"
                                Foreground="White"
                                Text="✕" />
                        </ToggleButton>
                        <!--  最小化  -->
                        <ToggleButton
                            Width="36"
                            Height="36"
                            Background="Transparent"
                            BorderThickness="0"
                            Cursor="Hand"
                            ToolTip="最小化">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontSize="16"
                                FontWeight="Bold"
                                Foreground="White"
                                Text="—" />
                        </ToggleButton>
                        <!--  射线源  -->
                        <ToggleButton
                            Width="36"
                            Height="36"
                            Background="Transparent"
                            BorderThickness="0"
                            Cursor="Hand"
                            ToolTip="射线源">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontSize="18"
                                Foreground="White"
                                Text="☢" />
                        </ToggleButton>
                        <!--  探测器  -->
                        <ToggleButton
                            x:Name="BtnDetector"
                            Width="36"
                            Height="36"
                            Background="Transparent"
                            BorderThickness="0"
                            Click="OnDetectorTabClick"
                            Cursor="Hand"
                            ToolTip="探测器">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontSize="16"
                                Foreground="White"
                                Text="📷" />
                        </ToggleButton>
                        <!--  运动控制 (默认选中，橙色高亮)  -->
                        <ToggleButton
                            x:Name="BtnMotion"
                            Width="36"
                            Height="36"
                            Background="#F0A030"
                            BorderThickness="0"
                            Click="OnMotionTabClick"
                            Cursor="Hand"
                            IsChecked="True"
                            ToolTip="运动控制">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontSize="22"
                                FontWeight="Bold"
                                Foreground="#D4A017"
                                Text="✥" />
                        </ToggleButton>
                        <!--  图像  -->
                        <ToggleButton
                            x:Name="BtnImage"
                            Width="36"
                            Height="36"
                            Background="Transparent"
                            BorderThickness="0"
                            Click="OnImageTabClick"
                            Cursor="Hand"
                            ToolTip="图像">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontSize="16"
                                Foreground="White"
                                Text="🖼" />
                        </ToggleButton>
                        <!--  其他工具  -->
                        <ToggleButton
                            Width="36"
                            Height="36"
                            Background="Transparent"
                            BorderThickness="0"
                            Cursor="Hand"
                            ToolTip="工具">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontSize="15"
                                Foreground="White"
                                Text="🔧" />
                        </ToggleButton>
                        <!--  网格  -->
                        <ToggleButton
                            Width="36"
                            Height="36"
                            Background="Transparent"
                            BorderThickness="0"
                            Cursor="Hand"
                            ToolTip="网格">
                            <TextBlock
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontSize="18"
                                Foreground="White"
                                Text="⊞" />
                        </ToggleButton>
                    </StackPanel>
                </Border>
            </Grid>
        </Grid>

        <!--  Row 2: 底部工具栏  -->
        <Border
            Grid.Row="2"
            Grid.ColumnSpan="3"
            Background="#0060A0"
            BorderBrush="#004880"
            BorderThickness="0,1,0,0">
            <Border.Resources>
                <Style x:Key="TbBtn" TargetType="Button">
                    <Setter Property="MinWidth" Value="28" />
                    <Setter Property="Height" Value="24" />
                    <Setter Property="Padding" Value="5,0" />
                    <Setter Property="Background" Value="Transparent" />
                    <Setter Property="Foreground" Value="#CCCCCC" />
                    <Setter Property="BorderThickness" Value="0" />
                    <Setter Property="FontFamily" Value="Microsoft YaHei UI" />
                    <Setter Property="FontSize" Value="11" />
                    <Setter Property="Cursor" Value="Hand" />
                    <Setter Property="VerticalContentAlignment" Value="Center" />
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background" Value="#0080D0" />
                            <Setter Property="Foreground" Value="White" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground" Value="#555555" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
                <Style x:Key="TbSep" TargetType="Rectangle">
                    <Setter Property="Width" Value="1" />
                    <Setter Property="Fill" Value="#3090D0" />
                    <Setter Property="Margin" Value="2,4" />
                </Style>
            </Border.Resources>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <!--  左侧: 功能按钮组  -->
                <StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center">
                    <!--  1.实时模式  -->
                    <Button Content="Live" Style="{StaticResource TbBtn}" ToolTip="激活X射线实时模式" />
                    <!--  2.加载图像  -->
                    <Button Style="{StaticResource TbBtn}" ToolTip="加载图像"
                            Command="{Binding OpenFileCommand}" Content="📂" FontSize="13" />
                    <!--  3.保存图像  -->
                    <Button Style="{StaticResource TbBtn}" ToolTip="保存当前X射线实时图像" Content="💾" FontSize="13" />
                    <!--  4.冻结图像  -->
                    <Button Content="Snap" Style="{StaticResource TbBtn}" ToolTip="冻结当前X射线实时图像" />
                    <Rectangle Style="{StaticResource TbSep}" />
                    <!--  5.中心十字线  -->
                    <Button Content="✚" Style="{StaticResource TbBtn}" ToolTip="中心十字线" />
                    <!--  6.行灰度分布  -->
                    <Button Content="📊" FontSize="13" Style="{StaticResource TbBtn}" ToolTip="行灰度分布" />
                    <!--  7.画圆  -->
                    <Button Content="○" Style="{StaticResource TbBtn}" ToolTip="画圆" />
                    <!--  8.画圆柱  -->
                    <Button Content="▭" Style="{StaticResource TbBtn}" ToolTip="画圆柱" />
                    <!--  9.白背景检测黑区域  -->
                    <Button Content="◻" Style="{StaticResource TbBtn}" ToolTip="白背景检测黑区域" />
                    <!--  10.黑背景检测白区域  -->
                    <Button Content="◼" Style="{StaticResource TbBtn}" ToolTip="黑背景检测白区域" />
                    <Rectangle Style="{StaticResource TbSep}" />
                    <!--  11.ΣGv 图像信息  -->
                    <Button Content="ΣGv" Style="{StaticResource TbBtn}" ToolTip="在主界面显示图像信息" />
                    <!--  12.Dose 自动化检测  -->
                    <Button Content="Dose" Style="{StaticResource TbBtn}" ToolTip="自动化检测程序" />
                    <!--  13.探测器控制  -->
                    <Button Content="Mats" Style="{StaticResource TbBtn}" ToolTip="探测器控制按钮" />
                    <!--  14.关于  -->
                    <Button Content="Allo" Style="{StaticResource TbBtn}" ToolTip="显示关于XMC窗口" />
                    <!--  15.Auto  -->
                    <Button Content="Auto" Style="{StaticResource TbBtn}" ToolTip="自动模式" />
                    <Rectangle Style="{StaticResource TbSep}" />
                    <!--  16.开门  -->
                    <Button Content="🚪" FontSize="13" Style="{StaticResource TbBtn}" ToolTip="开门" />
                    <!--  17.关门  -->
                    <Button Content="🔒" FontSize="13" Style="{StaticResource TbBtn}" ToolTip="关门" />
                    <Rectangle Style="{StaticResource TbSep}" />
                    <!--  18.Out 缩小  -->
                    <Button Content="Out" Style="{StaticResource TbBtn}" ToolTip="缩小" />
                    <!--  19.In 放大  -->
                    <Button Content="In" Style="{StaticResource TbBtn}" ToolTip="放大" />
                    <Rectangle Style="{StaticResource TbSep}" />
                    <!--  20.系统参数  -->
                    <Button Content="i" FontWeight="Bold" Style="{StaticResource TbBtn}" ToolTip="系统参数显示" />
                    <!--  21.帮助  -->
                    <Button Content="?" Foreground="#FF4444" FontWeight="Bold"
                            Style="{StaticResource TbBtn}" ToolTip="帮助文档" />
                </StackPanel>

                <!--  右侧: 鼠标坐标 + RGB  -->
                <TextBlock Grid.Column="1" VerticalAlignment="Center" Margin="8,0"
                           FontFamily="Consolas" FontSize="11" Foreground="#AAAAAA"
                           Text="x: 0  y: 0  RGB: 0 0 0" />

                <!--  防撞标识  -->
                <Border Grid.Column="2" Margin="4,2" Padding="8,0"
                        Background="#228B22" CornerRadius="2">
                    <TextBlock VerticalAlignment="Center"
                               FontFamily="Microsoft YaHei UI" FontSize="11"
                               FontWeight="Bold" Foreground="White"
                               Text="CRASH  ON" />
                </Border>
            </Grid>
        </Border>
    </Grid>
</telerik:RadRibbonWindow>