|
POST
|
Hi, Your datagrid behavior implementation is redundant. You can do the same workflow in your datagrid SelectedItem binded property setter: private object _selectedBene;
public object SelectedBene
{
get { return _selectedBene; }
set {
_selectedBene = value;
OnPropertyChanged();
_ = YourWorkflow();
}
}
private async Task YourWorkflow()
{
var LayerBeni = MapView.Active.Map.FindLayers(Constants.LayerNames.Beni).OfType<FeatureLayer>().FirstOrDefault();
//ZoomTo - IT BREAKS COMMAND BINDING
await MapView.Active.ZoomToAsync(LayerBeni, SelectedBene.OID, new TimeSpan(0, 0, 1));
//Flash
var selectionDictionary = new Dictionary<MapMember, List<long>>() { { LayerBeni, new List<long>() { SelectedBene.OID } } };
SelectionSet selectionToFlash = SelectionSet.FromDictionary(selectionDictionary);
MapView.Active.FlashFeature(selectionToFlash);
} Sorry, I don't know your real structure and object types. So I improvised
... View more
03-28-2024
09:52 AM
|
0
|
3
|
1592
|
|
POST
|
Hi, You can create CustomControl. Then customize it as you want. For example: <UserControl x:Class="RibbonControls.CustomControl1View"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="clr-namespace:RibbonControls"
xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
d:DataContext="{Binding Path=ui.CustomControl1ViewModel}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Content="My Combobox" />
<ComboBox Grid.Row="1" />
</Grid>
</UserControl> It will look like this: I have modified RibbonControls sample
... View more
03-26-2024
02:35 PM
|
1
|
0
|
838
|
|
POST
|
Hi, Have you tried to set AutoZoomOnEmptyMap outside LayerCreationParams constructor. Sometimes it could help. Like in code below: LayerCreationParams lyrParams = new(uri); // uri is a path to a .lyrx file
lyrParams.AutoZoomOnEmptyMap = false
LayerFactory.Instance.CreateLayer<Layer>(lyrParams, MapView.Active.Map);
... View more
03-26-2024
12:46 PM
|
0
|
1
|
4549
|
|
POST
|
Hi, As I said earlier you don't need code in Dockpane1View.xaml.cs. Delete all content from Dockpane1View.xaml.cs except constructor with one line InitializeComponent(); or create new dockpane from scratch. Your comboboxes must be binded to Dovpane1ViewModel properties as in MetadataBrowserControl sample. Combobox selection event will update special property in Docpane1ViewModel. Bind buttons to commands as in WorkingWithQueryDefinitionFilters sample. All stable properties fill in Dockpane contructor or override InitializeAsync() method as in samples above. In overriden OnShow method subscribe/unsubscribe to/from events and fill properties which can change content which depends on MapView or current application status. If it's difficult to understand how it works, download mentioned samples, build and debug using Visual Studio. MVVM is WPF stuff, not ArcGIS Pro.
... View more
03-25-2024
12:58 PM
|
0
|
0
|
2655
|
|
POST
|
Hi, Your code UpdateModule refID is wrong. DAML below shows group in esri_core_homeTab. <modules>
<insertModule id="ReportsSampleProject_Module" className="Module1" autoLoad="false" caption="Module1">
<!-- uncomment to have the control hosted on a separate tab-->
<tabs>
<!--<tab id="ReportsSampleProject_Tab1" caption="New Tab">
<group refID="ReportsSampleProject_Group1"/>
</tab>-->
</tabs>
<groups>
<!-- comment this out if you have no controls on the Addin tab to avoid
an empty group-->
<group id="ReportsSampleProject_Group1" caption="Group 1" appearsOnAddInTab="false">
<!-- host controls within groups -->
<button refID="ReportsSampleProject_Dockpane1_ShowButton" size="large" />
</group>
</groups>
<controls>
<!-- add your controls here -->
<button id="ReportsSampleProject_Dockpane1_ShowButton" caption="Show Dockpane 1" className="Dockpane1_ShowButton" loadOnClick="true" smallImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonPurple16.png" largeImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonPurple32.png">
<tooltip heading="Show Dockpane">Show Dockpane<disabledText /></tooltip>
</button>
</controls>
<dockPanes>
<dockPane id="ReportsSampleProject_Dockpane1" caption="Dockpane 1" className="Dockpane1ViewModel" dock="group" dockWith="esri_core_projectDockPane">
<content className="Dockpane1View" />
</dockPane>
</dockPanes>
</insertModule>
<updateModule refID="esri_core_module">
<tabs>
<updateTab refID="esri_core_homeTab">
<insertGroup refID="ReportsSampleProject_Group1"/>
</updateTab>
</tabs>
</updateModule>
</modules> My group appearsOnAddInTab="false"
... View more
03-25-2024
01:39 AM
|
0
|
0
|
827
|
|
POST
|
Please share your updated code and cleanup empty lines
... View more
03-22-2024
08:16 AM
|
0
|
3
|
2695
|
|
POST
|
Hi, 1. Find your dockpane: DockPane pane = FrameworkApplication.DockPaneManager.Find(_dockPaneID);
if (pane == null)
return; 2. Cast pane to you ViewModel class and access public property: (pane as YourDockpaneViewModel).YourPropertyName = value;
... View more
03-22-2024
08:11 AM
|
1
|
1
|
2251
|
|
POST
|
Hi, Look at the ArcGIS Pro SDK community sample DatastoresDefinitionsAndDatasets
... View more
03-21-2024
01:21 PM
|
0
|
2
|
1490
|
|
POST
|
Hi, I would suggest you to check dockpane 'classname' and dockpane's content 'classname' paths. For dockpane viewmodel class is specified as 'classname' value and view class - as content 'classname' value. DataContext is set inside dockpane's internal code. I have noticed that you change module class name from Module1 to BiosModule. Have you changed Module class name in daml? - <insertModule id="*******_Module" className="Module1" autoLoad="false" caption="Module1"> Setting autoLoad to true could help too.
... View more
03-20-2024
07:51 AM
|
0
|
0
|
2322
|
|
POST
|
Hi, You can set DisplayName and other CIMTableField properties after report creating: List<string> displayNames = new List<string>() { "Project Id", "Id", "Field 1", "Field 2", "Field 3", "Field 4", "Field 5", "Field 6", };
internal async Task Execute()
{
if (FLayer == null) return;
try
{
var reportDataSource = PrepareDataSource();
var report = await CreateReportAsync(reportDataSource);
for (int i = 0; i < report.DataSource.Fields.Count(); i++)
{
var cimField = report.DataSource.Fields.ElementAt(i);
cimField.DisplayName = displayNames[i];
if (i == 0) cimField.Group = true;
if (i == 3 || i == 5 || i == 7)
{
cimField.IsVisible = false;
}
}
MessageBox.Show("Report created successfuly.");
}
catch (Exception ex)
{
MessageBox.Show("Failed to create report. Error" + ex.Message);
}
}
... View more
03-20-2024
07:42 AM
|
0
|
1
|
1729
|
|
POST
|
Hi, You can do it using geoprocessing Feature Class To Shapefile tool. Geoprocessing API reference is here
... View more
03-16-2024
12:03 PM
|
0
|
0
|
1284
|
|
POST
|
Why do you use code behind (xaml.cs) with dockpane? Can you share parts of code?
... View more
03-04-2024
02:49 AM
|
0
|
0
|
2631
|
|
POST
|
Hi, Have you tried like this below: var UpdateFeatures = ArcGIS.Desktop.Framework.FrameworkApplication.DockPaneManager.Find("ArcGIS_Update");
UpdateFeatures.Activate();
(UpdateFeatures as <second_dockpane_viewmodel>).PermitValue = <some_value>;
... View more
03-03-2024
10:30 PM
|
1
|
0
|
2641
|
|
POST
|
Hi @ChristopherWorrell , You are using wrong updateTab refID. refID is "esri_editing_EditingModule"
... View more
02-28-2024
03:44 AM
|
0
|
1
|
1854
|
|
POST
|
Hi, There is no need to use coding for dockpane in code behind (*.xaml.cs). Look at the ArcGIS Pro SDK community WorkingWithQueryDefinitionFilters sample. Sample uses layers adding/removing events.
... View more
02-28-2024
03:36 AM
|
0
|
1
|
2819
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 2 weeks ago | |
| 1 | 2 weeks ago | |
| 2 | 04-24-2026 08:33 AM | |
| 1 | 03-23-2026 11:44 AM | |
| 1 | 05-22-2024 11:48 PM |
| Online Status |
Online
|
| Date Last Visited |
2 weeks ago
|