Xamarin.Plugins icon indicating copy to clipboard operation
Xamarin.Plugins copied to clipboard

Error binding IconToolbarItem when value changes

Open mcurrycl opened this issue 7 years ago • 3 comments

I have a content page on an IconNavigationPage with 2 icons:

    <ContentPage.ToolbarItems>
        <iconize:IconToolbarItem  Icon="{Binding SyncIcon}" Text="Sync" IconColor="Yellow" IsVisible="True" Command="{Binding SyncCommand}" />
        <iconize:IconToolbarItem Icon="fa-ellipsis-v" IconColor="White"/>
    </ContentPage.ToolbarItems>

The Sync icon is bound to a string on the view model showing whether or not the page is synced for offline use. If the sync has happened, it returns "fa-star" if unsynced it returns "fa-star-o".

On the initial load, the Icon is shown correctly depending on the sync state. When the sync occurs after loading and the property changes, both the icons disappear from the toolbar altogether. The following error is logged in Visual Studio:

[0:] Could not load image named: {0}: fa-star
04-12 10:40:44.824 W/ResourceType( 2685): No package identifier when getting value for resource number 0x00000000
04-12 10:40:44.824 E/BitmapFactory( 2685): Unable to decode stream: java.io.FileNotFoundException: fa-star: open failed: ENOENT (No such file or directory)
[0:] Could not load image named: {0}: fa-ellipsis-v
04-12 10:40:44.831 W/ResourceType( 2685): No package identifier when getting value for resource number 0x00000000
04-12 10:40:44.831 E/BitmapFactory( 2685): Unable to decode stream: java.io.FileNotFoundException: fa-ellipsis-v: open failed: ENOENT (No such file or directory)

mcurrycl avatar Apr 12 '17 01:04 mcurrycl

Just came across this. In my case, the first time that my bound command changes CanExecute, the IconToolbarItem seems to disappear. Actually, the button is still there, just the graphic appears to go blank. I see the same error log message as above.

pcresswell avatar May 22 '17 05:05 pcresswell

Did you find a workaround? I'm talking about that on the new github repo: https://github.com/jsmarcus/Iconize/issues/17

BenDevelopment avatar May 23 '17 17:05 BenDevelopment

Hey guys, I'm having the same problem ! Did you find any kind of solution/workaround for this ? Thank you

prahna avatar Feb 27 '18 14:02 prahna