|
POST
|
OK - this works in part and that's useful to know . But I still need to know things about the user when they sign in or sign out, and this gives me no chance to do that as far as I can see. The context is - I want the control to change state if the user is a member of group in Portal or not, also it needs to disable/enable if signed in or out (which is where your fix works partly). Below is by custom control with an embedded button and image that toggles between two images: Here are the use cases: User A not signed in to Portal and is not a member of foo group. "Request Access" (to foo group) button is disabled. This is where your answer works as the whole control is deactivated, and that's good. User A signs in to Portal and is not a member of foo group, the control enables (again your answer solves this scenario) the user can now press "Request Access" button and go from there: User A signs out, user B signs in and already has access to foo group. This is where it breaks down. The control should change but it doesn't, as no event is raised when the user signs in. The control should change to this: but it doesn't it, just re-enables the the control without changing the icon: Hopefully this makes some sense - and how I need to intercept the signing in and out process/event.
... View more
03-24-2020
04:02 AM
|
0
|
4
|
3150
|
|
POST
|
I understand that - but I need to dynamically enable or disable my toolbar based on a user signing out, i.e. the exact moment the user signs off - can that be done?
... View more
03-23-2020
12:49 PM
|
0
|
2
|
3150
|
|
POST
|
Hi, It doesn't look like there is an event to listen out for users signing out of their active portal. Is there something I'm missing or is there another way to do this? Or do I have to keep checking if the user is signed in before my code does anything that requires the user to be actually signed in. I only ask as I was going to disable my addin toolbar if the user had signed out. Cheers.
... View more
03-23-2020
02:38 AM
|
0
|
9
|
3293
|
|
POST
|
I want to put an image 16/32 pixel size on a custom control and change that image during runtime depending on what the user is doing. For example, if the user is valid I want the an image on the control to show they are valid - say like a green person image - equally I want that image to change to a red person if they are not valid. The reasons for validity are not important - changing the image is. I can see how that is done partly with a standard button control - but it's not so obvious how this is all wired up with a custom control. Can anyone help? Do you have to put an image control in the xaml for the custom control? - if so how is this wired up to images that you have stored in the Images folder of your project?
... View more
03-20-2020
11:06 AM
|
0
|
2
|
3160
|
|
POST
|
Thanks Wolf You have done exactly as I have done whilst waiting for a response - basically toggling between making the non-active portal active, adding the data then making it non-active again. This workaround will suffice whilst I get on building the rest of my add-in, and it certainly confirms my findings which gives me confidence to continue the rest of my code. However I hope that with your input that you can influence the development team to prioritise a change in behaviour - so that you can add content from an non-active portal. Thanks once again, and thanks to Charlie too for your help. I look forward to seeing develpments in this area Simon.
... View more
02-21-2020
04:05 AM
|
0
|
0
|
3449
|
|
POST
|
Hi Charles, Yep, I've tried adding layers from my non-active portal (with the code I posted before - AddAGOLTestLayer()) - it just returns null when it tries to create the layer from the factory. But when active its ok, it returns a valid layer. I will try and search for content after my SignInAsync() and then add Layer from there - but I can't see how that works - it makes no sense that you have to do a search in order to get the LayerFactory to work successfully. UPDATE So bascially I have tried searching for content under my non-active portal and results are brought back - yay! When trying to add content to the map (still under my non-active portal) - using the LayerFactory method - it still returns null, so basically I can't add content. Here is my code below: private async Task SignInAsync(ArcGISPortal nonActivePortal) { var signInResult = await nonActivePortal.SignInAsync(); var pqp = PortalQueryParameters.CreateForItemsOfType(PortalItemType.Layer, "title:fooLayerTitle"); PortalQueryResultSet <PortalItem> results = await ArcGISPortalExtensions.SearchForContentAsync(nonActivePortal, pqp); //Get the first result var myPortalItem = results.Results?.OfType<PortalItem>().FirstOrDefault(); FeatureLayer featureLayer = null; Item testLayer = ItemFactory.Instance.Create(myPortalItem.ID, ItemFactory.ItemType.PortalItem); await QueuedTask.Run(() => { if (LayerFactory.Instance.CanCreateLayerFrom(testLayer)) featureLayer = LayerFactory.Instance.CreateLayer(testLayer, MapView.Active.Map, 0) as FeatureLayer; }); }
... View more
02-17-2020
12:35 PM
|
0
|
3
|
3449
|
|
POST
|
The SignInAsync() doesn't allow me to add any content into Pro (i.e. a feature layer) from "someothercompany" portal - (for simplicity I have passed the unique id of the layer) see code below: public static async Task AddAGOLTestLayer(string layerId) { Item testLayer = ItemFactory.Instance.Create(layerId, ItemFactory.ItemType.PortalItem); await QueuedTask.Run(() => { if (LayerFactory.Instance.CanCreateLayerFrom(testLayer)) LayerFactory.Instance.CreateLayer (testLayer, MapView.Active.Map, 0) as FeatureLayer; }); } The only way I can get the code to work above is by setting the Active Portal to "someothercompany" - but, as my original question outlines, I don't want to do that. I just thought I would try it to make sure that was the case So what actual functionality do you have when using the SignInAsync() method? Can I add data to Pro without setting the Active Portal? Or is it just searching for content or something? To get the behaviour I want would I have to cache the object/details of the currently active portal - switch into "someothercompany" portal, make it active add content etc, then switch back to cached portal. Seems cluncky though. Do I have to start calling rest endpoints to get content into Pro using EsriHttpClient instead of using code like above? This I suspect is more involved than just using out of the box api calls like above.
... View more
02-17-2020
08:22 AM
|
0
|
5
|
3449
|
|
POST
|
OK - I do have a portal instance with credentials that I want the user to use (let's say I've sent these details and credentials in an email) - if after they have signed in via the sign-in window, will this kick them off the Portal they were just using?
... View more
02-13-2020
03:59 AM
|
0
|
7
|
3449
|
|
POST
|
Basically I don't want to "hijack" and take over the user's active portal (i.e. the one setup by the user through the Pro UI) because it could be their company's own portal and it's useful to them in session. I want my code to be able to login to a portal different from the user's active one (their company's portal) and do some things without affecting the user's portal that they currently think they are still connected to in that session. So if I did some code like this: var someOtherCompanyUri = new Uri("http://someothercompany.com/portal/", UriKind.Absolute);
var someOtherCompanyPortal = ArcGISPortalManager.Current.AddPortal(someOtherCompanyUri);
ArcGISPortalManager.Current.SetActivePortal(someOtherCompanyPortal); Will this change the user's active portal that was setup up by them through the standard UI of ArcGIS Pro? Effectively kicking them off their company's portal say? If it does, is there a way to get round this?
... View more
02-12-2020
09:46 AM
|
0
|
9
|
3588
|
|
POST
|
Thank you Neil - you've helped me on and off for 20 years now!!
... View more
12-12-2019
05:34 AM
|
0
|
0
|
1928
|
|
POST
|
I can store a layerX file in Portal and access from my Pro Client with it's item ID: Item testLayerLryx = ItemFactory.Instance.Create(lyrxId, ItemFactory.ItemType.PortalItem); Great. However - can I use this object to apply symbology from the layerX entity to an existing layer already loaded into Pro. It looks tricky as the constructor only seems to accept a filepath and a CimLayerDocument. LayerDocument layerDoc = new LayerDocument(); - but I may going down the wrong path in any case. Also, the LayerFactory only makes layers, but I can't see anything similar for layer files. Anyway, any help - much appreciated.
... View more
11-25-2019
03:33 AM
|
0
|
2
|
1720
|
|
POST
|
Hi, How would you go about trying to access the data from a ViewModel (belonging to a ProWindow) from another ViewModel? I have tried to find some way of doing it via the FrameworkApplication - in the same style as the DockPaneManager - but alas there does not seem to be an equivalent for a ProWindow. Should I hold a reference to the ViewModel in the Module class?
... View more
11-14-2019
06:21 AM
|
0
|
1
|
1358
|
|
POST
|
Hi Uma, Many thanks - that's super helpful, simple I know, but I done some things the same as what you have done and some other things I didn't know about (e.g. a RelayCommand already exists to make use of). Really appreciated!!
... View more
11-04-2019
08:19 AM
|
0
|
0
|
2882
|
|
POST
|
Sorry, I'm getting totally confused with WPF and how it works with MVVM and ESRI's SDK. I need to know where the most helpul, most appropriate resources are for this kind of development. At the moment I'm getting hung up over Commands and ArcGIS.Desktop.Framework.Controls.ProWindow. It's just a simple user login interface and trying to figure out how the Login button should activate/light up. Obviously I want to enable it when the user enters a username and password - but it's so confusing when you try to implement a command - Should I just use simple code behind? Should I build out an elaborate MVVM solution of my own making? Should I use Prism or ActiPro or some other 3rd Party library? When you start binding objects its hard to know which way you should bind, do you do it all in the XAML or all in code or a bit of both, what is the right way? There is no obvious way despite looking at tons of different tutorials and videos on the subject. Everyone has a slightly different way of doing things. Main Question How do you pass a binded object for evaluation through the command implementation? That is, the object is a "User" which is the Model (wrapped up in the ViewModel class) and has properties or Username, Password, PortalUrl - the UserViewModel comprises the User object and exposes it's inner properties of the User object so it can bind - but then I find it confusing trying to use a Command to check the object to see if its valid (i.e. completed out username/password/portalurl). Maybe I am over complicating things for something this simple, but on the other hand I want to do things the right way and not just hack something together. In the end I will be putting together a more complex UI and I will need to know this stuff in any case so I may as well learn it now with something simple. If anyone can help put me on the right track I would appreciate it.
... View more
10-31-2019
08:12 AM
|
1
|
2
|
3190
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-17-2025 03:28 AM | |
| 1 | 12-18-2023 10:11 AM | |
| 1 | 08-22-2025 02:27 AM | |
| 2 | 12-19-2023 01:36 AM | |
| 1 | 12-21-2023 04:02 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|