-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Style DSL #86
Comments
Strangely the above didn't quite work. On the first rendering of the list box, that the above was a data template for, it rendered the correct colors for each row. On the second rendering after filtering or sorting the style was locked to the index of the list and not reapplied. For the moment I have used a more FPish strategy for styling.
It's a pity that the create methods accept List<'a> rather than Seq<'a>. I've had to create an overload
but that would have to be done for all controls which is unfortunate. Is there any way to change the create methods to Seq<'a> and have them continue to work. I don't think so because create is a module function and you can't overload module functions and F# doesn't understand covariance :( |
Ahhh...I just realized you can use yield and yield inside a list builder so I can write
and no need for anything to be changed. |
Hmm, need to look into this further. I think patching / diffing Styles is the hard part. Classes do work well if they styles need to change. It would be really nice to have this for style classes.
Hmm, yeah. maybe it would make sense to change it everywhere to: #seq<IAttr<'view>> -> IView<'view> |
See comment above..... you can use |
I don't really understand how the virtual dom / diffing / patching works. If you happen to write a blog post on what's going on then I would love to read it. |
Yeah, I should do that (and maybe add it to the Wiki - not just because I don't have a blog 😃). It's actually not that complicated (or at least I try to keep things simple). |
Another (maybe) bug with style diffing. If I add duplicate properties to a textblock then I would assume that the last one wins. ie
However I've seen, at least in the context of my datatemplate that it seems to randomly pick between the two. This is important when using
with the defaults in style and overrides in the array. |
I had a go at hacking a style DSL. It seems to work. I'm sure you could pick it apart but maybe it's a start for some ideas. XAML really should die!!
and then in my view
The text was updated successfully, but these errors were encountered: