|
POST
|
Gintautas Kmieliauskas this sample is what I needed. Thank you, thank you, thank you. Looking over the sample i realized my main mistake. I didn't know you could Inherits Page AND ALSO Implements IDataErrorInfo on the same class. It just never dawned on me. That is why I was having trouble determining where I put the logic and properties. Once I did that everything fell into place. Again thank you for sticking with my learning curve.
... View more
05-08-2020
08:46 AM
|
0
|
1
|
1143
|
|
POST
|
Well I gave it a shot. I spent half a day trying to get this to work and just couldn't. I think I am missing something. The source code in your link is a dead link. Tried other sources but just couldn't get it to work.
... View more
05-07-2020
05:30 PM
|
0
|
3
|
3142
|
|
POST
|
In my add-in I allow the user to select where their output feature class will be saved. When I put my code inside the suggested QueuedTask.Run and FrameworkApplication.Current.Dispatcher.Invoke it will just sit there and spin. If I take the code outside of this then it works fine. What is the proper way to use SaveItemDialog? QueuedTask.Run( Sub() FrameworkApplication.Current.Dispatcher.Invoke( Sub() Dim savFeatClassDialog As New SaveItemDialog savFeatClassDialog.Title = "Output Feature Class..." savFeatClassDialog.InitialLocation = Project.Current.DefaultGeodatabasePath savFeatClassDialog.OverwritePrompt = True savFeatClassDialog.Filter = ItemFilters.featureClasses_all Dim IsResOk As Boolean? = savFeatClassDialog.ShowDialog If IsResOk Then txtOutput.Text = savFeatClassDialog.FilePath End If End Sub) End Sub)
... View more
05-07-2020
04:21 PM
|
0
|
2
|
1332
|
|
POST
|
So now I tried setting Validation.Error="Validation_Error" in my XAML. Then I put the handler Validation_Error in the code behind the XAML but that's not where I want it correct? The handler should go in the ViewModel right? How would I then reference that in my XAML? Private Sub Validation_Error(sender As Object, e As ValidationErrorEventArgs) Debug.Print("there was an error") End Sub
... View more
05-06-2020
04:31 PM
|
0
|
5
|
3142
|
|
POST
|
Wolfgang Kaiser I had something similar but didnt work. I believe its because of the Validity rules. Since the path doesnt exist then the property is never set. Public Property MyDataDir As String Get Return _myAppDataDir End Get Set(ByVal value As String) MyBase.IsValid = False If SetProperty(_aaAnalystAppDataDir, value, Function() MyAppDataDir) Then MyBase.IsModified = True MyBase.IsValid = True 'the property passed the validity rules Else MyBase.IsValid = False End If End Set End Property I even changed my XAML to <Binding Path="MyAppDataDir" UpdateSourceTrigger="PropertyChanged" ValidatesOnExceptions="True" ValidatesOnDataErrors="True" NotifyOnValidationError="True">
... View more
05-06-2020
04:16 PM
|
0
|
6
|
3142
|
|
POST
|
Ok I am able to bind my validation rules to the textbox. It works great! Thanks!. But now am struggling how to get that result back to the ViewModel so I can update the IsValid of the page. My XAML looks like this <TextBox x:Name="txtLayerDir" TextWrapping="Wrap" VerticalAlignment="Top" Margin="10,86,36,0"> <TextBox.Text> <Binding Path="MyAppDataDir" UpdateSourceTrigger="PropertyChanged"> <Binding.ValidationRules> <ui:DataPathRule/> </Binding.ValidationRules> </Binding> </TextBox.Text> </TextBox> In the ViewModel I can initialize to False and I can see that works: Protected Overrides Function InitializeAsync() As Task 'setup the initial validity of the Page MyBase.IsValid = False Return Task.FromResult(0) End Function But how do I process updates? Just cant seem to figure that one out.
... View more
05-06-2020
01:32 PM
|
0
|
8
|
3142
|
|
POST
|
Yes Im aware of the validation binding. Thank You. What I am asking is how we tap into the Pro Settings OK button to disable it when something is not valid.
... View more
05-06-2020
07:13 AM
|
0
|
10
|
3142
|
|
POST
|
I followed the sample here ProGuide Custom settings · Esri/arcgis-pro-sdk Wiki · GitHub and have added my own add-in settings to the backstage. I've binded several properties to the UI and it works great. I have a textbox where the user can browse to a folder where our company's data exists. If the user inputs an invalid folder I wanted to change the backcolor of the textbox and set the OK button to disabled until the input is fixed. A similar thing is done with the Layout options. Ive looked in the community samples and looked at the Pro SDK and cant find anything. Where would I add my validation logic to mimic the existing Layout options?
... View more
05-05-2020
11:19 AM
|
0
|
12
|
4565
|
|
POST
|
Stepping through your snippets I think I get it now. It was being lost on me in the community samples because they had so much going on. Coming from WinForms I'm not used to so many hooks. A suggestion...a very simple article or just maybe this post would do wonders for most developers. As for your suggestions on where to Subscribe I prefer the first method. Only for the simple fact that on the second one you have to add the Await Task.Run so it doesn't throw an exception. The community sample has await UpdateSymbolList(); which its way to do async. I will continue with the video you have posted and I will also try the search method you described. Many, MANY Thanks!!!
... View more
05-01-2020
03:05 PM
|
0
|
0
|
2536
|
|
POST
|
Wow just one brief look at this and i already understand it. Let me take the path you have laid out and I will educate myself a bit more. Every day that i wok more and more with WPF I "hate it less" and am starting to see the light. I will post my progress.
... View more
05-01-2020
01:51 PM
|
1
|
0
|
2536
|
|
POST
|
I have a DockPane with several controls and I need to change the visibility based on the active Map For example I have a button "Import From Map". If there is no active view that is a map then I want to hide these controls, otherwise i want to display the controls. I looked at the community samples. ProceduralSymbolLayersWithRulePackages and ProceduralSymbolLayersWithRulePackages. Ive also watched the ESRI video on MVVM ArcGIS Pro SDK for .NET: UI Design and MVVM - YouTube and searched on geonet. I'm still not getting it. I know I have to setup my control XAML with the binding Visibility="{Binding ControlVisible}" and then that property has to be developed. How do i subscribe to the Pro events so that it will tell my property that the active view has changed and thus the controls need updating? I just cant seem to connect the dots.
... View more
05-01-2020
11:37 AM
|
0
|
3
|
2676
|
|
POST
|
I have the CoordSysDialog in my project. I think for now I will just use that. One question..since that sample is an add-in itself would it be recommended that I port that Dialog to my own codebase OR just reference the DLL as any other .NET DLL?
... View more
04-29-2020
11:18 AM
|
0
|
0
|
336
|
|
POST
|
Gintautas Kmieliauskas I looked at your samples and don't think this will work. My process is as follows: 1. Run a standard ESRI gp tool "management.CreateFishnet". The tool will throw an exception if invalid geodb path or folder do not exist so the user can provide a geodb feature class or a shapefile feature class path for use as OUTPUT to the tool. 2. After the gp tool finishes I then iterate through each feature and modify the geometry. This is custom code so it doesn't exist as an ESRI gp tool. In order for me to do this I need to know the type of the output feature class so i can open it. I need to use FileSystemConnectionPath for shapefiles and FileGeodatabaseConnectionPath for a geodb feat class. The example assumes you have a layer with a feature class attached to it.
... View more
04-28-2020
12:44 PM
|
0
|
0
|
1582
|
|
POST
|
Thank you Uma Harano. Yes I have taken a look at the sample. My question is how does that differ from the built in control as I have asked here https://community.esri.com/thread/252237-how-do-i-use-the-coord-system-dialog . The sample works but I was unclear on how to use it in my own add-in. What I did was just reference the DLL just as if it were any other .NET library. At first I thought I had to register the CoordSysDialog add-in like I do mine. If there was a note in the documentation on how to use it in your own project i may have missed it.
... View more
04-28-2020
12:23 PM
|
0
|
1
|
2478
|
|
POST
|
Wolfgang Kaiser thank you for the tips. I did look at several of you and Uma on starting an add-in. I viewed the one on multi threading and things are starting to make more sense. In response to your items: 1. After watching your video and you showing me what needs to be done it now works as it should. thanks! 2. I can code in c# but am not proficient. Over the next year or two I think I will make the transition. That being said, Microsoft are still supporting VB up to and including .NET Core 5 right? There are many developers still writing in VB as it has been our language for some time and I can produce code quite fast. One thing I do think should happen is that the documentation should be updated. For example ProConcepts Geoprocessing · Esri/arcgis-pro-sdk Wiki · GitHub says in the header "Language: C# and Visual Basic". If no VB samples are provided then the header should not state it. Or it should say something like "Language: C# (translate to VB here) with a link to Telerik Converter or some other online translator. many thanks for all your help.
... View more
04-28-2020
12:19 PM
|
0
|
1
|
1711
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-25-2020 09:25 PM | |
| 1 | 08-17-2022 11:17 AM | |
| 1 | 07-24-2022 01:36 PM | |
| 1 | 07-14-2022 11:22 AM | |
| 1 | 07-14-2022 10:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-27-2025
11:11 AM
|