简体   繁体   English

Visual Studio 设计器为空

[英]Visual Studio Designer empty

Iam creating an WPF application within Visual Studio 2017. For a time everything was fine but at some time (I expect when I introduced telerik elements, but not for sure) my Xaml Designer is just an empty rectangle with nothing inside.我正在 Visual Studio 2017 中创建 WPF 应用程序。有一段时间一切都很好,但有时(我预计当我介绍 telerik 元素时,但不确定)我的 ZA02CFBC297A3D1 设计器只是一个空的矩形,里面什么都没有。869ZF9A57 The Applikation works fine when executed, all Gui Elements show up but not in the Designer.应用程序在执行时工作正常,所有 Gui 元素都显示但不在设计器中。 This offcourse is an problem since I want to customize the Gui further.因为我想进一步定制 Gui,所以这个课程是个问题。 Iam unsure if this issue is Telerik, Code or Visual Studio related.我不确定此问题是否与 Telerik、代码或 Visual Studio 相关。 But I suspect some faulty telerik Code to be the main culprit.但我怀疑一些错误的 telerik 代码是罪魁祸首。 Here a trimmed down Version o the Xaml Code I use:这是我使用的 Xaml 代码的精简版本:

<telerik:RadWindow x:Class="XY.Views.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"
                xmlns:navigation="clr-namespace:Telerik.Windows.Controls.Navigation;assembly=Telerik.Windows.Controls.Navigation"
                navigation:RadWindowInteropHelper.ShowInTaskbar="True"
                 Header="BSD Reader" Height="400" Width="750" WindowStartupLocation="CenterScreen">

    <!-- Grid Definition -->
    <Grid Margin="0,0,0,0" >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="3*" MinWidth="290" >
            </ColumnDefinition>
            <ColumnDefinition Width="200" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition  Height="Auto" MinHeight="25"/>
            <RowDefinition Height="Auto" MaxHeight="250" MinHeight="30"/>
            <RowDefinition  Height="Auto" MaxHeight="250" MinHeight="150"/>
            <RowDefinition  Height="Auto" MaxHeight="250" MinHeight="150"/>
        </Grid.RowDefinitions>


        <!--Grid 0/0  Menü Band-->
        <telerik:RadMenu Grid.ColumnSpan="2">

            </telerik:RadMenuItem>

            <telerik:RadMenuItem Header="View" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">

            </telerik:RadMenuItem>
        </telerik:RadMenu>

        <!--Grid 1/1-->
        <telerik:RadComboBox >

        </telerik:RadComboBox>

        <!--Grid 1/2-->
        <GroupBox x:Name="gb_Info" Grid.Column="1" Grid.Row="2" Header="Information" 
                  Margin="0,0,0,0" />

        <!--Grid 1/3-->
        <GroupBox x:Name="gb_FileInfo" Grid.Column="1" Grid.Row="3" Header="File Information" 
                  Margin="0,0,0,0" />


        <!--Grid 2/0-->
        <telerik:RadGridView x:Name="XY" Grid.Row="1" Grid.RowSpan="2"  
                         ShowSearchPanel="True"  ShowGroupPanel="False" ItemsSource="{Binding Signals, UpdateSourceTrigger=PropertyChanged}" 
                             AutoGenerateColumns="False">
            <telerik:RadGridView.Columns >
                <telerik:GridViewDataColumn DataMemberBinding="{Binding xxx}"     />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding xxx}"     />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding xxx}"     />

            </telerik:RadGridView.Columns>
        </telerik:RadGridView>


        <telerik:RadPaneGroup Grid.Row="3" >

            <telerik:RadPane Header="XY" PaneHeaderVisibility="Hidden">
                <telerik:RadTreeListView>
                    <telerik:RadTreeListView.ChildTableDefinitions>

                    </telerik:RadTreeListView.ChildTableDefinitions>
                </telerik:RadTreeListView>
            </telerik:RadPane>

        </telerik:RadPaneGroup>



    </Grid>
</telerik:RadWindow>

not much to see, i know, but thats kinda the point ^^没什么可看的,我知道,但这就是重点^^

没什么可看的,我知道,但这就是重点^^

If you are using No-XAML assemblies, make sure your main application class is called App within App.cs and App.xaml.cs files.如果您使用的是 No-XAML 程序集,请确保您的主应用程序 class 在App.csApp.xaml.cs文件中称为App

I've stumbled into the same problem when adding Telerik No-Xaml controls to an existing.Net Core 3.1 WPF application.将 Telerik No-Xaml 控件添加到现有的.Net Core 3.1 WPF 应用程序时,我偶然发现了同样的问题。 Merged dictionaries were set up according Telerik guidance , but XAML designer was showing only a blank rectangle.合并字典是根据Telerik 指导设置的,但 XAML 设计器只显示一个空白矩形。 After renaming the app class back to default App everything went back to normal.将应用程序 class 重命名为默认应用程序后,一切恢复正常。

I had this issues as well and tried all the solutions above.我也有这个问题,并尝试了上面的所有解决方案。 Solution I found was to toggle project code in the designer and everything is working now.我发现的解决方案是在设计器中切换项目代码,现在一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM