My form WPF
works perfectly, but in a specific%%, after the action of selecting, the form is going behind all windows without further explanation, and this does not happen in any other form, could anyone explain why?
The image before clicking on the ComboBox
:
MyComboBox
:
<ComboBoxName="CbAnimalSpecie" Grid.Column="1" Grid.Row="3" Height="25" Width="130" Margin="100,0,250,0" ItemsSource="{Binding Path=AnimalSpecies}" SelectedItem="{Binding Animal.AnimalSpecie}" SelectedValuePath="Id" DisplayMemberPath="Name">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding GetAllAnimalBreedsByAnimalSpecieCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
UPDATE
As requested, it follows my ComboBox
processing:
protected Helper.Views.ProcessingView ShowProcessing(Window ownerView)
{
try
{
var processingView = new Helper.Views.ProcessingView();
processingView.Owner = ownerView;
processingView.Show();
ownerView.IsEnabled = false;
return processingView;
}
catch (Exception)
{
throw;
}
}
protected void CloseProcessing(Window ownerView, Window processingView)
{
try
{
ownerView.IsEnabled = true;
processingView.Hide();
processingView.Close();
}
catch (Exception)
{
throw;
}
}
My View
:
public ICommand GetAllAnimalBreedsByAnimalSpecieCommand
{
get { return _getAllAnimalBreedsByAnimalSpecieCommand ?? (_getAllAnimalBreedsByAnimalSpecieCommand = new DelegateCommand(GetAllAnimalBreedsByAnimalSpecie)); }
}
And finally, my method:
private void GetAllAnimalBreedsByAnimalSpecie()
{
try
{
var processingView = base.ShowProcessing(this.AnimalUpdateView);
this.AnimalBreedsOriginal = new Repository.AnimalBreed().GetAllAnimalBreeds();
this.AnimalBreeds = new Repository.AnimalBreed().GetAllAnimalBreeds(T => T.AnimalSpecieId == this.Animal.AnimalSpecie.Id);
base.CloseProcessing(this.AnimalUpdateView, processingView);
}
catch
{
throw;
}
}
UPDATE 2
Okay, I found part of the Form problem, it's this code snippet:
private void GetAllAnimalBreedsByAnimalSpecie()
{
try
{
var processingView = base.ShowProcessing(this.AnimalUpdateView);
.
.
.
base.CloseProcessing(this.AnimalUpdateView, processingView);
}
catch
{
throw;
}
}
But as I said earlier, this section works perfectly on all software, because at that point it has this strange behavior?