Esri / data-assistant

ArcGIS Pro Add-in that assists in emergency management, local government and state government data aggregation workflows.
Apache License 2.0
22 stars 8 forks source link

Refresh Button #182

Closed JRosenfeldIntern closed 7 years ago

JRosenfeldIntern commented 7 years ago

Added button to reload xml when in the field mapping pane

@MikeMillerGIS @chris-fox

chris-fox commented 7 years ago

@JRosenfeldIntern, I would recommend you use the code below to add the button to the UI. In the change below I am putting the listbox and the button inside a DockPanel in the first row of the grid.

    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="8" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <DockPanel Grid.Row="0" LastChildFill="True">
        <Button DockPanel.Dock="Right" x:Name="Refresh_Button" VerticalAlignment="Center" Style="{StaticResource Button16}" Click="MethodPanelrefreshXML_Click" ToolTip="Refresh the Source-Target Configuration File">
            <Image Source="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericRefresh16.png"></Image>
        </Button>
        <ListBox DockPanel.Dock="Left" x:Name="MainTabs" Style="{DynamicResource PanelIndicator}" SelectedIndex="0" >
            <ListBox.Items>
                <frameworkControls:PanelHeader Text="File"/>
                <frameworkControls:PanelHeader Text="Fields"/>
            </ListBox.Items>
        </ListBox>
    </DockPanel>

In addition, rather than storing the image with the solution I am referencing it from the application resources. This is a trick they don't show in the SDK, but if there is any icon you like in the application you can get it's reference using Snoop. This will ensure you get the correct light and dark theme images.

I noticed that you added 2 new selection changed event handlers to the Dockpane1.xaml.cs that are not used. You should be able to remove these.

JRosenfeldIntern commented 7 years ago

Thanks @chris-fox I went ahead and implemented those changes and sent another pull request.

JRosenfeldIntern commented 7 years ago

Fixed the grid row numbers. That was likely due to my original solution having the button as an independent row instead of in the top right.