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

RadWindow showing inside a standard window?

2 Answers 275 Views
Window
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Veteran
Martin asked on 07 Jun 2020, 09:54 PM

I have a weird problem with a RadWIndow that is to replace the regular Window.

It's showing inside what appears to be a browser and I have no idea how to fix this.

 

Any ideas?

 

MainWindow.xaml

<telerik:RadWindow x:Class="TelerikWpfApp1.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"
                   Width="1200" Height="850" Loaded="Window_Loaded" WindowStartupLocation="CenterScreen" MinWidth="1200" MinHeight="850" CaptionHeight="25" IsRestricted="True">
    <telerik:RadWindow.Resources>
        <telerik:StringToGlyphConverter x:Key="StringToGlyphConverter" />
        <telerik:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
        <Style x:Key="ItemPreviewStyle" TargetType="telerik:RadNavigationViewItem">
            <Setter Property="IconTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <telerik:RadGlyph Glyph="{Binding Converter={StaticResource StringToGlyphConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="ItemBaseStyle" TargetType="telerik:RadNavigationViewItem" BasedOn="{StaticResource ItemPreviewStyle}">
            <Setter Property="Content" Value="{Binding Title}" />
            <Setter Property="ItemsSource" Value="{Binding SubItems}"/>
            <Setter Property="Icon" Value="{Binding Icon}" />
            <Setter Property="IconVisibility" Value="{Binding Icon, Converter={StaticResource NullToVisibilityConverter}}"/>
        </Style>
        <Style x:Key="ItemStyle" TargetType="telerik:RadNavigationViewItem" BasedOn="{StaticResource ItemBaseStyle}">
            <Setter Property="ItemContainerStyle" Value="{StaticResource ItemBaseStyle}"/>
        </Style>
    </telerik:RadWindow.Resources>
    <telerik:RadNavigationView x:Name="NavigationView" ItemsSource="{Binding Items}"
                               ItemContainerStyle="{StaticResource ItemStyle}"
                               AutoChangeDisplayMode="True"
                               DisplayMode="Expanded"
                               AllowMultipleExpandedItems="True"
                               SubItemsIndentation="40"
                               telerik:AnimationManager.IsAnimationEnabled="True"
                               Loaded="OnNavigationViewLoaded"
                               SelectionChanged="OnNavigationViewSelectionChanged">
        <Frame x:Name="frm"/>
    </telerik:RadNavigationView>
</telerik:RadWindow>

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 09 Jun 2020, 03:51 PM

Hello Martin,

This happens if you set the RadWindow implementation (for example MainWindow.xaml) as a StartupUri of the application in the App.xaml file. To avoid this and show the window properly, remove the StartupUri and override the OnStartup() method of App.xaml.cs file. Then manually call the Show() method of the window.

This approach is shown in the following help article. Please give this approach a try and let me know how it goes.

Regards,
Martin Ivanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Martin
Top achievements
Rank 1
Veteran
answered on 10 Jun 2020, 01:17 AM
Works great, thanks :)
 
 

 

pronomen: ye, it, you, him, such

Tags
Window
Asked by
Martin
Top achievements
Rank 1
Veteran
Answers by
Martin Ivanov
Telerik team
Martin
Top achievements
Rank 1
Veteran
Share this question
or