POST
|
Maybe something like this. I'm manually positioning the tooltip relative to the view's outermost grid. <Grid x:Name="mainGrid">
<Button x:Name="myButton" Content="Test" Width="100" Height="40">
<Button.ToolTip>
<ToolTip x:Name="popup1" Placement="Custom">test</ToolTip>
</Button.ToolTip>
</Button> public Dockpane1View()
{
InitializeComponent();
popup1.CustomPopupPlacementCallback = new CustomPopupPlacementCallback(placePopup);
}
public CustomPopupPlacement[] placePopup(Size popupSize, Size targetSize, Point offset)
{
double scaleX = 1;
PresentationSource source = PresentationSource.FromVisual(mainGrid);
// Get the display scale (e.g. 200%)
if (source != null)
scaleX = source.CompositionTarget.TransformToDevice.M11;
Point newPoint = myButton.TranslatePoint(new Point(0, 0), mainGrid);
CustomPopupPlacement placement1 =
new CustomPopupPlacement(new Point(((mainGrid.ActualWidth - newPoint.X) * scaleX) + (5 * scaleX), 0), PopupPrimaryAxis.Vertical);
CustomPopupPlacement placement2 =
new CustomPopupPlacement(new Point((newPoint.X * scaleX * -1) - popupSize.Width - (5 * scaleX), 0), PopupPrimaryAxis.Horizontal);
CustomPopupPlacement[] placements = new CustomPopupPlacement[] { placement1, placement2 };
return placements;
}
}
... View more
08-03-2020
03:01 PM
|
0
|
1
|
1235
|
POST
|
In my case the response says there are 2797 items total and I always get this many back after all my fetches, no duplicates. I tried about 10 times. So you're still getting a duplicate sometimes and that's why your count is off?
... View more
07-15-2020
03:58 PM
|
0
|
1
|
1031
|
POST
|
Can you try adding this bit of code? It looks like there's a known issue on the Server relating to paging lots of data (index is constantly changing) without a sort order. var query = PortalQueryParameters.CreateForItemsOfTypes(new List<PortalItemType>() { PortalItemType.Layer }, "", "", ""); query.Limit = 100; // max query.Query = query.Query + "&sortField=modified&sortOrder=desc";
... View more
07-15-2020
02:07 PM
|
0
|
4
|
1031
|
POST
|
I could reproduce this. I increased my query limit from10 to 100 and moved the operation to a background thread. My HashSet sees different duplicates every time I run it. I'll investigate more. internal async Task<bool> Fetch() { var query = PortalQueryParameters.CreateForItemsOfTypes(new List<PortalItemType>() { PortalItemType.Layer }, "", "", ""); query.Limit = 100; // max ArcGISPortal portal = ArcGIS.Desktop.Core.ArcGISPortalManager.Current.GetActivePortal(); HashSet<string> ids = new HashSet<string>(); await BackgroundTask.Run(TaskPriority.normal, () => { var portalItems = new List<PortalItem>(); while (query != null) { //run the search PortalQueryResultSet<PortalItem> results = ArcGIS.Desktop.Core.ArcGISPortalExtensions.SearchForContentAsync(portal, query).Result; portalItems.AddRange(results.Results); query = results.NextQueryParameters; } //portalItems.Sort((x, y) => x.Title.Trim().CompareTo(y.Title.Trim())); portalItems.Sort((x, y) => x.ID.CompareTo(y.ID)); foreach (var pi in portalItems) { if (!ids.Add(pi.ID)) System.Diagnostics.Debug.WriteLine("duplicate id"); } }, BackgroundProgressor.None); return true; }
... View more
07-14-2020
05:09 PM
|
1
|
6
|
1031
|
POST
|
I had some luck with this format. Not sure what to put in for the public key but a single p seems to work (so did other letters). This is assuming your referenced dll has a version of 1.0.0.0 and no public key. <Image Source="/ResourceDLL;v1.0.0.0;p;component/MyImages/BexDog32.png"/>
... View more
09-20-2019
04:05 PM
|
0
|
0
|
1017
|
POST
|
For menus check out DynamicMenus, you add their constituent controls at run-time.
... View more
04-24-2019
09:41 AM
|
3
|
1
|
1025
|
POST
|
Hi. By default RelayCommands (ArcGIS.Desktop.Framework.RelayCommand) also automatically disable whenever the main worker thread is busy. RelayCommands can also opt out of this by setting the displayWhenBusy constructor parameter to false. new RelayCommand(DoSomethingWhenGPSButtonIsClicked, CanStartGPS, true, false);
... View more
02-09-2018
08:07 AM
|
2
|
1
|
995
|
POST
|
By default, buttons on the ribbon automatically become disabled whenever something is running on the main worker thread (the thread associated with QueuedTask.Run). Buttons can opt out of this by setting their DAML disableIfBusy attribute to false. However, if your task is using ArcObjects it should use QueuedTask and it should probably keep disableIfBusy = true. If your task isn't running ArcObjects (maybe you'll pulling something down from the web or using your own objects to do something), you might want to consider using a thread from the .NET thread pool (Task.Run) and disableIfBusy=false. <button id="acme_ShowWiz" caption="Show Wizard" className="ShowWizardCMD" loadOnClick="true" disableIfBusy="false"
... View more
02-08-2018
01:25 PM
|
2
|
0
|
995
|
POST
|
Hi. Can you try adding a dependencies element under your AddInInfo element. For the dependency name use the other add-in's ID. This will tell the add-in processor to process add-in B first. Add-IN A (with module id="ArcGIS_Pro_AddIn_MaxHonsell_GPS_Module"): <dependencies> <dependency name="{6c2ad456-410f-4fe2-8df3-c9a974ef98c0}" /> </dependencies> Add-In B ( with module id="ArcGIS_Pro_AddIn_MaxHonsell_II_Module"): <ArcGIS defaultAssembly="WizardSample.dll" defaultNamespace="WizardSample" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/ArcGIS/bin/ArcGIS.Desktop.Framework.xsd"> <AddInInfo id="{6c2ad456-410f-4fe2-8df3-c9a974ef98c0}" version="1.0" desktopVersion="2.0.8533"> <Name>WizardSample</Name> <Description>WizardSample description</Description> <Image>Images\AddinDesktop32.png</Image>
... View more
01-22-2018
08:55 AM
|
3
|
1
|
1079
|
POST
|
You can use the await operator private async Task Foo() { . . . await QueuedTask.Run(() => . . .
... View more
01-03-2018
01:08 PM
|
0
|
1
|
578
|
POST
|
Thanks for reporting this Jeff, this is indeed a problem with 10.0 Service Pack 1. Service pack 1 didn't install the correct version of a file that affects only resigining. As a workaround, can you move ESRISignAddIn.exe to your ArcGIS/bin directory, it should work fine there? We'll get this addressed in service pack 2. Thanks again, Steve
... View more
02-07-2011
09:28 AM
|
0
|
0
|
833
|
POST
|
Hi. Adding the subtype attribute manually to the xml should make this work. Note, the subtype attribute is missing from the schema at 10.0 but it is honored, I'll see about getting this fixed in sp2. <Toolbar id="Steve" caption="Steve" showInitially="true"> <Items> <Button refID="esriArcMapUI.ClearSelectionCommand" /> <Button refID="esriArcMapUI.SelectAllCommand" /> <!--File_AddData Command; refID can be GUID"--> <Button refID="{E1F29C6B-4E6B-11D2-AE2C-080009EC732A}" subtype="1" /> <!--Edit_Undo Command; refID can be GUID"--> <Button refID="{FBF8C3FB-0480-11D2-8D21-080009EE4E51}" subtype="1" /> <!--Edit_Redo Command; refID can be GUID"--> <Button refID="{FBF8C3FB-0480-11D2-8D21-080009EE4E51}" subtype="1" /> <!--File_Save Command; refID can be GUID"--> <Button refID="{119591DB-0255-11D2-8D20-080009EE4E51}" subtype="1" /> </Items> </Toolbar> </Toolbars>
... View more
01-25-2011
02:16 PM
|
0
|
0
|
547
|
POST
|
How can I obtain additional information concerning failures while registering DLLs/Assemblies using ESRIRegAsm? ESRIRegAsm supports an optional diagnostic mode enabled using the /debug command line option. This option will display a console window where the registration process is logged in detail.
... View more
01-06-2010
01:52 PM
|
0
|
0
|
778
|
POST
|
Communication between types within an add-in Within most Add-In projects, some means for inter-component communication is needed so that one component can activate or obtain state from another; for example, a particular Add-In Button component�??when pressed�??may alter the overall Add-In state in a way which modifies the content displayed within an associated Add-In Dockview component. In the past, many developers have resorted to using COM based mechanisms for inter-component communication, defining custom interfaces which are then exposed from Button, Dockview or Extension components. These interfaces are accessed by first finding the component using framework supplied find functions�??ICommandBar.Find, IApplication.FindExtension, etc. The returned reference is then cast to the custom interface and used. There are several downsides associated with this approach: Using COM interfaces restricts communication to the simple types and calling patterns supported by COM and rules out the use of any language specific types and patterns. Communication between components within the same project is generally private; registering COM interfaces ostensibly publicizes these private communication lines and unnecessarily complicates any public interfaces intended for exposure outside the project. COM interfaces need additional non-trivial coding steps and require registration within the system registry by an installer with administrative rights. In .NET, such interfaces also require the generation and registration of Primary Interop Assemblies which introduce multiple native/managed context switches for each call (even though both ends of the conversation are managed). Since, by design, Add-Ins cannot themselves rely on COM patterns and do not require registration, the traditional approach using COM isn�??t a viable option. The alternative pattern is much more straightforward and has none of the associated downsides listed above. Since all framework types are singletons, Add-In developers can use a simple approach based on static class members to achieve inter-component communication. The following example demonstrates how an extension can directly expose its functionality to other components within the same project: public class MainExt : ESRI.ArcGIS.Desktop.AddIns.Extension
{
private static MainExt s_extension;
public MainExt()
{
s_extension = this;
}
internal static MainExt GetExtension()
{
// Extension loads just in time, call FindExtension to load it.
if (s_extension == null)
{
UID extID = new UIDClass();
extID.Value = "ACME_MainExt";
ArcMap.Application.FindExtensionByCLSID(extID);
}
return s_extension;
}
internal void DoWork()
{
System.Windows.Forms.MessageBox.Show("Do work");
}
} Client code: protected override void OnClick()
{
MainExt mainExt = MainExt.GetExtension();
mainExt.DoWork();
}
... View more
01-06-2010
07:39 AM
|
0
|
0
|
426
|
POST
|
Can you post exactly how you are using the utility. Thanks, Steve
... View more
11-19-2009
06:59 AM
|
0
|
0
|
460
|
Title | Kudos | Posted |
---|---|---|
3 | 01-22-2018 08:55 AM | |
1 | 07-14-2020 05:09 PM | |
3 | 04-24-2019 09:41 AM | |
2 | 02-09-2018 08:07 AM | |
2 | 02-08-2018 01:25 PM |
Online Status |
Offline
|
Date Last Visited |
03-15-2024
05:57 PM
|