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

No Content on programatic creation

2 Answers 76 Views
Window
This is a migrated thread and some comments may be shown as answers.
michael mccurrey
Top achievements
Rank 1
michael mccurrey asked on 28 Jul 2009, 09:37 PM
Environment: 
WPF - XBAP style deployment
Version 2009.2.701.35

I'm trying to use the RadWindow to create a dynamic modal dialog from the code behind.

I'm creating the RadWinow as such:

 

var window = new RadWindow

 

{

WindowStartupLocation =

WindowStartupLocation.CenterOwner,

 

CanClose =

true,

 

CanMove =

true,

 

ResizeMode =

ResizeMode.NoResize,

 

Content =

new UnhandledError(),

 

Height = 300,

Width = 500

};

window.ShowDialog();

The problem is that the UserControl doesn't get displayed at all in the content.

The UserControl is pure XAML as:

 

<

 

UserControl x:Class="PCSWeb.WPFShell.Views.UnhandledError"

 

 

 

 

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

 

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

 

 

 

Height="300" Width="300" Name="window" Loaded="window_Loaded" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">

 

 

 

 

 

 

 

<Grid Background="AliceBlue" Height="Auto" Width="Auto">

 

 

 

 

 

 

 

<Grid.RowDefinitions>

 

 

 

 

 

 

 

<RowDefinition />

 

 

 

 

 

 

 

<RowDefinition />

 

 

 

 

 

 

 

</Grid.RowDefinitions>

 

 

 

 

 

 

 

<Grid.ColumnDefinitions>

 

 

 

 

 

 

 

<ColumnDefinition Width="*" />

 

 

 

 

 

 

 

</Grid.ColumnDefinitions>

 

 

 

 

 

 

 

<Border Grid.Row="0" BorderBrush="#feca00" CornerRadius="0,10,20,40"

 

 

 

 

 

 

BorderThickness="2" Height="Auto">

 

 

 

 

 

 

 

<StackPanel>

 

 

 

 

 

 

 

 

<TextBlock Text="Error">adafdfasdf</TextBlock>

 

 

 

 

 

 

 

</StackPanel>

 

 

 

 

 

 

 

</Border>

 

 

 

</Grid>

 

</

 

UserControl>

 

 

 


 

2 Answers, 1 is accepted

Sort by
0
michael mccurrey
Top achievements
Rank 1
answered on 28 Jul 2009, 09:40 PM
nevermind fixed it..  you still need to call Initialize in your UserControl
0
Hristo Borisov
Telerik team
answered on 29 Jul 2009, 06:58 AM
Hi Michael,

Yes, you are required to call the Initialize in any case. It will map your xaml declared items to code-behind instances. If you have any other questions don't hesitate to contact us.

Kind regards,
Hristo Borisov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
michael mccurrey
Top achievements
Rank 1
Answers by
michael mccurrey
Top achievements
Rank 1
Hristo Borisov
Telerik team
Share this question
or