Radwindow as main window not showing

7 posts, 1 answers
  1. QuizzBox
    QuizzBox avatar
    72 posts
    Member since:
    Jan 2011

    Posted 07 Nov Link to this post

    Hello,

    I have a problem trying to reproduce the Radwindow as main window KB (https://www.telerik.com/support/kb/wpf/window/details/how-to-use-radwindow-as-main-window).

    I'm using VB.NET with 2017.3.913.40 telerik components. I'm also using noXaml binaries.

    When i run the application, nothing is visible.

    I've tried todo this alos MainWindow inherits radwindow, but it's not better.

    If i remove the onStartup code and set the application startupuri to MainWindow.xaml, i have the window visible, but there is another aweful window visible behind.

    This problem will drive me crazy !

    Thanks in advance for your answers.

    Application.xaml

    <Application x:Class="TelerikWpfApp13.Application"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 xmlns:local="clr-namespace:TelerikWpfApp13">
        <Application.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/System.Windows.xaml" />
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.xaml" />
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
                    <ResourceDictionary Source="/Telerik.Windows.Themes.Material;component/Themes/Telerik.Windows.Controls.Docking.xaml" />
                </ResourceDictionary.MergedDictionaries>
                <Style TargetType="local:MainWindow" BasedOn="{StaticResource RadWindowStyle}" />
            </ResourceDictionary>
        </Application.Resources>
    </Application>

     

    Application.xaml.vb

    Class Application
        Inherits System.Windows.Application
     
        ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
        ' can be handled in this file.
        Protected Overrides Sub OnStartup(e As StartupEventArgs)
            Call New MainWindow().Show()
            MyBase.OnStartup(e)
        End Sub
     
    End Class

     

    MainWindow.xaml

    <telerik:RadWindow x:Class="MainWindow"
            Header="MainWindow" Height="300" Width="300">
        <Grid>
             
        </Grid>
    </telerik:RadWindow>

     

    MainWindow.xaml.vb

    Public Class MainWindow
     
    End Class

     

  2. QuizzBox
    QuizzBox avatar
    72 posts
    Member since:
    Jan 2011

    Posted 08 Nov Link to this post

    I've found it by myself,

    The problem comes when you create a telerik VB WPF Application.

    If you create a standard VB WPF Application, everything works fine.

     

  3. QuizzBox
    QuizzBox avatar
    72 posts
    Member since:
    Jan 2011

    Posted 08 Nov Link to this post

    I can't achieve the expected behavior with a Telerik project and i don't know what i'm missing ...
  4. Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    55 posts

    Posted 10 Nov Link to this post

    Hello Jean-Marc,

    I am attaching the RadWindow as MainWindow SDK example which I tested with NoXaml dlls and it is behaving as expected. Can you take a look at it and see how it differs from your project? If you need further assistance, can you modify that project or prepare your own to show your scenario? 

    You can also check out the RadWindow As User Control article in our documentation.

    I am looking forward to hearing from you.

    Regards,
    Vladimir Stoyanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  5. QuizzBox
    QuizzBox avatar
    72 posts
    Member since:
    Jan 2011

    Posted 15 Nov Link to this post

    Hello Vladimir and thank you for your answer.

    I've downloaded your sample but i'm not able to make it working.

    With your sample project i've references problems : Telerik.Windows.controls, Telerik.Windows.controls.navigation, Telerik.Windows.Data and Telerik.Windows.Themes.Material are missing, so i replace them with my own (C:\Program Files (x86)\Progress\Telerik UI for WPF R3 2017\Binaries.NoXaml\WPF40)

    After that, when i launch the app, nothing happens.

    I've attached a gif to show you my scenario.

    Thanks in advance.

     

  6. Answer
    Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    55 posts

    Posted 17 Nov Link to this post

    Hi Jean-Marc,

    Thank you for the attached gif. The issue is that the namespaces of the Application.xaml and the Application.xaml.vb files are different and vb doesn't know that those files are connected. You can either change the x:Class in your Application.xaml file to:
    <Application x:Class="Application" />
     

    or add the namespace to the Application.xaml.vb file like so:
    Namespace TelerikWpfApp20
        Class Application
            Inherits System.Windows.Application
            Protected Overrides Sub OnStartup(e As StartupEventArgs)
                'CType(New MainWindow(), MainWindow).Show()
                Call New MainWindow().Show()
                MyBase.OnStartup(e)
            End Sub
        End Class
    End Namespace

    I hope you find this helpful. Let me know if I can be of any further assistance.

    Regards,
    Vladimir Stoyanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  7. QuizzBox
    QuizzBox avatar
    72 posts
    Member since:
    Jan 2011

    Posted 17 Nov Link to this post

    Thank you very much Vladimir, everything works fine now !
Back to Top