<Popup x:Name="MyPopup" VerticalOffset="25" HorizontalOffset="400" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="Visible"> <Border BorderBrush="#FF51626F" BorderThickness="5"> <StackPanel x:Name="PopUpPanel" Background="LightGray" Height="Auto" Width="Auto" > <TextBlock x:Name="PopUpText" Height="40" Width="Auto" Margin="15" Text="THANK YOU VOLUNTEER!!" FontFamily="Arial" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF51626F"/> <TextBlock x:Name="PopUpSubText" Margin="10" Height="80" Width="Auto" Text="You will be registered for the following location and time. Please complete the required contact information below and click SAVE. Please note, your NAME and an email address is required to complete your registration. You will receive an email confirming your volunteer location." FontFamily="Arial" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#FF51626F" MaxWidth="400" TextWrapping="Wrap" /> <Border x:Name="FeatureDataFormBorder" Visibility="Visible" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="10,10,10,0" Width="400" Height="300" > <Border.Effect> <DropShadowEffect Color="#FF51626F" Direction="-45" BlurRadius="20" Opacity=".75" /> </Border.Effect> <esri:FeatureDataForm x:Name="MyFeatureDataForm" FeatureLayer="{Binding Path=Layers[AllAvailableFeatureLayer], ElementName=Map}" IsEnabled="True" IsReadOnly="False" LabelPosition="Left" CommitButtonContent="Save" EditEnded="MyFeatureDataForm_EditEnded"/> </Border> <StackPanel Margin="10" Orientation="Horizontal" HorizontalAlignment="Center"> <Button x:Name="ClosePopupButton" Height="34" Width="73" Content="Close" Background="#FF51626F" FontFamily="Verdana" FontSize="14" Click="ClosePopupButton_Click" /> </StackPanel> </StackPanel> </Border> </Popup>
private void FeatureLayer_MouseLeftButtonUp(object sender, GraphicMouseButtonEventArgs args) { foreach (Layer lyr in Map.Layers) { if (lyr is FeatureLayer) { FeatureLayer featureLayer1 = lyr as FeatureLayer; for (int i = 0; i < featureLayer1.SelectionCount; i++) featureLayer1.SelectedGraphics.ToList().UnSelect(); } } FeatureLayer featureLayer = sender as FeatureLayer; SelectedFeatureLayer = featureLayer; args.Graphic.Select(); MyFeatureDataForm.FeatureLayer = featureLayer; MyFeatureDataForm.GraphicSource = args.Graphic; FeatureDataFormBorder.Visibility = Visibility.Visible; MyPopup.IsOpen = true; } private void FeatureLayer_BeginSaveEdits(object sender, ESRI.ArcGIS.Client.Tasks.BeginEditEventArgs e) { } private void FeatureLayer_EndSaveEdits(object sender, ESRI.ArcGIS.Client.Tasks.EndEditEventArgs e) { foreach (Layer lyr in Map.Layers) { if (lyr is FeatureLayer) { FeatureLayer featureLayer = lyr as FeatureLayer; featureLayer.Update(); } } SendEmail(); }
Solved! Go to Solution.
private void FeatureLayer_BeginSaveEdits(object sender, ESRI.ArcGIS.Client.Tasks.BeginEditEventArgs e) { } private void FeatureLayer_EndSaveEdits(object sender, ESRI.ArcGIS.Client.Tasks.EndEditEventArgs e) { //foreach (Layer lyr in Map.Layers) //{ // if (lyr is FeatureLayer) // { // FeatureLayer featureLayer = lyr as FeatureLayer; // //featureLayer.Update(); // } //} SendEmail(); } private void refreshMap() { foreach (Layer lyr in Map.Layers) { if (lyr is FeatureLayer) { FeatureLayer featureLayer = lyr as FeatureLayer; featureLayer.Update(); } } } private void ClosePopupButton_Click(object sender, RoutedEventArgs e) { refreshMap(); MyPopup.IsOpen = false; }
private void FeatureLayer_BeginSaveEdits(object sender, ESRI.ArcGIS.Client.Tasks.BeginEditEventArgs e) { } private void FeatureLayer_EndSaveEdits(object sender, ESRI.ArcGIS.Client.Tasks.EndEditEventArgs e) { //foreach (Layer lyr in Map.Layers) //{ // if (lyr is FeatureLayer) // { // FeatureLayer featureLayer = lyr as FeatureLayer; // //featureLayer.Update(); // } //} SendEmail(); } private void refreshMap() { foreach (Layer lyr in Map.Layers) { if (lyr is FeatureLayer) { FeatureLayer featureLayer = lyr as FeatureLayer; featureLayer.Update(); } } } private void ClosePopupButton_Click(object sender, RoutedEventArgs e) { refreshMap(); MyPopup.IsOpen = false; }