-
Notifications
You must be signed in to change notification settings - Fork 694
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 setter does not support Binding
#4826
Comments
- Fixes issue unoplatform#4793 where Content top padding was not correctly applied due to the fact that API information reported API availability matching SDK 17134, while Uno supports 19041 - Updates TabView FluentStyles style to be buildable with new contract support, because {Binding} is not supported in Style Setters yet (unoplatform#4826)
- Fixes issue unoplatform#4793 where Content top padding was not correctly applied due to the fact that API information reported API availability matching SDK 17134, while Uno supports 19041 - Updates TabView FluentStyles style to be buildable with new contract support, because {Binding} is not supported in Style Setters yet (unoplatform#4826)
When fixed, revert Uno specific TODOs in both |
Strange that
|
@davidjohnoliver They are using it this way: <contract7Present:Setter Property="CornerRadius" Value="{Binding Source={ThemeResource OverlayCornerRadius}, Converter={StaticResource TopCornerRadiusFilterConverter}}"/> So maybe this use-case is supported - to utilize |
Ahhhh...... yeah, maybe it works in the particular case that a Source is specified (and it's a resource) |
We'll probably have to make a special case for those. it's probably excluded explicitly in the generator for setters. |
This probably could be supported using uno/src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlFileGenerator.cs Lines 1592 to 1595 in 5510158
|
Binding
Ensure the fix also supports the following scenario: Given VS 2019, create new UNO solution, leave only 3 projects: Shared, UWP and Wasm
Use it in MainPage.xaml:
Build. The same happens for inline binding declaration like |
Possible fixed with #16010 ? Not sure |
@MartinZikmund, maybe @morning4coffe-dev can help validate if it is already fixed or not |
@MartinZikmund, @agneszitte, Tested on Skia, wasm, and Android with Uno |
Current behavior
When
Binding
is used inStyle
Setter
, Uno targets don't compile.Expected behavior
Should compile.
TabView
button style uses this approach, so it would be a useful addition.How to reproduce it (as minimally and precisely as possible)
Run the app on Windows and notice the text is red.
Try to compile under Uno and notice build fails with error CS1024: Preprocessor directive expected
The error is also in the generated
g.cs
file, similar to the following:Workaround
Avoid use of Binding in style setter
Environment
Nuget Package:
Nuget Package Version(s):
Affected platform(s):
IDE:
Relevant plugins:
Anything else we need to know?
The text was updated successfully, but these errors were encountered: