RadWindow as MainWindow

37 posts, 0 answers
  1. Gathon
    Gathon avatar
    1 posts
    Member since:
    Jun 2012

    Posted 08 Nov 2012 Link to this post

    Here is how i handle this feature:
    1. remove the startup uri in the app.xaml file
    2. changed the MainWindow.xaml in order to be a "telerik:RadWindow" instance (do not forget to remove the base class inheritence in the code behind, or ensure it inherit from RadWindow : 
    <telerik:RadWindow x:Class="MyApplicationNamespace.MainWindow"
        Header="My application title"
        Height="455" Width="920" ResizeMode="CanResizeWithGrip">
    <!-- main window content here  -->
    <telerik:RadWindow>

    public partial class MainWindow : Telerik.Windows.Controls.RadWindow { ... }

    3. added the code below in the app.xaml behind code (app.xaml.cs) :
    protected override void OnStartup(StartupEventArgs e)
    {
        var wd = new MainWindow();
        wd.WindowStartupLocation = WindowStartupLocation.CenterScreen;
        wd.Loaded += wd_Loaded; 
        wd.Show();
         
        base.OnStartup(e);
    }
     
    void wd_Loaded(object sender, RoutedEventArgs e)
    {
        // get the custom application window (radwindow)
        
    var wd = (MainWindow) sender;

        // get the main application window handle, this has been instanciated once the radwindow has been loaded
        var rootWindow = Application.Current.MainWindow;
        rootWindow.ShowInTaskbar = true;

        // use the icon which is stored in my application resource file
        rootWindow.Icon = Imaging.CreateBitmapSourceFromHIcon(
            MyApplication.Properties.Resources.app_icon.Handle,
            Int32Rect.Empty,
            BitmapSizeOptions.FromEmptyOptions());
         // use the title of the radwindow 
        rootWindow.Title = wd.Header.ToString();
    }
  2. Mike
    Mike avatar
    14 posts
    Member since:
    Sep 2011

    Posted 28 Nov 2012 Link to this post

    This control still seems to have a lot of unsolved issues, at least if you use it to replace MainWindow.xaml.

    Another problem we ran into:

    -----------------------------------------------------------------------------------------
    Hi, In your tutorial...

    http://www.telerik.com/support/kb/wpf/window/radwindow-as-main-window.aspx

    ...you have removed...

    StartupUri="MainWindow.xaml   from  App.xaml (it's not mentioned in the tutorial, but the code is removed in the example provided)

    The problem: after this step I've no longer access to the styles defined in App.xaml

    For example, this does no longer work:

    column.HeaderCellStyle = (Style)Application.Current.FindResource("GridViewHeaderCellStyleTradeClient");

    What's the solution for this problem?
    Thanks in advance.
    -----------------------------------------------------------------------------------------

    Answer I got from Telerik:

    -----------------------------------------------------------------------------------------
    Hi Mike, Thank you for contacting us.

    RadWindow is not designed to be used as main window and it hasn't been tested for issues concerning the Styling of the Window when it is used in that state.

    The knowledge base post describes a possible workaround in order to use the Window control as a main window but in some scenarios there may be some unexpected behaviors that are not supported in the current version of the control. We tested the issue you experiencing and indeed removing the StartupUri="MainWindow.xaml" causes it but currently we cannot provide a workaround to this scenario.

    If you have any other questions feel free to write to us again.
    Greetings,
    the Telerik team
    -----------------------------------------------------------------------------------------

  3. UI for WPF is Visual Studio 2017 Ready
  4. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 29 Nov 2012 Link to this post

    Hello Mike,

    Thank you for your feedback.

    As a workaround to this issue you can use the following approach:
    1. Place the Styles/DataTemplates from the App.xaml in Resource Dictionaries and merge them in the RadWindow which you are using as a main window. If you want those Styles/DataTemplates to be used in all the other RadWindows in your application you should merge the Dictionaries in the App.xaml too.
    2. After that set the Style/DataTemplate to the DynamicResource you have placed in the Resource Dictionaries.

    Hope this is helpful.

    Kind regards,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Marcin
    Marcin avatar
    165 posts
    Member since:
    Jan 2011

    Posted 23 Apr 2013 Link to this post

    Hello,
    I recently started using tetlerik and radwindow as mainwindow on Windows 8. And the problem with minimalized thumbnail still exists (I'm using latest 2013 Q1 WPF controls. Is there any way to workaround this? I'm using RadWindowInteropHelper approach in my solution.
  6. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 23 Apr 2013 Link to this post

    Hi,

    We tested the minimized thumbnail issue under the official Windows 8 released version and indeed it is present. Unfortunately currently we are not aware of any workaround to this issue.

    The issue is logged in our Public Issue Tracker System where you can track its status.

    Regards,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  7. Vladimir
    Vladimir avatar
    5 posts
    Member since:
    Nov 2012

    Posted 13 Jan 2014 Link to this post

    Hi,

    I just wonder whether you are ever planning to fix the minimized thumbnail issue? It has been reported for over a year...

    Regards,
    Vladimir  
  8. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 13 Jan 2014 Link to this post

    Hello,

    Unfortunately the mentioned issue is still not resolved. Since all of our tasks for the next official release of RadDocking are already planned a fix for it will not be available in that release.

    I update the issue's priority and we hope to have it fixed as soon as possible.

    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 >>
Back to Top
UI for WPF is Visual Studio 2017 Ready