我正在使用telerik RadRichTextBox控件和RadRichTextBoxRibbonUI为我的用户提供一些New,Open和Save As按钮。在我的另存为中我没有看到docx,pdf或html的保存类型选项。我只是得到了xaml。我想我的项目中缺少一些程序集引用,但我无法弄清楚哪一个。这是一些代码。
<UserControl x:Class="WpfControlLibrary1.MyView"
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:iy="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:is="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:prism="http://www.codeplex.com/prism"
xmlns:local="clr-namespace:WpfControlLibrary1"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:telerikXaml="clr-namespace:Telerik.Windows.Documents.FormatProviders.Xaml;assembly=Telerik.Windows.Documents.FormatProviders.Xaml"
xmlns:telerikPdf="clr-namespace:Telerik.Windows.Documents.FormatProviders.Pdf;assembly=Telerik.Windows.Documents.FormatProviders.Pdf"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="800">
<UserControl.Resources>
<ResourceDictionary>
<DataTemplate x:Key="PopupWindow">
<Grid Width="250" Height="200">
<TextBlock Text="Hello"></TextBlock>
</Grid>
</DataTemplate>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Dictionary1.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid x:Name="Layout">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<telerik:RadRichTextBoxRibbonUI
ApplicationName="Test Rich Textbox"
DataContext="{Binding Path=Commands, ElementName=radRich}"
Name="radRichTextBoxRibbonUI"
BackstageClippingElement="{Binding ElementName=Layout}">
<telerik:RadRichTextBoxRibbonUI.Backstage>
<telerik:RadRibbonBackstage>
<telerik:RadRibbonBackstageItem Header="New"
IsSelectable="False"
telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=NewDocumentCommand}"></telerik:RadRibbonBackstageItem>
<telerik:RadRibbonBackstageItem Header="Open"
IsSelectable="False"
telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=OpenDocumentCommand}"></telerik:RadRibbonBackstageItem>
<telerik:RadRibbonBackstageItem Header="Save"
IsSelectable="False"
telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}"></telerik:RadRibbonBackstageItem>
<telerik:RadRibbonBackstageItem Header="Save As"
IsDefault="False">
<StackPanel HorizontalAlignment="Stretch" Margin="20,20,0,0">
<TextBlock Text="Save As"></TextBlock>
<Rectangle HorizontalAlignment="Left" Width="410"></Rectangle>
<StackPanel Margin="0,30,0,0" Orientation="Horizontal">
<telerik:RadRibbonButton BorderBrush="Gray"
CornerRadius="3"
Height="80"
Width="90"
CommandParameter="docx"
telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}">
<StackPanel Width="90">
<Image HorizontalAlignment="Center"></Image>
</StackPanel>
</telerik:RadRibbonButton>
<StackPanel Margin="20,0,0,0">
<TextBlock Text="Word Document"/>
<TextBlock Text="Save the file as a Word document."
TextWrapping="Wrap"
Width="300"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="0,30,0,0" Orientation="Horizontal">
<telerik:RadRibbonButton BorderBrush="Gray"
CornerRadius="3"
Height="80"
Width="90"
CommandParameter="pdf"
telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}">
<StackPanel Width="90">
<Image HorizontalAlignment="Center"></Image>
</StackPanel>
</telerik:RadRibbonButton>
<StackPanel Margin="20,0,0,0">
<TextBlock Text="Pdf Document"/>
<TextBlock Text="Save the file as a Pdf document."
TextWrapping="Wrap"
Width="300"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="0,30,0,0" Orientation="Horizontal">
<telerik:RadRibbonButton BorderBrush="Gray"
CornerRadius="3"
Height="80"
Width="90"
CommandParameter="xaml"
telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=SaveCommand}">
<StackPanel Width="90">
<Image HorizontalAlignment="Center"></Image>
</StackPanel>
</telerik:RadRibbonButton>
<StackPanel Margin="20,0,0,0">
<TextBlock Text="Xaml Document"/>
<TextBlock Text="Save the file as a Xaml document."
TextWrapping="Wrap"
Width="300"/>
</StackPanel>
</StackPanel>
</StackPanel>
</telerik:RadRibbonBackstageItem>
</telerik:RadRibbonBackstage>
</telerik:RadRichTextBoxRibbonUI.Backstage>
</telerik:RadRichTextBoxRibbonUI>
<telerik:RadRichTextBox x:Name="radRich" Grid.Row="1">
</telerik:RadRichTextBox>
</Grid>
答案 0 :(得分:0)
这是我的错误,我没有将telerik引用包含在shell项目中。