Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample project does not save value in custom page #4

Open
mhogeweg opened this issue Feb 26, 2019 · 3 comments
Open

Sample project does not save value in custom page #4

mhogeweg opened this issue Feb 26, 2019 · 3 comments

Comments

@mhogeweg
Copy link
Member

After installing the toolkit in Visual Studio, I create a new toolkit project.

Compiling is fine and running it starts ArcGIS Pro and I can select the custom style as my style.

for a layer I open the editor and see the custom page loaded with the single field.

Entering data and clicking save results the value not being saved in the metadata. In VS the following error is displayed when selecting the page 'Custom Page':

System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; target element is 'ListBoxItem' (Name=''); target property is 'VerticalContentAlignment' (type 'VerticalAlignment')

@aleta15
Copy link
Collaborator

aleta15 commented Feb 26, 2019

I had trouble with that control also. I thought a colleague was able to get it to work, but I didn't have a chance to figure out what they did differently to allow that. In the meantime, check out the instructions here in the wiki: https://github.com/Esri/arcgis-pro-metadata-toolkit/wiki/Create-a-custom-page, which direct you to remove the default control and add one that actually works.

@mhogeweg
Copy link
Member Author

mhogeweg commented Feb 27, 2019

It appears that the default control is missing the binding to the XML. The example on the create-a-custom-page page does include that binding.

<TextBox Style="{DynamicResource EditorTextBoxStyle}"
                Text="{Binding XPath=/metadata/custom/myData/trackingStatus, Mode=TwoWay}"/>

also note: the sample on the create-a-custom page page binds the track status to //status

but the XmlDataProvider puts the value in /metadata/custom/myData/trackingStatus

@gyetman
Copy link

gyetman commented Jan 17, 2024

Is there a completed sample of this example code (custom page)? We have a use case for it but seem unable to get it to work locally; have tried on two machines so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants