O.K. Jen, thanks for your reply. I step away for awhile and now I have a few more questions...hopefully you are still out there and can help me out.For a review here's what I have: In my EditorWidgetStyle xaml I have added this button<Button x:Name="ViewAttribute" Command="{Binding Select}" CommandParameter="new" Style="{StaticResource ButtonStyle}" ToolTipService.ToolTip="View Attachments" Click="ViewAttribute_Click">
<Image Source="Images/AttImage.png" Stretch="None"/>
</Button>
When I add my feature layer here's what I define: <esri:FeatureLayer ID="TPOINTS" DisableClientCaching="True"
AutoSave="False"
Url="http://myserver.com/ArcGIS/rest/services/edittest/FeatureServer/0"
OutFields="*"
Mode="OnDemand" />
Then per your suggestion I added the necessary EditorWidget I subscribed/wired the event handler you wrote: EditorWidget_EditCompleted
<!-- Editing Tools -->
<userControls:CollapsiblePanel x:Name="EditorTool" IsExpanded="True"
RenderTransformOrigin="1,0"
VerticalContentAlignment="Top" HorizontalContentAlignment="Right" Margin="0,75,10,0" Effect="{StaticResource dropShadow}" >
<Grid x:Name="EditorToolStripGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Border Background="{StaticResource CommonPanelBorderBackgroundBrush}" BorderBrush="{StaticResource CommonBorderBrush}" BorderThickness="1" CornerRadius="6" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border Effect="{StaticResource miniDropShadow}" Style="{StaticResource RibbonElementBorder}" Padding="15" Margin="10" >
<StackPanel x:Name="EditorToolStrip" Margin="0,5,5,0" >
<Border Background="#00919191" CornerRadius="5"
HorizontalAlignment="Right" VerticalAlignment="Top"
Padding="5" BorderBrush="Transparent">
<Border.Effect>
<DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" />
</Border.Effect>
<StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="0,5,5,0" VerticalAlignment="Top" >
<esri:EditorWidget x:Name="MyEditorWidget"
Map="{Binding ElementName=Map}"
Width="300"
AutoSelect="False"
AlwaysDisplayDefaultTemplates="True"
GeometryServiceUrl="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"
ShowAttributesOnAdd="True"
Loaded="EditorWidget_Loaded" Style="{StaticResource EditorWidgetStyle1}"
EditCompleted="EditorWidget_EditCompleted"/>
</StackPanel>
</Border>
</StackPanel>
</Border>
</Border>
<Image Source="images/CloseX.png" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="3" Stretch="None" Cursor="Hand" ToolTipService.ToolTip="Close" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown" >
<actions:ToggleCollapseAction TargetName="EditorTool" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
</Grid>
</userControls:CollapsiblePanel>
<!-- END Editing Tools-->
<!-- Attachment Tools -->
<Grid x:Name="AttachmentGrid" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,20,15,0" Visibility="Collapsed">
<Border Background="{StaticResource CommonPanelBorderBackgroundBrush}" BorderBrush="{StaticResource CommonBorderBrush}" BorderThickness="1" CornerRadius="6" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border Effect="{StaticResource miniDropShadow}" Style="{StaticResource RibbonElementBorder}" Padding="15" Margin="10" >
<StackPanel Orientation="Vertical">
<TextBlock Text="Click on a point feature to select it, and click the 'Add' button to attach a file."
Width="275" TextAlignment="Left" Margin="20,20,20,5" TextWrapping="Wrap" FontWeight="Bold"/>
<esri:AttachmentEditor x:Name="MyAttachmentEditor" VerticalAlignment="Top" Margin="20,5,20,20"
Background="WhiteSmoke" Width="280" Height="190" HorizontalAlignment="Right"
FeatureLayer="{Binding Layers[TPOINTS], ElementName=Map}"
Filter="All Files (*.*)|*.*|Image Files|*.tif;*.jpg;*.gif;*.png;*.bmp|Text Files (.txt)|*.txt"
FilterIndex="1" Multiselect="True"
UploadFailed="MyAttachmentEditor_UploadFailed">
</esri:AttachmentEditor>
</StackPanel>
</Border>
</Border>
<Image Source="images/CloseX.png" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="3" Stretch="None" Cursor="Hand" ToolTipService.ToolTip="Close" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseLeftButtonDown" >
<actions:ToggleCollapseAction TargetName="AttachmentTool" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Image>
</Grid>
<!-- END Attachment Tools-->
In my code behind C# code I have
#region Edit Tools
private void EditorWidget_Loaded(object sender, RoutedEventArgs e)
{
string[] myLayerIDs = { "TPOINTS" };
MyEditorWidget.LayerIDs = myLayerIDs;
}
#endregion
#region Attachment Tool
private void MyAttachmentEditor_UploadFailed(object sender, ESRI.ArcGIS.Client.Toolkit.AttachmentEditor.UploadFailedEventArgs e)
{
MessageBox.Show(e.Result.Message);
}
private void ViewAttribute_Click(object sender, RoutedEventArgs e)
{
if (AttachmentGrid.Visibility == Visibility.Visible)
{
AttachmentGrid.Visibility = Visibility.Collapsed;
attachmentEditorActive = false;
}
else
{
AttachmentGrid.Visibility = Visibility.Visible;
attachmentEditorActive = !attachmentEditorActive;
}
}
//public event EventHandler<Editor.EditEventArgs> EditCompleted
//{
//}
private void EditorWidget_EditCompleted(object sender, Editor.EditEventArgs e)
{
if (e.Action == Editor.EditAction.Select && attachmentEditorActive)
{
foreach (var edit in e.Edits)
{
MyAttachmentEditor.GraphicSource = edit.Graphic;
break;
}
}
}
#endregion
I have a few quick questions, i've been working on and can't seem to figure out:1. when I try to attach something I get an the error "Upload Failed" Fiddler states something like - {"addAttachmentResult":{"objectId":-1,"globalId" : null,"success":false,"error":{"code":0,"description":""}}}When I check the rest endpoint I see Has Attachments: TrueBut I don't see any relationship: like Relationships: ServiceRequest_IncidentPriority (1) -- Related To Incident Priority (1)Should I see the relationship to the attachment tables? If so do I need to do something special.Question 2. If I create a new point I can't seem to get the attachment (windows explore) to launch. The add button is active. Should I be able to add a new feature and then add a attachment?Question 2b. If I create a new point and some attributes, hit the save button. The next time I launch the application I don't see the point I created but I know I can edit the layer because I've edited with the Windows ESRI ArcGIS Phone Application. I'm I missing something in my code to post the edits. Question 3. If I use the Unselect Tool it doesn't disable the "add attachment button" is there away to hook the unselect button to the attachmentEditorActive? Also on a side note if I have a point selected and then show the attachment editor it doesn't activate the add button I must unselect and the reselect once the attribute editor window is open. Thanks for everything.Dave