Hello,
I'm trying to create an alert / prompt chain (Ask a question, then ask an other question or result depending on the user input). Everything works as expected in a plain application (like the demo example) but I couldn't figure how to use this within a RadWindow.
After the first alert, the activated event of the window is raised, then this window is bringed to front hidding any existing modal alert.
This was described in 2009 in this post but no real solution was suggested for my problem.
Here's a sample code of my issue:
Best regards,
Simon
I'm trying to create an alert / prompt chain (Ask a question, then ask an other question or result depending on the user input). Everything works as expected in a plain application (like the demo example) but I couldn't figure how to use this within a RadWindow.
After the first alert, the activated event of the window is raised, then this window is bringed to front hidding any existing modal alert.
This was described in 2009 in this post but no real solution was suggested for my problem.
Here's a sample code of my issue:
<
telerik:RadWindow
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:FrameworkClient
=
"http://schemas.simonbesner.com/FrameworkClient"
xmlns:sdk
=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
xmlns:System
=
"clr-namespace:System;assembly=mscorlib"
x:Class
=
"SardoClient.XWindow"
mc:Ignorable
=
"d"
telerik:StyleManager.Theme
=
"Office_Silver"
d:DesignHeight
=
"231"
d:DesignWidth
=
"576"
Header
=
"XWindow"
IsRestricted
=
"True"
WindowStartupLocation
=
"CenterScreen"
Width
=
"453"
Height
=
"229"
CanClose
=
"True"
CanMove
=
"True"
ResizeMode
=
"CanResize"
ModalBackground
=
"White"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"50"
/>
</
Grid.RowDefinitions
>
<
telerik:RadButton
Grid.Row
=
"0"
Content
=
"Button1"
Height
=
"54"
Name
=
"RadButton1"
Width
=
"100"
/>
</
Grid
>
</
telerik:RadWindow
>
Partial
Public
Class
XWindow
Inherits
Telerik.Windows.Controls.RadWindow
Private
Sub
RadButton1_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.Windows.RoutedEventArgs)
Handles
RadButton1.Click
Dim
eventHandler
As
New
System.EventHandler(Of Telerik.Windows.Controls.WindowClosedEventArgs)(
AddressOf
OnClosed1)
Telerik.Windows.Controls.RadWindow.Alert(
"Alert #1"
, eventHandler)
End
Sub
Private
Sub
OnClosed1(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Windows.Controls.WindowClosedEventArgs)
Dim
eventHandler
As
New
System.EventHandler(Of Telerik.Windows.Controls.WindowClosedEventArgs)(
AddressOf
OnClosed2)
Telerik.Windows.Controls.RadWindow.Alert(
"Alert #2"
, eventHandler)
End
Sub
Private
Sub
OnClosed2(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Windows.Controls.WindowClosedEventArgs)
System.Windows.MessageBox.Show(
"Done"
)
End
Sub
End
Class
Best regards,
Simon