Where is Inspect.exe for UI Access?

Stupid SDK doesn’t give any details on where the SDK path is, etc.

Well, Install the Windows 8.1 SDK with the options. You have plenty of disk space, so don’t whine.

Here is the path for the 64 bit version.

C:\Program Files (x86)\Windows Kits\8.1\bin\x64

 

Happy Coding!

Convert a .CRT to a .PFX for code signing!

I was trying to sign my code but my cert came as a crt and no one seems to play well with those. I imported into my the Certificate Store then tried to export. The PFX option was greyed out.

How freaking annoying. Well I followed the steps from this guy and it started working again like magic.

Awesome:

Link: https://weikingteh.wordpress.com/2010/11/22/unable-to-export-an-installed-certificate-to-pfx/

Unable to export an installed certificate to .pfx

If you’re trying to export an installed certificate into the .pfx format but the option is greyed out like when I was working with it for vPro provisioning, then it might be due to missing private keys. In my case, I’ve received a provisioning certificate from Comodo where I purchased it but was not able to export it to .pfx format which is required by the Out-of-Band Service Point in SCCM. If you are one of those that have this same experience, what you need to do is to recover the private key. To do this, type in certutil –repairstore my “<serialnumber>”.

How do you locate your serial number? Simply double-click on the certificate that you would like to export, go to the Details tab and note down the Serial Number found there. Once the command completed successfully, attempt to export the certificate again and you’ll see now that you are able to select to export the private key and the .pfx format option is now enabled.

 

Happy Coding!

Force rebind on a WPF control or view by resetting the DataContext without using null!

I had an issue where I wanted to force a datacontext to rebind everything. The RaisePropertyChanged(“”) wasn’t working and I like to keep things simple.

I was setting the DataContext = null then setting it back to the desired object right after to force a rebind. This worked well but really pissed off some of the controls. Not everyone appreciates a null databind.

So, what to do. I remember working with virtualization and the DisconnectedItem, a hidden magical gem that Microsoft just finally let us have public access to in 4.5, had magical powers with databinding. It cast a spell that made everyone calm and happy.

The null databinding on the DataContext was causing major slowdowns in the app as all the controls got angry. So I switched the DataContext=null to DataContext = DisconnectedItem.

All was right in the world again and the application became fast again.

Confused, well I am tired. Anyway, here it is in the before and after and it should then make sense. Edited for brevity.

private static object disconnectedItem = null;
 
        private void UpdatePropertiesView()
        {                   
                    newView.DataContext = null;
                    newView.DataContext = SelectedNode.Node;                               
        }

Snippet

private static object disconnectedItem = null;
 
        private void UpdatePropertiesView()
        {
                    if (disconnectedItem == null)
                        disconnectedItem = typeof(System.Windows.Data.BindingExpressionBase).GetField("DisconnectedItem", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
                    newView.DataContext = disconnectedItem;//force rebind, but gentler.
                    newView.DataContext = SelectedNode.Node;                               
            }
        }

 

The reason I am doing this is because the Node object didn’t change, but the properties on it did.(a lot of them).

Happy Coding!

PS: Yes, I am adding a check to see if the datacontext is the same so I can skip the null set entirely in those instances…..