2009-10-20 76 views
-1

菜單項和所有其它菜單未啓用`` 的xmlns:d = 「http://schemas.microsoft.com/expression/blend/2008」 的xmlns:MC =「HTTP:// schemas.openxmlformats.org/markup-compatibility/2006「 xmlns:charting =」clr-namespace:System.Windows.Controls.DataVisualization.Charting; assembly = System.Windows.Controls.DataVisualization.Toolkit「
x:Class = 「WpfApplication4.MainWindow」 的xmlns:WA = 「CLR的命名空間:WpfApplication4」 標題= 「淨容積花花公子」 X:NAME = 「RibbonWindow」 圖標= 「圖片\的icon.png」 WIDTH = 「795」 MC: Ignorable =「d」WindowStartupLocation =「CenterScreen」WindowState =「最大化」Closing =「Win dow_Closing」關= 「WINDOW_CLOSED」 IsTabStop = 「假」> `使色帶控制

<!--RibbonWindow Resource Dictionary--> 
<r:RibbonWindow.Resources> 
    <ResourceDictionary> 

     <!--Ribbon Commands--> 
     <r:RibbonCommand x:Key="cmdPrint" CanExecute="RibbonCommand_CanExecute_Print" LabelTitle="Print" LabelDescription="Print" ToolTipTitle="Help" ToolTipDescription="This is used to Print" SmallImageSource="Images\printIcon.png" LargeImageSource="Images\printIcon.png" /> 
     <r:RibbonCommand x:Key="cmdExit" CanExecute="RibbonCommand_CanExecute_Close" LabelTitle="Close" LabelDescription="Close" ToolTipTitle="Help" ToolTipDescription="Close Application" SmallImageSource="Images\exitIcon.png" LargeImageSource="Images\exitIcon.png" /> 
     <r:RibbonCommand x:Key="cmdHelp" CanExecute="RibbonCommand_CanExecute_Help" LabelTitle="About" LabelDescription="Help" ToolTipTitle="Help" ToolTipDescription="About Application" SmallImageSource="Images\ICON.png" LargeImageSource="Images\ICON.png" /> 

     <!--Theme--> 
     <ResourceDictionary.MergedDictionaries> 
      <ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Blue.xaml" /> 
     </ResourceDictionary.MergedDictionaries> 
    </ResourceDictionary> 
</r:RibbonWindow.Resources> 

<!--Root Grid--> 




    <DockPanel>  
    <r:Ribbon DockPanel.Dock="Top" Title="Volume Net Dude " x:Name="ribbon" BorderBrush="Orange"> 
     <r:Ribbon.SelectedTab> 
      <r:RibbonTab/> 
     </r:Ribbon.SelectedTab> 

     <!--Quick Access Toolbar--> 
     <r:Ribbon.QuickAccessToolBar> 
      <r:RibbonQuickAccessToolBar> 
       <r:RibbonButton Command="{StaticResource cmdExit}" /> 
       <r:RibbonButton Command="{StaticResource cmdPrint}" /> 
       <r:RibbonButton Command="{StaticResource cmdHelp}"/> 
      </r:RibbonQuickAccessToolBar> 
     </r:Ribbon.QuickAccessToolBar> 

     <r:Ribbon.ApplicationMenu>     
      <r:RibbonApplicationMenu IsEnabled="True" > 
       <r:RibbonApplicationMenu.Command> 
        <r:RibbonCommand Executed="RibbonCommand_Executed" SmallImageSource="Images\ICON.png" LargeImageSource="Images\ICON.png" /> 
       </r:RibbonApplicationMenu.Command> 

       <r:RibbonApplicationMenuItem Command="{StaticResource cmdPrint}" /> 
       <r:RibbonApplicationMenuItem Command="{StaticResource cmdExit}" /> 
       <r:RibbonApplicationMenuItem Command="{StaticResource cmdHelp}" /> 

      </r:RibbonApplicationMenu> 
     </r:Ribbon.ApplicationMenu> 
     <r:RibbonTab x:Name="HomeTab" Label="Home" IsSelected="True"> 
      <r:RibbonGroup Name="FileGroup"> 
       <r:RibbonGroup.Command> 
        <r:RibbonCommand LabelTitle="Home" /> 
       </r:RibbonGroup.Command> 
       <r:RibbonButton Name="menuExit" Content="Exit" Command="{StaticResource cmdExit}"/> 
       <r:RibbonButton Name="menuPrint" Content="Print" Command="{StaticResource cmdPrint}"/> 
      </r:RibbonGroup> 
     </r:RibbonTab> 
     <r:RibbonTab x:Name="HelpTab" Label="Help"> 
      <r:RibbonGroup Name="HelpGroup"> 
       <r:RibbonGroup.Command> 
        <r:RibbonCommand LabelTitle="Help" /> 
       </r:RibbonGroup.Command> 

       <r:RibbonButton Name="menuAbout" Content="About" Command="{StaticResource cmdHelp}"/> 
      </r:RibbonGroup> 
     </r:RibbonTab> 
    </r:Ribbon> 

    <Grid Background="#FFE5F1FE"> 
    <TabControl x:Name="tabControlMain" Margin="1,0,0.1,0" Background="#FFFCFCFC"> 
    <TabItem Header="Tab Header # 1" Background="#FFDA0000"> 
       <Grid x:Name="GridMain" Margin="-5.333,-2.554,-3.767,-4.334" Background="Transparent"> 
      <Grid.ColumnDefinitions> 
       <ColumnDefinition Width="Auto"/> 
       <ColumnDefinition Width="*"/>   
      </Grid.ColumnDefinitions> 
       <!--[START] Epander for Tree View placed in Column 0 (the most left column) --> 
       <Expander Grid.Column="0" x:Name="expanderViewBoxDisvoceredTreeNodes" IsExpanded="True" 
         ExpandDirection="Left" HorizontalAlignment="Left" HorizontalContentAlignment="Left" 
         VerticalContentAlignment="Stretch" Width="193.333" Expanded="expanderViewBoxDisvoceredTreeNodes_Expanded" Collapsed="expanderViewBoxDisvoceredTreeNodes_Collapsed" Cursor="Arrow"> 
        <TreeView IsEnabled="True" x:Name="discoveredNodes" Visibility="Visible" Margin="0,1" Width="173.333" Initialized="discoveredNodes_Initialized" MouseDoubleClick="discoveredNodes_MouseDoubleClick" Background="#FFE5F1FE" > 
         <TreeViewItem x:Name="discNodesTreVuItm" IsExpanded="True" Height="Auto" Width="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"/>        

        </TreeView> 

       </Expander> 

       <Grid Grid.Column="1"> 
        <Grid.RowDefinitions> 
         <RowDefinition Height="0.043*"/> 
         <RowDefinition Height="0.957*"/> 
         <RowDefinition Height="Auto"/> 
        </Grid.RowDefinitions> 

        <!--[Start] Charting Row 0-->    
        <!--Viewbox Name="ChartViewbox" Grid.Row="0" Stretch="Uniform" --> 

        <!--chartingToolkit:Chart x:Name="mainChart" Grid.Row="0" Margin="0,8,8,8" Title="Chart Title" Height="Auto" Width="Auto"> 
        <chartingToolkit:Chart.DataContext> 
         <PointCollection>1,10 2,20 3,30 4,40</PointCollection> 
        </chartingToolkit:Chart.DataContext> 
        <chartingToolkit:ColumnSeries DependentValuePath="X" IndependentValuePath="Y" ItemsSource="{Binding}"/> 
       </chartingToolkit:Chart--> 

       <Grid Grid.RowSpan="2"> 

    <charting:Chart x:Name="mainChart" Grid.Row="0" Margin="0,8,8,8" Title="Net Volume Usage" Height="Auto" Width="Auto" LegendTitle="Volume" Background="#FFE5F1FE"/> 
    <Canvas HorizontalAlignment="Right" Margin="0,17,17,0" VerticalAlignment="Top" Width="25" Height="25"> 
     <WA:FrontEndWaiting Width="50" Height="50" x:Name="animatedIcon" 
    RenderTransformOrigin="0.44,0.44" d:LayoutOverrides="HorizontalAlignment, VerticalAlignment, Width, Height" Canvas.Left="-25"/> 
    </Canvas> 

</Grid> 



        <Expander x:Name="expanderVolumeDataTable" Grid.Row="2" IsExpanded="True" ExpandDirection="Up" 
           Collapsed="expanderVolumeDataTable_Collapsed" Expanded="expanderVolumeDataTable_Expanded" Header="" Margin="0,10,8,10" > 

          <Custom:DataGrid x:Name="dataGridRunningVolume" AlternationCount="2" Margin="0,0,0,0" AutoGenerateColumns="True" ItemsSource="{Binding}" AlternatingRowBackground="#FFCDE1FC" BorderBrush="Black" RowBackground="#FFD8E8FC"/> 

         </Expander>   

       </Grid> 



     </Grid> 

    </TabItem> 


</TabControl> 
</Grid> 
</DockPanel> 

+1

老兄,哪裏還有問題嗎? – demoncodemonkey 2009-10-20 09:02:49

+0

如何啓用功能區命令?抱歉,我忘記編輯問題 – 2009-10-20 09:32:36

+1

+1分享您自己的問題的答案 – citronas 2010-07-29 13:18:19

回答

0
<r:RibbonWindow.Resources> 
    <ResourceDictionary> 

     <r:RibbonCommand Executed="RibbonCommand_Executed" x:Key="cmdPrint" LabelTitle="Print" LabelDescription="Print" ToolTipTitle="Help" ToolTipDescription="This is used to Print" SmallImageSource="Images\printIcon.png" LargeImageSource="Images\printIcon.png" /> 
     <r:RibbonCommand Executed="RibbonCommand_Executed_Exit" x:Key="cmdExit" LabelTitle="Close" LabelDescription="Close" ToolTipTitle="Help" ToolTipDescription="Close Application" SmallImageSource="Images\exitIcon.png" LargeImageSource="Images\exitIcon.png" /> 
     <r:RibbonCommand Executed="RibbonCommand_Executed" x:Key="cmdHelp" LabelTitle="About" LabelDescription="Help" ToolTipTitle="Help" ToolTipDescription="About Application" SmallImageSource="Images\vdiWorksIcon.png" LargeImageSource="Images\vdiWorksIcon.png" /> 
     <r:RibbonCommand x:Key="testCmd" Executed="RibbonCommand_Executed" LabelTitle="Test Command" ToolTipDescription="test command" SmallImageSource="Images\ICON.png" LargeImageSource="Images\ICON.png"/> 

     <!--Theme--> 
     <ResourceDictionary.MergedDictionaries> 
      <ResourceDictionary Source="/RibbonControlsLibrary;component/Themes/Office2007Blue.xaml" /> 
     </ResourceDictionary.MergedDictionaries> 

    </ResourceDictionary> 
</r:RibbonWindow.Resources> 

100%正確的工作