Question: I am showing a content dialog on one of my sessionstateaware pages, I close the dialog fine and can reopen another on the same page as many times as I want. When I navigate away and come back and try to reopen my dialog, it blows up with this error:

> 
> WinRT information: Only a single ContentDialog can be open at any time.
>  Additional information: An async operation was not properly started.
> 
> 
> 

I have tried numerous things, but it seems whenever I navigate away and come back, somehow the reference to the control is lost and another gets created?

Here is a little snippet of the problem area:

```
if(asyncCommand != null)
asyncCommand.Cancel();

var result = new ContentDialogResult();
if (CanOpenNewDialog)
{

    CanOpenNewDialog = false;
    MyContentDialog.Title = "Homebuyer Options - " + apt.Customer1FullName;
    asyncCommand = MyContentDialog.ShowAsync();

    result = await asyncCommand.AsTask();
}

```

Answer: 
You can traverse the list of arrays just once, **comparing the first array with all the other arrays**. If the first one is equal to all the others, then all arrays in the list are equal. Something like this will work:

```
arrays = [[1,3],[1,3],[1,3]]
array0 = arrays.first
arrays[1..-1].all? { |a| array0 == a }
# => true

arrays = [[1,3],[1,3],[1,4]]
array0 = arrays.first
arrays[1..-1].all? { |a| array0 == a }
# => false

```
```
[[1,3],[1,3],[1,3]].uniq.size == 1
  #=> true

[[1,3],[1,3],[1,4]].uniq.size == 1
  #=> false

```