我在我的应用程序中使用Telerik WPF UI RadRibbonWindow
,RadRibbonView
。我在RadRibbonWindow
课程中继承了MainWindow
。我已经为相同版本添加了适当的Dll,但是在Window中看不到该控件。如何解决此可见性问题?该项目正在顺利建设。
答案 0 :(得分:0)
<telerik:RadRibbonWindow x:Class="WpfApplication2.MainWindow"
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:local="clr-namespace:WpfApplication2"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<telerik:RadRibbonView x:Name="theRibbon" Grid.Row="0" Grid.ColumnSpan="3">
<!-- Ribbon Tab #1: Home -->
<telerik:RadRibbonTab Header="Home" telerik:KeyTipService.AccessText="H">
<telerik:RadRibbonGroup Header="Clipboard">
<telerik:RadRibbonButton LargeImage="/Resources/Icons/cut.png" Text="Cut"/>
<telerik:RadRibbonButton LargeImage="/Resources/Icons/paste.png" Text="Paste" />
<telerik:RadRibbonButton LargeImage="/Resources/Icons/copy.png" Text="Copy" />
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="Show">
<telerik:RadRibbonButton Text="Close Table" Size="Large"
LargeImage="/Resources/Icons/closetable.png"/>
<telerik:RadRibbonButton Text="Close All" Size="Large"
LargeImage="/Resources/Icons/closeall.png"/>
<!--<Fluent:Button Header="Close Table" Click="CloseTable_Click" SizeDefinition="Large, Middle, Small"
Icon="/Resources/Icons/closetable.png" LargeIcon="/Resources/Icons/closetable.png"/>-->
<StackPanel Orientation="Horizontal" Margin="2">
<CheckBox IsChecked="True"
VerticalAlignment="Center" HorizontalAlignment="Center" Width="15" Height="15"
/>
<telerik:Label Content="Status bar" Padding="0" Margin="5,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<CheckBox VerticalAlignment="Center" IsChecked="True"
HorizontalAlignment="Center" Width="15" Height="15">
</CheckBox>
<telerik:Label Content="Folder list" Padding="0" Margin="5,0,0,0"/>
</StackPanel>
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="Publish">
<telerik:RadRibbonButton Name="printBtn" LargeImage="/Resources/Icons/print.png" Text="Print..." telerik:KeyTipService.AccessText="P" />
<telerik:RadRibbonButton Name="exportBtn" LargeImage="/Resources/Icons/export.png" Text="Export..." telerik:KeyTipService.AccessText="E" />
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="Edit">
<telerik:RadToggleButton Name="lockBtn" />
<telerik:RadRibbonButton Name="appendRowBtn" Size="Large, Medium, small" SmallImage="/Resources/Icons/appendrow.png"
LargeImage="/Resources/Icons/appendrow.png" Text="Append Row" />
<telerik:RadRibbonButton Name="addAboveBtn" LargeImage="/Resources/Icons/addabove.png"
Text="Add Above" VerticalContentAlignment="Center"/>
<telerik:RadRibbonButton Name="addBelowBtn" LargeImage="/Resources/Icons/addbelow.png" Text="Add Below" />
<telerik:RadRibbonButton Name="deleteRowBtn" LargeImage="/Resources/Icons/deleterow.png" Text="Delete Row" />
<telerik:RadRibbonButton Name="commitBtn" Size="Medium" SmallImage="/Resources/Icons/commit.png" Text="Commit" />
<telerik:RadRibbonButton Name="rollbackBtn" Size="Medium" SmallImage="/Resources/Icons/commit.png" Text="Rollback"/>
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="Font">
<StackPanel Orientation="Horizontal" Margin="2,5">
<telerik:RadComboBox Name="fontComboBox" Width="120" Margin="0" IsEditable="True"
ToolTip="Font" SelectedIndex="0"
IsReadOnly="True" >
<telerik:RadComboBoxItem Content="Time New Roman"/>
<telerik:RadComboBoxItem Content="Arial"/>
<telerik:RadComboBoxItem Content="Century Gothic"/>
<telerik:RadComboBoxItem Content="Comic Sans MS"/>
<telerik:RadComboBoxItem Content="Calibri"/>
</telerik:RadComboBox>
<telerik:RadComboBox Name="fontSizeComboBox" Width="40"
ToolTip="Font Size"
SelectedIndex="1"
IsReadOnly="True"
IsEditable="True"
Margin="0" >
<telerik:RadComboBoxItem Content="10"/>
<telerik:RadComboBoxItem Content="12"/>
<telerik:RadComboBoxItem Content="14"/>
<telerik:RadComboBoxItem Content="16"/>
<telerik:RadComboBoxItem Content="18"/>
</telerik:RadComboBox>
<StackPanel Orientation="Horizontal" Margin="2">
<CheckBox Name="AltCheckBox" Width="20" VerticalAlignment="Center" />
<TextBlock VerticalAlignment="Center" Text="Alternate"/>
</StackPanel>
</StackPanel>
</telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="Search">
<TextBox x:Name="searchBox" FocusManager.IsFocusScope="True" Margin="2"
HorizontalAlignment="Right" VerticalAlignment="Center" />
</telerik:RadRibbonGroup>
</telerik:RadRibbonTab>
</telerik:RadRibbonView>
我继承为: public partial class MainWindow:RadRibbonWindow {public MainWindow(){InitializeComponent(); }
我添加的dll: Telerik.Windows.Controls,Telerik.Windows.Controls.Input,Telerik.Windows.Controls.Navigation,Telerik.Windows.Controls.RibbonView,我已经添加了相同版本的这些程序集。 2016.2.613.45我正在使用VS2013 Telerik.Windows.Controls.Data,我应该在代码中做出哪些更改,以便RadRibbonWindow在mainWindow中可见,这里我创建了WPF应用程序项目。