RadWindow as MainWindow - RadWindow doesn't show up

2 posts, 0 answers
  1. Anson
    Anson avatar
    3 posts
    Member since:
    Sep 2015

    Posted 29 Nov 2015 Link to this post

     <telerik:RadWindow
                    x:Class="Testing.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="RadWindow" Height="1000.098" Width="1315.286"
        >

    This is the MainWindow.xaml

     

    - I have removed the StartUrl in app.xaml

    - I have changed MainWindow: Window To MainWindow: RadWindow

    protected override void OnStartup(StartupEventArgs e)
    {
        new MainWindow().Show();
        base.OnStartup(e);
    }
    I have added this to app.xaml.cs

     *------

    When I run the wpf, a exe is running( as i can see in task manager), but nothing show up.

     

    This is driving me crazy. Any help would be appreciated

  2. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 30 Nov 2015 Link to this post

    Hi Anson,

    If you are using Implicit Styles in order to style your application and apply some theme for it, please notice that the newly created user control (MainWindow that inherits RadWindow in your case) will not receive the default Style of RadWindow - that will cause the observed by you behavior of RadWindow.

    So, in order to fix that you need to add the following Style after the merged dictionaries:
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Themes/System.Windows.xaml" />
                <ResourceDictionary Source="Themes/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="Themes/Telerik.Windows.Controls.Navigation.xaml" />
       
            </ResourceDictionary.MergedDictionaries>
    <-- the TargetType should be your UserControl (MainWindow) that contains and inherits RadWindow -->
            <Style TargetType="local:MainWindow" BasedOn="{StaticResource RadWindowStyle}" />
       
        </ResourceDictionary>
    </Application.Resources>

    We suggest you to check the following article from our help documentation that provides detailed information how to use RadWindow as UserControl:
    http://docs.telerik.com/devtools/wpf/controls/radwindow/how-to/use-radwindow-as-user-control

    Please, give a try to the proposed above approach and let us know if it worked for you.

    Hope this helps.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top