|
POST
|
hi mody, this actually proved to be a lot trickier than I expected. Seems Datagrid is not "fully" WPF compliant - it does not have a dependency property for its selected items (the way, say a ListBox or ComboBox has). https://stackoverflow.com/questions/22868445/select-multiple-items-from-a-datagrid-in-an-mvvm-wpf-project gave some options for a solution. I went with this one: >>One way to to what you want is to register the SelectionChanged event of the DataGrid to update the property of your ViewModel, that stores the selected items.<< Sub-classing the Datagrid and adding a dependency property for the selected items is a more sophisticated way to go for sure, and is explained in the stackoverflow post, but using the "SelectionChanged" event on the datagrid is v straighforward and this, at least, should get u pointed in the right direction. I will get this added as a sample to community samples for a complete solution. It's too much code to paste here in its entirety. <UserControl x:Class="DatagridMultiSelect.UI.DataGridDockpaneView"
....>
....
<Grid>
....
<DataGrid Grid.Row="1" HorizontalAlignment="Stretch" Height="Auto"
ItemsSource="{Binding FeatureData}" VerticalAlignment="Top"
x:Name="dataGrid"
Style="{DynamicResource Esri_DataGrid}"
HeadersVisibility="Column"
AutoGenerateColumns="True"
IsReadOnly="True"
SelectionMode="Extended"
SelectionUnit="FullRow"
CanUserSortColumns="True"
RowHeaderWidth="0" Margin="0,0,5,0"/> Code behind of the view: public partial class DataGridDockpaneView : UserControl {
public DataGridDockpaneView()
{
InitializeComponent();
this.Loaded += DataGridDockpaneView_Loaded;
}
private void DataGridDockpaneView_Loaded(object sender, RoutedEventArgs e)
{
var dg_vm = this.DataContext as DataGridDockpaneViewModel;
dg_vm.SetDataGrid(this.dataGrid);
} and in the dockpane view model: internal class DataGridDockpaneViewModel : DockPane
{
private const string _dockPaneID = "DatagridMultiSelect_UI_DataGridDockpane";
private DataGrid _dataGrid = null;
private static readonly object _lock = new object();
internal void SetDataGrid(DataGrid dataGrid) {
_dataGrid = dataGrid;//wire up the datagrid
//From:https://stackoverflow.com/questions/22868445/select-multiple-items-from-a-datagrid-in-an-mvvm-wpf-project
_dataGrid.SelectionChanged += (o, e) => {
var grid = o as DataGrid;
var selected = grid.SelectedItems;
lock (_lock) {
//"MyRecord" is whatever your custom DataGrid
//content items are...
var sel_fd = selected.OfType<MyRecord>().ToList();
//TODO - use the selection from the grid...
//
}
};
}
...
//Elsewhere:
internal class MyRecord
{
//your custom class
}
... View more
12-18-2023
05:07 PM
|
1
|
0
|
3517
|
|
POST
|
this might help: https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Geometry#build-a-donut-polygon
... View more
12-11-2023
10:44 PM
|
1
|
1
|
1222
|
|
POST
|
Gotcha. it's not supported. i'll take this as a new requirement for GP
... View more
12-08-2023
08:57 AM
|
0
|
2
|
2577
|
|
POST
|
@sgn_GSI i did a quick scan of DigiCert's web site for KeyLocker: https://knowledge.digicert.com/solution/digicert-keylocker Sounds like KeyLocker performs in the same role as the USB token - as in, KeyLocker wld hold the private keys but in the cloud. Note step 9: "Your certificate is issued and associated with the key generated and stored in KeyLocker"... so probably a similar workflow as with a USB - once u sign up w/KeyLocker, they say u get a certificate without private keys that u then use for signing (I assume it goes in the store? same as w a USB) and the actual request for the private key during signing wld most likely trigger the call to the KeyLocker? The designated "KeyLocker lead" is, I guess, whoever has the password allowing sign in to the KeyLocker (step 10) and who, presumably, is responsible for the signing. Looks like they charge u for each signing (in batches of 1000) tho rather than a one time purchase cost of a USB based token or similar hardware device (w/ unlimited use until the certificate expires). However, there is the convenience of not needing a physical USB or smart card or other device. Obviously, with these new workflows, automated signing/unattended signing is prob going to be a problem as signing cld require a pwd/PIN each time (whether KeyLocker or USB). With KeyLocker it sounds like u have to be careful too if u r running multiple builds w/signing as u cld quicky burn through your 1000 signings limit.
... View more
12-07-2023
06:01 PM
|
0
|
1
|
3910
|
|
POST
|
> that would defeat the whole purpose of the new requirement imposed by the CA/B. I dont think so. the certificate in the store (read from the USB by the OS) wld be without the private keys (unlike w/ the old spec). For YubiKey specifically, I believe it provides a smart card minidriver that the Microsoft crypto api loads when it encounters, in this case, a YubiKey. The certificate (in the store) from the USB, and -without- the private keys - has an associated cryptographic provider that gets called (by the api) to compute the signature. This triggers the whole PIN/pwd prompt to protect access to the private key - which is on the USB - and is required to complete the signing process. Obviously the USB must be present or signing fails. ArcGISSignAddin.exe is just a wrapper on top of the windows crypto api and shld just work. There's no external change to the crypto api afaik. yes we are looking at this.
... View more
12-07-2023
03:57 PM
|
0
|
3
|
3913
|
|
POST
|
can you try layer.GetFieldDescriptions() instead? https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic11388.html
... View more
12-07-2023
03:27 PM
|
0
|
0
|
1304
|
|
POST
|
this is only possible in a configuration. https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic22373.html
... View more
12-07-2023
10:27 AM
|
0
|
0
|
736
|
|
POST
|
Pls use: Geoprocessing.MakeEnvironmentArray https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic9386.html There are examples on that page
... View more
12-07-2023
10:16 AM
|
0
|
4
|
2591
|
|
POST
|
eg: https://stackoverflow.com/questions/185208/how-do-i-get-and-set-environment-variables-in-c
... View more
12-06-2023
10:21 AM
|
0
|
1
|
2608
|
|
POST
|
Does your vendor's USB allow a certificate to be installed to the certificate store on the physical machine to which it is attached? As i understand it, (disclaimer on "understand"!) some vendors drivers support this (eg YubiKey - https://support.yubico.com/hc/en-us/articles/360016614840-Code-Signing-with-the-YubiKey-on-Windows) ....double-clicking ArcGISSignAddin.exe invokes the UI allowing u to select the certificate from the store (with the USB token present) but to sign wld require the PIN or password for the USB (which is what protects the private key).....does your vendor's USB support this workflow?
... View more
12-06-2023
10:17 AM
|
0
|
1
|
3935
|
|
POST
|
By default VS shows WPF Data Binding errors and warnings. Binding errors (and, of course, warnings) are not exceptions which is why Pro keeps running. Also, these are coming from Pro, not your addin. I believe u can customize this view (and the output window) via VS WPF Trace Settings - by default Data Binding is set to Warning.
... View more
11-28-2023
08:30 AM
|
0
|
1
|
1264
|
|
POST
|
>> I'm looking at CIMEditingTemplateToolOptions, but struggling to use it. hi Dave, so this is a v specialized "setting" in the template. Essentially, if u are authoring a construction tool and want to associate it with a custom UI for "configurable options" on the create features pane u implement something called a ToolOptionsEmbeddableControl. Any custom option settings u wld like to persist in the template go in the CIMEditingTemplateToolOptions (which is a dictionary fyi but is null by default). we hv covered this in various Dev Summit sessions. Most recently this year: https://esri.github.io/arcgis-pro-sdk/techsessions/2023/PalmSprings/Intermediate-Editing-2.zip (u can find a complete listing of our sessions here: https://github.com/Esri/arcgis-pro-sdk/wiki/Tech-Sessions ) this shld help u get up to speed. Look at the section "Construction Tool - Tool Options UI" in the ppt for how to implement a ToolOptionsEmbeddableControl. This base class (u inherit from) provides a GetToolOption and SetToolOption that does the magic for u. LoadFromToolOptions, another override, gives your custom UI an opportunity to retrieve the custom options (if any) before your UI is initialized. Editing_2_ConstructionTool.zip which is included in the download has the example code as described in the slides.
... View more
11-02-2023
07:35 AM
|
0
|
1
|
1725
|
|
POST
|
hi marco, so it's a bug. custom parameter properties in a layer file shld work. the dev team has submitted an issue. if u want to, u can open a bug report with Tech Support and they can link the internal issue to the bug report allowing u to track progress. The only thing working, it seems, per the dev team, as currently is if custom parameters are added directly to the URL - for example: {
"type" : "CIMFeatureTable",
"displayField" : "STATE_NAME",
"editable" : true,
"dataConnection" : {
"type" : "CIMStandardDataConnection",
"customParameters" : [ <----- this is ignored! bug
{
"type" : "CIMStringMap",
"key" : "token",
"value" : "QVoIg1fwLpgBMAiov2v6P1CYanOHEn27wFNfQI4IoJfB8SG3qfUmnhJZeSS05yyj"
}
],
This shld work (note the url)
"workspaceConnectionString" : "URL=https://acme.server.com/arcgis/rest/services/Acme_Layers/MapServer;CUSTOMPARAMETERS=token=QVoIg1fwLpgBMAiov2v6P1CYanOHEn27wFNfQI4IoJfB8SG3qfUmnhJZeSS05yyj",
"workspaceFactory" : "FeatureService",
"dataset" : "5",
"datasetType" : "esriDTFeatureClass"
},
"studyAreaSpatialRel" : "esriSpatialRelUndefined",
"searchOrder" : "esriSearchOrderSpatial"
}
... View more
11-01-2023
03:09 PM
|
0
|
2
|
2540
|
|
POST
|
hi marco, sorry, missed your follow on q. i spoke w/ the development team and it "should" work. they cant repro. they're going to put a sample add-in together for u. note: is it that the token is not being sent or that the server is rejecting the token?
... View more
10-31-2023
09:26 AM
|
0
|
0
|
2547
|
|
POST
|
looks like the patch comes from the layer renderer and not from the legend item, meaning: u have to change the (patch in the) layer renderer. Also, I could not see a way to change the "Name" of the legend item. That looks like it is always set from the layer name and so wld mean changing the layer name. Changing the name property on the underlying CIMLegendItem had no effect. The code below assumes the renderer is a simple value...u will need to adjust it accordingly depending on what the renderer is in your case... QueuedTask.Run(()=> {
var legend = LayoutView.Active.Layout.GetElementsAsFlattenedList()
.OfType<Legend>().FirstOrDefault();
var fl =
legend.MapFrame.Map.GetLayersAsFlattenedList().
OfType<FeatureLayer>().Where(
lyr => lyr.ShapeType == esriGeometryType.esriGeometryPolyline).FirstOrDefault();
if (fl == null)
return;
//change the patch symbol...cast the renderer to the
//correct type - simple, UVR, Class break, etc.
var svr = fl.GetRenderer() as CIMSimpleRenderer;
if (svr.Patch == PatchShape.LineZigZag)
svr.Patch = PatchShape.Default;
else
svr.Patch = PatchShape.LineZigZag;
fl.SetRenderer(svr);
... View more
10-27-2023
02:48 PM
|
0
|
0
|
1417
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Tuesday | |
| 1 | 3 weeks ago | |
| 1 | 01-08-2026 02:03 PM | |
| 1 | 01-08-2026 02:15 PM | |
| 3 | 12-17-2025 11:33 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|