ArcGIS Pro SDK: Programmatically toggle whether a layer is editable or not - arcgis

I was wondering if anyone would know how to toggle whether a layer is editable or not.
I am building a custom Add-in and would like a way to make a layer editable or uneditable based on layer name.

Found out it was quite simple in the end had to use 'SetEditable' method from layer.
fl.SetEditable(true);

Related

React Native Maps renders 2 background layers - blurred effect

I have a React Native application that contains a (react-native-maps) mapview with several different polylines and polygons created from http request data. The problem is that the map renders the background twice as you can see in the attached picture. This second layer is always a bit larger and more out of focus than the actual layer (the polygon/lines match with coordinaates on the clear defined layer). Im wondering how this second background came to be and how to prevent it from rendering.
Kind regards
Are you saying, that without providing an you are getting two layers?
Otherwise, when you use a different provider, for a layer and want to hide the layer provided by google, You should set mapType to "none".

How to display multiple keys or 'chords' for a MenuItem on Cocoa

I am trying to display multiple key combinations to a MenuItem in cocoa. This is most commonly known as "chords".
For example I want to add a menu item that looks like:
"Action1 Control K, F" or "MenuItem2 K,L"
Would this be possible in Objective-C through the standard API? I've looked around and the closest thing to this on MacOS would be using custom views. Would it be the way to go for allowing this functionality?
The standard API does not support handling chords, thus it does not allow setting chords as key equivalent and thus it also cannot display a chord as a key equivalent.
If you need that functionality, you need to implement entirely yourself. Just make your own NSView object and assign it to the view property of NSMenuItem. As documented, you will then have to draw everything yourself:
A menu item with a view does not draw its title, state, font, or other
standard drawing attributes, and assigns drawing responsibility entirely
to the view. Keyboard equivalents and type-select continue to use the key
equivalent and title as normal.
Source: https://developer.apple.com/documentation/appkit/nsmenuitem/1514835-view?language=objc
Whether this is a normal NSView filled with subviews, created either programmatically or even loaded from a NIB file, or whether this is a subclass of NSView drawing everything itself is up to you, all these variations will actually work. Usually it's easiest to use a NIB file and build you menu look in interface builder and using autolayout.
Yet keep in mind that this breaks Apple Human Interface guidelines. It violates the users expectation as all his other apps don't offer anything comparable since in macOS a menu item has one key equivalent or it has none. It also breaks the ability of users to customize the key equivalent the way he is used to do this for all other applications (System Preferences > Keyboard > Shortcuts > App Shortcuts).
Generally you should not replace system standard UI with your own UI unless you really have a very good reason for doing so, as that always breaks users expectations, certain system functionality won't work as expected (e.g. accessibility features) and it destroys the uniform look and feel of the system. Also it breaks system automatic, as you can see in macOS 10.14 (Mojave) where all system standard UI automatically supports dark mode, so if you used only standard UI, your app supports dark mode without any modification, yet all custom UI needs to be customized again for dark mode.
Yes, you'll need to use a custom view. NSMenuItem only displays the first character of its keyEquivalent.

Color Picker for Windows store App

I want to add a color picker control to a windows store App (using VB), I came to know that there is no standard control for that. So any ideas about what could be a good purchased or open source option?
So I started building one into WinRT XAML Toolkit here but never got round to finishing it. Mainly because I figured there would need to be very different designs for different platforms. The control isn't finished, but a lot of the components that are there you could use to build a color picker that fits your design. There's a ColorExtensions class that might help you convert between HSL/HSV/RGB models, there's a FromString() method in it that can parse a color string in the formats available in XAML (e.g. "Transparent" or #FFAA0080 or #FB0) and there's a WriteableBitmapColorPickerExtensions class that you can use to render a hue ring, 2D color selector bitmap or a 1D color bar. I'll probably create some usable controls one day to use all of these primitives, but for now - you have that power! :)
I've created a simple color picker for Universal Apps, you can read about it from this blog post...

How Do I recognize basic shapes with Ink and WinRT

Is there a simple way to get shape recognition working with WinRT?
With WPF it was simple I could just use InkAnalysis but it seems that it is not available in WinRT(?).
I want to be able to draw basic shapes circle, rectangle and square and I want to be able to recognize them.
Any suggestions?
The GestureRecognizer class that you get out of the box only supports the simple gestures used in various standard Windows 8 controls. For your scenario you could try the 1$/n$ recognizers I linked to in this previous question.

Can I have a composite shape as a resource in WinRT XAML?

I'm developing a Windows 8 Metro-style application and I want to use vector images. As there seems to be no direct support for svg images, I am trying to use a xaml fragment consisting of multiple shapes (a path and some lines) as an image. I would like to have a resource dictionary entry with the composite shape and be able to include it in different pages. Ideally, I would also like to be able to resolve a specific composite shape from a data bound property.
From what I've read, the WPF approach was to have a VisualBrush or DrawingBrush consisting of the shapes, but there are no such classes in Windows 8 (and it seems like it's not even possible to derive from Brush).
How am I supposed to do this using WinRT UI?
No, you cannot use a DrawingBrush as the value of a background property in WinRT XAML. It's too bad, huh? Seems like a very powerful features to setup the fill of an object with vector layouts. In fact DrawingBrush is not even part of Windows 8 yet. It is what it is. For now, images are a fine solution. But we feel your pain.
I might as well toss in that VisualBrush is not part of WinRT-XAML either.
Each XAML fragment is really a UI element. I think the simplest approach would be to put the XAML into it's own user control and then add the user control to each page you wanted to display the "drawing" on. If you want the user control to display different shapes, you can expose a property on the control, data bind to that property, and inside the setter of the property read the value and toggle the visibility of the various XAML shapes to show or hide whatever parts of the composite image you want. It is a bit brute force, but will do what you want.
Windows8 way to have vector graphics in it is just to use ViewBox+Canvas and Path elements. It works well in my opinion, though I do miss VisualBrush.