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

RadWindow as MainWindow

9 Answers 413 Views
Window
This is a migrated thread and some comments may be shown as answers.
Richard Harrigan
Top achievements
Rank 1
Richard Harrigan asked on 01 Aug 2013, 07:46 PM
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();
        }
    }
}


    

9 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 06 Aug 2013, 08:58 AM
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 >>
0
Richard Harrigan
Top achievements
Rank 1
answered on 06 Aug 2013, 06:24 PM

Hi Vladi

That worked.

Thanks

Rich

0
Dominique Kande Vita
Top achievements
Rank 1
answered on 13 Nov 2014, 05:58 PM
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 ?
0
Kalin
Telerik team
answered on 14 Nov 2014, 09:40 AM
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.

 
0
ToddR
Top achievements
Rank 1
answered on 04 Mar 2015, 03:10 AM
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
0
Kalin
Telerik team
answered on 06 Mar 2015, 12:17 PM
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.

 
0
ToddR
Top achievements
Rank 1
answered on 06 Mar 2015, 08:19 PM
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
0
Kalin
Telerik team
answered on 10 Mar 2015, 12:39 PM
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.

 
0
ToddR
Top achievements
Rank 1
answered on 10 Mar 2015, 06:08 PM
Got it, Thanks!
Tags
Window
Asked by
Richard Harrigan
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Richard Harrigan
Top achievements
Rank 1
Dominique Kande Vita
Top achievements
Rank 1
Kalin
Telerik team
ToddR
Top achievements
Rank 1
Share this question
or