Select to view content in your preferred language

Only one tool usable at a time?

77
2
Jump to solution
Tuesday
RogerAsbury
Frequent Contributor

I've created a ribbon bar that allows for some location specific tools. One of those tools is a popup window allowing a user to enter a Latitude/Longitude coordinate and zoom to it or mark it on the map. When this window is open, if the user attempts to use one of the other items on the ribbon, they all grey out.

I'm curious what the procedure/code is to allow this tool to remain open while leaving the other tools still usable.

Code for the window is pretty basic:

<Window x:Class="FNSBArcGISProAddin.Tools.LatLonDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:FNSBArcGISProAddin.Tools"
        mc:Ignorable="d"
        Title="Latitute Longitude Interface" Height="150" Width="330">
    <Grid Background="#FFFFE0C0">
        <TextBlock x:Name="txtLatLong" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Latitude_________________________________________Longitude" VerticalAlignment="Top" Width="480"/>
        <TextBox x:Name="inputLat" HorizontalAlignment="Left" Margin="10,42,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="143"/>
        <TextBox x:Name="inputLon" HorizontalAlignment="Left" Margin="174,42,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="136"/>
        <Button x:Name="btnPan" Content="Pan To" Click="pan_Click" HorizontalAlignment="Left" Margin="10,79,0,0" VerticalAlignment="Top" Width="134"/>
        <Button x:Name="btnDisplay" Content="Display" Click="display_ClickAsync" HorizontalAlignment="Left" Margin="190,79,0,0" VerticalAlignment="Top" Width="120"/>

    </Grid>
</Window>

But you can see that if you click other button on the ribbon, they grey out:
Lat/Long interface w/greyed out buttons. :(Lat/Long interface w/greyed out buttons. 😞

 

--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

Your issue isn't in xaml. You open window as modal. Try open it as modeless

        private ProWindowMakeProFilters _prowindow = null;

        protected override void OnClick()
        {
            //already open?
            if (_prowindow != null)
                return;
            _prowindow = new ProWindowMakeProFilters();
            _prowindow.Owner = FrameworkApplication.Current.MainWindow;
            _prowindow.Closed += (o, e) => { _prowindow = null; };
            _prowindow.Show();
            //uncomment for modal
            //_prowindow.ShowDialog();
        }

 

View solution in original post

2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

Your issue isn't in xaml. You open window as modal. Try open it as modeless

        private ProWindowMakeProFilters _prowindow = null;

        protected override void OnClick()
        {
            //already open?
            if (_prowindow != null)
                return;
            _prowindow = new ProWindowMakeProFilters();
            _prowindow.Owner = FrameworkApplication.Current.MainWindow;
            _prowindow.Closed += (o, e) => { _prowindow = null; };
            _prowindow.Show();
            //uncomment for modal
            //_prowindow.ShowDialog();
        }

 

RogerAsbury
Frequent Contributor

Thanks much! That did the trick.

--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
0 Kudos