-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
browser support #2
Comments
Thank you for using the package and your suggestion. Unfortunately I did not find an easy way to support browsers, but I'm not that familiar with WASM integration yet. I'll keep this issue open, in case anyone wants to submit a PR or provide technical details on how to implement this. |
Yes, of course, I love this package, I just need support for the web. |
I'm on it. Discussion here, questsions answered. I probably will deprecate this package and Relaunch it as public interface IPreferences
{
/// <summary>
/// Checks for the existence of a given key.
/// </summary>
/// <param name="key">The key to check.</param>
/// <param name="sharedName">Shared container name.</param>
/// <returns><see langword="true"/> if the key exists in the preferences, otherwise <see langword="false"/>.</returns>
bool ContainsKey(string key, string? sharedName = null);
/// <summary>
/// Removes a key and its associated value if it exists.
/// </summary>
/// <param name="key">The key to remove.</param>
/// <param name="sharedName">Shared container name.</param>
void Remove(string key, string? sharedName = null);
/// <summary>
/// Clears all keys and values.
/// </summary>
/// <param name="sharedName">Shared container name.</param>
void Clear(string? sharedName = null);
/// <summary>
/// Sets a value for a given key.
/// </summary>
/// <typeparam name="T">Type of the object that is stored in this preference.</typeparam>
/// <param name="key">The key to set the value for.</param>
/// <param name="value">Value to set.</param>
/// <param name="sharedName">Shared container name.</param>
void Set<T>(string key, T value, string? sharedName = null);
/// <summary>
/// Gets the value for a given key, or the default specified if the key does not exist.
/// </summary>
/// <typeparam name="T">The type of the object stored for this preference.</typeparam>
/// <param name="key">The key to retrieve the value for.</param>
/// <param name="defaultValue">The default value to return when no existing value for <paramref name="key"/> exists.</param>
/// <param name="sharedName">Shared container name.</param>
/// <returns>Value for the given key, or the value in <paramref name="defaultValue"/> if it does not exist.</returns>
T Get<T>(string key, T defaultValue, string? sharedName = null);
} |
Started an implementation experiment on https://github.com/sandreas/Avalonia.SimplePreferences. Probably take some time until release, but I think this has a much better design. We'll see if this holds. |
I like it because use json instead of a local form, someone once told me that avalonia is only used for ui and has no support for native controls such as preferences |
There you go: Documentation: Early state but should mostly work like expected, feedback is welcome! |
I was testing this package and it works for me on desktop and Android but it still doesn't work for me in the browser. Could it be improved on this platform or is there an update being made?
The text was updated successfully, but these errors were encountered: