Replies: 4 comments 12 replies
-
Hey @kucint
|
Beta Was this translation helpful? Give feedback.
-
Great! Now I see that we both get the same results, so finally we are on the same page :) FYI: Project I am currently working on will not be RTM (ready to manufacture) any soon. So I do not seek for a "quick" solutions aka work-arounds. I seek rather for a long term well-structured solutions. I am ready to wait for bug-fixes even couple of months, if you assure me, they will be delivered in some predictable future. Question 1: In you latest post, you attached two screenshots of your test app. The second one was done on Windows, the origin of the first one is unknown. What is the OS of the first one? Linux? macOS? Question 2: Right now, bindings behave differently on Windows and other OSs (as we may see on your screenshots). Your proposed solution here is to use Question 3: Even if using Question 4: Question 4:
Let suppose I set states to 42 now:
Now I want to set both states back to
Thanks for your help! |
Beta Was this translation helpful? Give feedback.
-
Q1: First screenshot is using skia (on windows, but it will be the same on all OS at this point: with the "skia backend" we are rendering controls by our own directly on a canvas and it can then be run on any target: Windows, Linux, macOS, IoT, etc.). Q2: Yes, should be few weeks ahead. We're also planning to include the changes needed to await a Q3: On windows (i.e. using the Windows App SDK from Microsoft, not uno's skia rendering on windows), we have no control over the binding engine. And as WinAppSDK is actually our baseline, if we want to completely align the binding engine, it would mean to reduce the number of supported cases by uno. While to be purist it would make sense, as the Actually I found multiples issues on Microsoft repo about that
It would probably makes more sense to wait for MS to fix that on their side (and add details into the issues). Q4:
Damn ... but it makes sense: They are probably using
Here again it's the control from Microsoft, you will have to report it on the WinUI repro. I found that there is already an issue for that where you can add your details: Then, as But usually such feature takes some time to be implemented by the WinUI team, so I would recommend you to clone uno's implementation (which is in C#) to create a Q5:
Currently you can do : For instance, this is problematic: public async ValueTask Increment()
{
var current = await MyState;
await MyState.SetAync(current + 1);
} While this is thread safe (and ensure ACID properties, no matter what's hidden behind the public async ValueTask Increment() => await MyState.UpdateAsync(current => current + 1); The But the good news is that I pushed a commit few hours ago to add the ability to do |
Beta Was this translation helpful? Give feedback.
-
Q5 I am glad you touch the ACID properties topic, because there is couple of things I don´t understand and neither documentation nor example apps do not cover it. Have a look, I am aware that
is problematic and should be replaced with This scenario is quit simple, let dive in more complex one: let suppose I have states: A, B, C, D |
Beta Was this translation helpful? Give feedback.
-
In MVU model I can create a state that can be bound to some UI element.
Question 1: :
I want to create an "uninitialized" state, I mean, the UI element bound to the state shall have no value set (the textbox shall initially be empty).
Usually I create a state as follow:
public IState<int> SomeIntA => State.Value(this, () => 5);
I can do this using
public IState<int> SomeIntB => State<int>.Empty(this);
which seems to initialize state with default value. (Am I right?)How should I create a state and say that it is "uninitialized"?
Question 2:
Let suppose user filled up the form, but left one field empty. this field is bound to some
IState<int>
.When I read a state value associated to the field it gives me last correctly set value.
How can I detect that user did not provide a value?
Generally, how am I supposed to validate the user input?
Beta Was this translation helpful? Give feedback.
All reactions