Search code examples
wpfvisual-studioxamltelerik

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. The Applikation works fine when executed, all Gui Elements show up but not in the Designer. This offcourse is an problem since I want to customize the Gui further. Iam unsure if this issue is Telerik, Code or Visual Studio related. But I suspect some faulty telerik Code to be the main culprit. Here a trimmed down Version o the Xaml Code I use:

<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 ^^

not much to see, i know, but thats kinda the point ^^


Solution

  • If you are using No-XAML assemblies, make sure your main application class is called App within App.cs and App.xaml.cs files.

    I've stumbled into the same problem when adding Telerik No-Xaml controls to an existing .Net Core 3.1 WPF application. Merged dictionaries were set up according Telerik guidance, but XAML designer was showing only a blank rectangle. After renaming the app class back to default App everything went back to normal.