WPF Telerik控件在设计模式下不可见

时间:2017-04-30 17:35:12

标签: wpf telerik

我在WPF / C#项目上使用Telerik框架,并且控件在设计中不可见。当我运行应用程序时,控件(例如,RadButton)显示正常。为什么会这样?虽然默认控件正常工作

    <Window x:Class="TelerikWpfApp4.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
            Title="MainWindow" Height="350" Width="525">
<Grid>
    <telerik:RadRadioButton x:Name="radRadioButton" Content="Button" HorizontalAlignment="Left" Height="Auto" IsChecked="False" VerticalAlignment="Top" Width="Auto" Margin="24,42,0,0"/>
    <telerik:RadListBox HorizontalAlignment="Left" VerticalAlignment="Top" Width="250">
        <telerik:RadListBoxItem Content="Item 1"/>
        <telerik:RadListBoxItem Content="Item 2"/>
        <telerik:RadListBoxItem Content="Item 3"/>
    </telerik:RadListBox>
    <telerik:RadToggleButton x:Name="radToggleButton" Content="Button" HorizontalAlignment="Left" Height="Auto" IsThreeState="False" IsChecked="False" VerticalAlignment="Top" Width="Auto"/>
    <telerik:DataFormDateField HorizontalAlignment="Left" VerticalAlignment="Top" Margin="322,85,0,0"/>
    <telerik:RadSplitButton Content="Button" HorizontalAlignment="Left" Height="Auto" IsOpen="False" IsChecked="False" VerticalAlignment="Top" Width="Auto"/>
    <telerik:RadSplitButton Content="Button" HorizontalAlignment="Left" Height="Auto" IsOpen="False" IsChecked="False" VerticalAlignment="Top" Width="Auto"/>
    <telerik:RadRadioButton x:Name="radRadioButton1" Content="Button" HorizontalAlignment="Left" Height="Auto" IsChecked="False" VerticalAlignment="Top" Width="Auto"/>
    <Button x:Name="button" Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="175,142,0,0"/>
    <telerik:RadButton x:Name="radButton" Content="segfsdhshdh" HorizontalAlignment="Left" Height="Auto" VerticalAlignment="Top" Width="Auto" Margin="21,32,0,0"/>

</Grid>

1 个答案:

答案 0 :(得分:0)

我以前遇到过此问题,这与我使用的引用程序集有关。 Telerik有两种程序集引用类型xaml和noxaml,一旦删除了引用并将其替换为正确的引用,就没有问题了。这是有关此问题的Telerik文档的几个链接:

https://docs.telerik.com/devtools/wpf/common-information/troubleshooting/invisible-controls

https://docs.telerik.com/devtools/wpf/styling-and-appearance/xaml-vs-noxaml