Viet Phan X

[⚠️ JOURNEY] Building MP3 AI Manager for Music Hoarders (Day 13)

Author AvatarViet Phan
0
Jan 3, 2025
2 min read

Day 13

Hours worked/Total: 1.5/21.5

Avaloniapickfolder

Day Recap

Shifted focus to implement functionality for opening a folder instead of a file. Faced several issues with compatibility, strict typing, and binding updates but eventually got the UI to display the selected folder path correctly.

What I Did

  • Attempted to adapt Avalonia’s SaveFilePicker examples to create an Open Folder Picker.
    • Found that community tool examples don’t work with .NET 8—specifically, [RelayCommand] decorators fail to generate working commands.
  • Decided to stick with a working method:
    • Changed the StorageProvider method to open a folder instead of a file.
  • Encountered a strict typing issue:
    • The StorageProvider returned an array instead of a string, which caused casting errors.
  • Couldn’t get the bound variable to update in the UI after setting a new value.
    • Resolved this by overriding the ViewModelBase type with Avalonia ObservableObject and using the [ObservableProperty] decorator.
    • This generates boilerplate code for getters and setters.
  • After implementing these changes, the UI was successfully notified of the updated folder path and displayed it correctly.

Remarks

  • The strict typing and binding mechanics are powerful but unforgiving. And amount of boilerplate for basic work with variables is insane.

Next Goals

Refine the folder picker functionality to show mp3 files inside the folder.

πŸ‘¨β€πŸ’» Software DevelopmentπŸš€ Journey

Got an Idea?

Let's Build It!

I can bring your ideas to life - FREE of charge

Book a free consultation and let’s identify opportunities to turn your vision into a successful business

15 min call

Get idea feedback

from 17+ consultations
?
Usually responds within 24h

If You Like what I do
You can buy me a coffee πŸ‘‡
Send β˜• via PayPalSend β˜• with Bitcoin

πŸ€™ Let's connect

Made by Viet Phan Β© 2018-2025Privacy Policy