After migrating from Telerik Telerik Q2 2010 to Q3 2010 wpf, the radWindow does not close properly after the button 'Valider' is clicked!
Code :
Xaml file:
<UserControl x:Class="gcm.module.consultation.CreationMotifView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
xmlns:infrastructure="clr-namespace:gcm.infrastructure;assembly=gcm.infrastructure"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<UserControl.Resources>
<DataTemplate x:Key="IconTemplate">
<Image Source="/gcm.resources;component/images/16/Motif.png"
Stretch="None" />
</DataTemplate>
</UserControl.Resources>
<telerikNavigation:RadWindow x:Name="window" Header="{x:Static infrastructure:Message.Popup_Motif_header}" WindowStartupLocation="CenterOwner" Margin="10,40,10,10" Height="135" Width="450"
TopOffset="-50" ResizeMode="NoResize"
IconTemplate="{StaticResource IconTemplate}">
<Grid>
<Grid.Resources>
<DataTemplate DataType="{x:Type ValidationError}">
<TextBlock
FontStyle="Italic"
Foreground="Red"
HorizontalAlignment="Right"
Margin="0,1"
Text="{Binding Path=ErrorContent}"
/>
</DataTemplate>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="120"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="*"/>
<RowDefinition Height="35"/>
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="1" Name="LibelleMotif" Content="{x:Static infrastructure:Message.Motif_Libelle}"></Label>
<TextBox Grid.Column="1" Grid.Row="1" Name="TxtMotif"
Text="{Binding Path=txtMotif, ValidatesOnDataErrors=true, UpdateSourceTrigger=PropertyChanged}"
Height="23" Margin="0,0,35,0" VerticalAlignment="Top" TabIndex="0" />
<ContentPresenter Grid.Row="1" Grid.Column="5"
HorizontalAlignment="Left" VerticalAlignment="Top"
Content="{Binding ElementName=TxtMotif, Path=(Validation.Errors).CurrentItem}"
DockPanel.Dock="Right"/>
<Button Grid.Column="2" Grid.Row="2" Name="valider" Margin="0,0,33,9"
Command="{Binding Path=MotifCommande}" TabIndex="1" >valider</Button>
</Grid>
</telerikNavigation:RadWindow>
</UserControl>
Presenter :
public ICommand MotifCommande
{
get
{
if (this.mode == ModeNames.UPDATE)
{
if (_updateCommand == null)
{
_updateCommand = new RelayCommand(
param => this.updateMotif(),
param => this.CanSaveMotif
);
}
return _updateCommand;
}
else
{
if (_saveCommand == null)
{
_saveCommand = new RelayCommand(
param => this.createMotif(),
param => this.CanSaveMotif
);
}
return _saveCommand;
}
}
}
public void createMotif()
{
try
{
Motif motif = this.GetMotif();
_motifRepository.CreateMotif(motif);
this.View.window.Close();
consultationController.MotifCreated(motif);
}
catch (Exception)
{
}
}
bool CanSaveMotif
{
get
{
return true;
}
}
any idea?