Select to view content in your preferred language

WindowPanel close button fire featurelayer event problem

737
4
07-15-2010 05:03 PM
LianchengRen
Emerging Contributor
If a WindowPanel has close button up a polygon of FeatureLayer with click event, when click this close button of WindowPanel, it close the WindowPanel and fire the click event of FeatureLayer :(.

How can fix it?
Sorry for my English.
0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor
I didn't reproduce the issue.

I tried with the overview window (which is a window panel) and the event MouseLeftButtonDown on a feature layer (perhaps not the right one?).

Could you give more information on how to reproduce the issue?

Thanks
0 Kudos
LianchengRen
Emerging Contributor
Page Code:
           <esri:FeatureLayer ID="layer_7" Url="http://**.**.**.**/ArcGIS/rest/services/jd_s_Dynamic/MapServer/7"  Initialized="FeatureLayer_Initialized_7"  Opacity="0.3"
                               FeatureSymbol="{StaticResource ResultsFillSymbol}" >

                <esri:FeatureLayer.OutFields>
                    <sys:String>table_1.id</sys:String>
                    <sys:String>table_1.name</sys:String>
                </esri:FeatureLayer.OutFields>

                <esri:FeatureLayer.MapTip>
                    <Border CornerRadius="10" BorderBrush="#FF222957" BorderThickness="2" Margin="0,0,15,15">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="1.038,1.136" StartPoint="0.015,0.188">
                                <GradientStop Color="#FFD1DFF2"/>
                                <GradientStop Color="#FF62BCDE" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.Background>
                        <Border.Effect>
                            <DropShadowEffect ShadowDepth="10" BlurRadius="14" Direction="300" />
                        </Border.Effect>

                        <StackPanel Margin="4">
                            <Grid>
                                <TextBlock Text="Name�?" />
                                <TextBlock Text="{Binding [table_1\.name]}" FontWeight="Bold" Margin="60,0,0,0"/>
                            </Grid>
                        </StackPanel>


                    </Border>
                </esri:FeatureLayer.MapTip>

            </esri:FeatureLayer>


C#:
        private void FeatureLayer_Initialized_7(object sender, EventArgs e)
        {
            ((FeatureLayer)sender).MouseLeftButtonUp += new FeatureLayer.MouseButtonEventHandler(FeatureLayer_MouseLeftButtonUp_7);
        }

        private void FeatureLayer_MouseLeftButtonUp_7(object sender, GraphicMouseButtonEventArgs args)
        {
            Graphic graphic = args.Graphic;
            FeatureLayer_level_chick = 7;
            DataGrid_navigator_dizhi_item_select(graphic);

        }


Element(polygon) in "layer_7" have Maptip and click event.  If the Close button of Windowpanel up the Element(polygon) of "layer_7", clicking the close button will close the Windowpanel and fire "FeatureLayer_MouseLeftButtonUp_7".
0 Kudos
DominiqueBroux
Esri Frequent Contributor
It's because the WindowPanel which is provided in the template is using the LeftButtonDown event to close itself.

Then the LeftButtonUp is fired on the underlying elements (a feature layer in your case) because the window panel is no more existing.

To avoid this behavior you can create a button (instead a simple image) to close the window (the click event of a button handles both buttondown and buttonup events).
0 Kudos
LianchengRen
Emerging Contributor
😄 Get it.

Thanks.
0 Kudos