-
Notifications
You must be signed in to change notification settings - Fork 27
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
[StyleExtensions] Resources Attached Property #870
Comments
|
directly inline collection item in an attached-dp likely will be problematic too, for both ours and uwp's parser |
What I have right now in the Xaml:
You can also change it in a style
the "ms-appx:///" could be added in the extension code, but I'm not sure if there are times where people would want to use a different kind of prefix.
Maybe we don't want that part?
|
I would probably put it in ControlExtensions.Resources |
don't forget the documentation that needs to come with it please |
@Marc-Antoine-Soucy My thinking was more that we would be able to do something like: <Style TargetType="Button">
<Setter Property="utu:ControlExtensions.Resources">
<Setter.Value>
<ResourceDictionary>
<StaticResource x:Key="ButtonBackground" ResourceKey="MyRedBrush" />
<!-- OR -->
<SolidColorBrush x:Key="ButtonBackground" Color="Red" />
<!-- OR -->
<ResourceDictionary.ThemeDictionaries>
<!--- etc... -->
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
<!-- OR -->
<ResourceDictionary Source="....." />
</Setter.Value>
<Setter Property="Template">
...
</Setter>
</Style> Something like that should theoretically work right @Xiaoy312 ? |
in theory, yes? |
It would be nice to have a DependencyProperty for Resources. Right now
Resources
is not a DP so you can't use it in aSetter
for a style to say that a specific style should have certain resources defined.It'd be cool to have an attached property that you can use in a
Style.Setter
to define aResourceDictionary
where you can put whatever you want. Then I guess we'd need to somehow inject thatResourceDictionary
into theResources
of the root control of theControlTemplate
maybe?One outstanding question is if it is at all possible to be able to access those resources from other
Style.Setter
s on the same Style, sort of like in WPF.Example:
The text was updated successfully, but these errors were encountered: