RadWindow as MainWindow

10 posts, 0 answers
  1. Richard Harrigan
    Richard Harrigan avatar
    235 posts
    Member since:
    Nov 2009

    Posted 01 Aug 2013 Link to this post

    Hi

    I created a new wpf app and followed the information in the forum to make the main window a RadWindow.  When I execute the program I get a wpf navigation window with my RadWindow inside of it.   The RadWindow appears to be frozen,  Outside the Navigation window is another RadWindow that is not frozen.  Based on the forum guide I think I am doing everything correctly.  I am also using the latest version of the telerik libraries.  I am expecting to see only a main RadWindow with no navigation window.

    1. - Created a new Wpf Application

    2. Modified MainWindow.Xaml 

    <telerik:RadWindow x:Class="CloudburstDataReader.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"
            Header="Cloudburst Data Reader" Height="350" Width="525">
        <Grid>

        </Grid>
    </telerik:RadWindow>

    3. Modified App.xaml.cs

    public partial class App : Application
        {
            protected override void OnStartup(StartupEventArgs e)
            {
                new MainWindow().Show();
                base.OnStartup(e);
            }

        }

    4. Modified CloudburstDataReader.cs

    namespace CloudburstDataReader
    {
        /// <summary>
        /// Interaction logic for MainWindow.xaml
        /// </summary>
        public partial class MainWindow : RadWindow
        {
            public MainWindow()
            { 
                InitializeComponent();
            }
        }
    }


        
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 06 Aug 2013 Link to this post

    Hello,

    It looks like you have done most of the steps required to use the RadWindow control as main window except removing the StartupUri from the App.xaml and possibly making the MainWindow to inherit RadWindow.

    I created and attached a sample project for you showing how to use RadWindow as main window, hope this is helpful. As a side note it is good to set the ShowInTaskbar attached property in order to be able to see the window in the taskbar.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Richard Harrigan
    Richard Harrigan avatar
    235 posts
    Member since:
    Nov 2009

    Posted 06 Aug 2013 Link to this post

    Hi Vladi

    That worked.

    Thanks

    Rich

  5. Dominique Kande Vita
    Dominique  Kande Vita avatar
    1 posts
    Member since:
    Aug 2009

    Posted 13 Nov 2014 Link to this post

    I just spend 2 hours to try this code here to have the Radwindow as the main one. But this is so NOT working. I am really impress.

    I am using the last telerik, and the last VSO. The project you posted actually work, but it is a kind of very special, doest not take other theme, ect...

    so, may you help with something recent ?
  6. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 14 Nov 2014 Link to this post

    Hello Dominique,

    Can you share some more details on the exact issues you have faced during the implementation? Are using Implict Styles to apply the theme - if so you would also need to manually apply a Style with TargetType MainWindow and BasedOn the default RadWindowStyle. If you share the exact requirements, we will be glad to prepare a sample project demonstrating the exact approach.

    I'm looking forward to hearing from you.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. ToddR
    ToddR avatar
    6 posts
    Member since:
    Nov 2009

    Posted 03 Mar 2015 in reply to Vladi Link to this post

    Hello,
    Do you have an example of using a RadWindow as MainWindow in VB.Net?
    Converted the Application and KB to VB.Net and I am stuck at showing the window in the OnStartUp?

    new MainWindow().Show();  What would that be in VB.Net
  8. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 06 Mar 2015 Link to this post

    Hello Todd,

    Please try the following code snippet:

    Protected Overrides Sub OnStartup(e As StartupEventArgs)
        CType(New MainWindow(), MainWindow).Show()
        MyBase.OnStartup(e)
    End Sub

    I'm also attaching a sample project demonstrating how to implement RadWindow as MainWindow with VB.

    Hope this helps.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  9. ToddR
    ToddR avatar
    6 posts
    Member since:
    Nov 2009

    Posted 06 Mar 2015 in reply to Kalin Link to this post

    Hello Kalin,
    I was not able to get the sample project to work, it only shows the icon on the taskbar with no way to actually see the window?
    I added the code to my application with the same results.
    Also if you add content to your Radwindow inside the grid it does not show in the design mode for some reason.

    Todd
  10. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 10 Mar 2015 Link to this post

    Hi Todd,

    Note that the sample project uses xaml binaries - I reattached it with binaries included, so you can test it. However if you need to use it with no xaml binaries you would to also apply a custom Style in App.xaml targeting MainWindow and based on the default RadWindowStyle:
    <Style TargetType="local:MainWindow" BasedOn="{StaticResource RadWindowStyle}" />

    Hope this helps.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  11. ToddR
    ToddR avatar
    6 posts
    Member since:
    Nov 2009

    Posted 10 Mar 2015 in reply to Kalin Link to this post

    Got it, Thanks!
Back to Top
UI for WPF is Visual Studio 2017 Ready