Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StorageProviderItemProperty does not allow blank icons #357

Open
michaelfoster9 opened this issue Aug 12, 2024 · 0 comments
Open

StorageProviderItemProperty does not allow blank icons #357

michaelfoster9 opened this issue Aug 12, 2024 · 0 comments

Comments

@michaelfoster9
Copy link

michaelfoster9 commented Aug 12, 2024

I am using the Cloud File Api to write a custom OneDrive-like sync client. I have a desire to have custom properties that are available in explorer.

When I register my CFAPI SyncRoot during installation, I can define custom properties as follows.

var initialPropDefinitions = syncRootInfo.StorageProviderItemPropertyDefinitions;
var customPropDefinitions = propertyManager.GetCustomPropertyDefinitions();
foreach (var propDef in customPropDefinitions)
{
   var osPropDef = new StorageProviderItemPropertyDefinition
   {
      DisplayNameResource = propDef.DisplayNameResource,
      Id = propDef.Id
   };
   initialPropDefinitions.Add(osPropDef);
}
_storageProvider.RegisterSyncRoot(syncRootInfo);

This works great. The properties I assign are available in windows explorer to add as columns.

My problem comes when I try to set the property values. Below is the code that I use to assign property values.

List<StorageProviderItemProperty> itemProperties = new List<StorageProviderItemProperty>();
customColumns.Add(new StorageProviderItemProperty() {
    Id=3,
    Value="Hello"
    IconResource = string.empty
};

await StorageProviderItemProperties.SetAsync(item, itemProperties);

This works well but, Explorer crashes whenever I use an empty IconResource. I can fix this by creating a blank icon. So I had an example where I have 3 properties, one actually has an icon and the other two are blank. The status column shows all of the icons and you can see that the blank icons are taking up real estate under the status column. Sure, I can arrange my properties so that all of the ones that have real icons are set first. But, I would really like a way to set property values without using an icon. Is there such a way? This seems like a bug that you can't have custom properties WITHOUT an Icon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant