ProWindow wait cursor

347
3
04-11-2018 12:43 PM
Highlighted
Regular Contributor

Hi,

I'm following the SDK community samples and opening up a Window (styled as a ProWindow) from the click event of a button.  The Window opens fine, and is in the esri style, but the cursor only displays on the form as a 'wait' cursor.  Does anyone know what might be happening?

My code is fairly simple.  To open the Window:

To style my Window:

<controls:ProWindow x:Class="AddressPointSelector_ArcPro.AddressWindow"
             xmlns:controls="clr-namespace:ArcGIS.Desktop.Framework.Controls;assembly=ArcGIS.Desktop.Framework"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
             mc:Ignorable="d"
             Title="Address Tool"
             d:DesignHeight="300" d:DesignWidth="300">

   
        <controls:ProWindow.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </controls:ProWindow.Resources>

        <Grid>

        </Grid>
</controls:ProWindow>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Thanks!

Tags (1)
0 Kudos
3 Replies
Highlighted
Esri Regular Contributor

Hi Brian

I tried this in a simple add-in. I am not seeing the wait cursor.

0 Kudos
Highlighted
Regular Contributor

Hi Uma,

Thanks for checking into that.  Seems to be that my addrWindow.Show() being within the QueuedTask.Run is what is causing the problem.  I have changed it, so now it is like this:

async protected override void OnClick()
        {
            await QueuedTask.Run(() =>
            {
                //some logic here
            });

            AddressWindow addrWindow = new AddressWindow();
            addrWindow.Show();

        }

Thanks!

0 Kudos
Highlighted
Esri Contributor

Brian, generally speaking, the only UI you should use in conjunction with a QueuedTask is a progressor. Messageboxes, windows ("Dialogs'), etc should be invoked on the UI thread.