private void SelectLayerCommand_Execute(LayerByDomain layer)
 {
     if (this.SelectedDomainLayer != layer)
     {
         this.SelectedDomainLayer = layer;
     }
 }
        public async Task <OperationPreviewDialogResult> ShowAsync(HistoryItem report)
        {
            if (this.Shown)
            {
                throw new InvalidOperationException("The dialog is already shown.");
            }

            this.Report = report;

            this.UniquenessByPhrase = $"{100 - report.Equality}";
            this.UniquenessByWord   = $"{100 - report.Rewrite}";
            this.Visibility         = Visibility.Visible;
            this.Shown   = true;
            resultSource = new TaskCompletionSource <OperationPreviewDialogResult>();
            this.temporaryParentPanel = Window.Current.Content.GetFirstDescendantOfType <Panel>();

            if (temporaryParentPanel != null)
            {
                temporaryParentPanel.Children.Add(this);
                temporaryParentPanel.SizeChanged += this.OnParentSizeChanged;
            }

            var inputPane = InputPane.GetForCurrentView();

            inputPane.Showing -= this.OnInputPaneShowing;
            inputPane.Showing += this.OnInputPaneShowing;
            inputPane.Hiding  -= this.OnInputPaneHiding;
            inputPane.Hiding  += this.OnInputPaneHiding;

            //this.dialogPopup.IsOpen = true;
            await this.WaitForLayoutUpdateAsync();

            if (this.Report != null && this.Report.Domains.Count > 0)
            {
                this.SelectedDomainLayer = this.Report.Domains.First().Layers.First();
            }

            this.ResizeLayoutRoot();
            await this.GoToVisualStateAsync(this.parentRoot, PopupStatesGroupName, OpenPopupStateName);

            var result = await this.resultSource.Task;

            if (this.SelectedDomainLayer != null)
            {
                this.SelectedDomainLayer.IsSelected = false;
                this.SelectedDomainLayer            = null;
            }
#pragma warning disable 4014
            this.CloseAsync();
#pragma warning restore 4014

            return(result);
        }
 private void SelectDomainCommand_Execute(Domain domain)
 {
     this.SelectedDomainLayer = domain.Layers.First();
 }