Hi i have a radwindow, the problem is sometimes it opens up multiple instances of the window, this is a problem because only one instance of it should be opened.
I open it this way;
<
Telerik:RadWindow
x:Class
=
"CLA.StaticDataProcessing.Views.Dashboard.EventHistory"
xmlns:clr
=
"clr-namespace:System;assembly=mscorlib"
xmlns:Telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:cmd
=
"clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL4"
mc:Ignorable
=
"d"
xmlns:vm
=
"clr-namespace:CLA.StaticDataProcessing.ViewModels"
xmlns:ClassLibrary
=
"clr-namespace:CLA.SL.Apps.ClassLibrary;assembly=CLA.SL.Apps.ClassLibrary"
Height
=
"600"
Width
=
"1000"
ModalBackground
=
"Transparent"
CanClose
=
"True"
Header
=
"Event History"
WindowStartupLocation
=
"CenterOwner"
>
<
Telerik:RadWindow.Resources
>
<
vm:EventDetailHistoryDTOViewModel
x:Key
=
"vm"
></
vm:EventDetailHistoryDTOViewModel
>
</
Telerik:RadWindow.Resources
>
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"Closed"
>
<
cmd:EventToCommand
Command
=
"{Binding ClickCommand, Source={StaticResource vm}}"
CommandParameter
=
"closewindow"
></
cmd:EventToCommand
>
</
i:EventTrigger
>
<
i:EventTrigger
EventName
=
"Loaded"
>
<
cmd:EventToCommand
Command
=
"{Binding LoadCommand, Source={StaticResource vm}}"
CommandParameter
=
"{Binding ID}"
></
cmd:EventToCommand
>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
DataContext
=
"{Binding}"
>
<
Grid.RowDefinitions
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
<
RowDefinition
></
RowDefinition
>
</
Grid.RowDefinitions
>
<
StackPanel
Orientation
=
"Horizontal"
Margin
=
"0,0,0,142"
>
<
TextBlock
FontFamily
=
"Segoe UI Light"
FontSize
=
"30"
Foreground
=
"{StaticResource AccentBrush}"
Text
=
"{Binding EntityName}"
></
TextBlock
>
<
TextBlock
Text
=
" - "
Foreground
=
"{StaticResource AccentBrush}"
FontSize
=
"30"
></
TextBlock
>
<
TextBlock
FontFamily
=
"Segoe UI Light"
Foreground
=
"{StaticResource AccentBrush}"
FontSize
=
"30"
Text
=
"{Binding FormName}"
></
TextBlock
>
</
StackPanel
>
<
Telerik:RadGridView
AutoGenerateColumns
=
"False"
RowHeight
=
"50"
ItemsSource
=
"{Binding PagedSource, ElementName=_radDataPager}"
CanUserFreezeColumns
=
"False"
ShowGroupPanel
=
"False"
Margin
=
"0,43,0,54"
Grid.RowSpan
=
"3"
>
<
Telerik:RadGridView.Columns
>
<
Telerik:GridViewDataColumn
Header
=
"Internal Comment"
IsReadOnly
=
"True"
TextWrapping
=
"Wrap"
DataMemberBinding
=
"{Binding InternalComment,TargetNullValue='-'}"
Width
=
"2*"
/>
<
Telerik:GridViewDataColumn
Header
=
"External Comment"
TextWrapping
=
"Wrap"
DataMemberBinding
=
"{Binding ExternalComment,TargetNullValue='-'}"
Width
=
"2*"
/>
<
Telerik:GridViewDataColumn
Header
=
"Current State"
IsReadOnly
=
"True"
DataMemberBinding
=
"{Binding CurrentState}"
Width
=
"1*"
/>
<
Telerik:GridViewDataColumn
Header
=
"Next State"
IsReadOnly
=
"True"
DataMemberBinding
=
"{Binding NextState}"
Width
=
"1*"
/>
<
Telerik:GridViewDataColumn
Header
=
"ChangedBy"
IsReadOnly
=
"True"
DataMemberBinding
=
"{Binding ChangedBy}"
Width
=
"1*"
/>
<
Telerik:GridViewDataColumn
Header
=
"ChangedOn"
IsReadOnly
=
"True"
DataMemberBinding
=
"{Binding ChangedOn}"
Width
=
"1*"
/>
</
Telerik:RadGridView.Columns
>
</
Telerik:RadGridView
>
<
Telerik:RadDataPager
Grid.Row
=
"2"
x:Name
=
"_radDataPager"
PageSize
=
"10"
Margin
=
"0,158,0,0"
DisplayMode
=
"All"
IsTotalItemCountFixed
=
"True"
VerticalAlignment
=
"Bottom"
Source
=
"{Binding BindsDirectlyToSource=True, Path=EventDetailHistoryDTOs, Source={StaticResource vm}, TargetNullValue=''}"
/>
</
Grid
>
</
Telerik:RadWindow
>
I open it this way;
EventHistory eventHistory = new EventHistory();
eventHistory.DataContext = staticDataRadGrid.SelectedItem;
eventHistory.ShowDialog();
Can anyoen see what I am doing wrong?