This is a migrated thread and some comments may be shown as answers.

Radwindow as main window not showing

6 Answers 356 Views
Window
This is a migrated thread and some comments may be shown as answers.
OD
Top achievements
Rank 1
OD asked on 07 Nov 2017, 03:22 PM

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

 

6 Answers, 1 is accepted

Sort by
0
OD
Top achievements
Rank 1
answered on 08 Nov 2017, 02:46 PM

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.

 

0
OD
Top achievements
Rank 1
answered on 08 Nov 2017, 02:53 PM
I can't achieve the expected behavior with a Telerik project and i don't know what i'm missing ...
0
Vladimir Stoyanov
Telerik team
answered on 10 Nov 2017, 09:32 AM
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.
0
OD
Top achievements
Rank 1
answered on 15 Nov 2017, 08:45 AM

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.

 

0
Accepted
Vladimir Stoyanov
Telerik team
answered on 17 Nov 2017, 03:30 PM
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.
0
OD
Top achievements
Rank 1
answered on 17 Nov 2017, 03:38 PM
Thank you very much Vladimir, everything works fine now !
Tags
Window
Asked by
OD
Top achievements
Rank 1
Answers by
OD
Top achievements
Rank 1
Vladimir Stoyanov
Telerik team
Share this question
or