-
Describe the bugAfter installing the nuget package, we can easily use the controls, Some controls have resources that I sometimes need to use them.
and here we will get Error:
is this a normal behavior? should we report this in wasdk repo? Steps to reproduce
Expected behaviorresources should be find and used ScreenshotsNo response Code Platform
Windows Build Number
Other Windows Build numberNo response App minimum and target SDK version
Other SDK versionNo response Visual Studio Version2022 Visual Studio Build NumberNo response Device form factorDesktop Additional contexti know that if we use Generic.xaml resource dictionary in our app we can access resources. but in Labs components we dont need to add Generic.xaml in our app.xaml file. so we should access resources Help us help youNo, I'm unable to contribute a solution. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@ghost1372 If you want to get styles or resources defined in other packages, you can do that by adding this to your <Page.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///CommunityToolkit.Labs.WinUI.SettingsControls/SettingsCard/SettingsCard.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Page.Resources> See an example here in the Let me know if that works. |
Beta Was this translation helpful? Give feedback.
-
i know that i can add resource dictionary in app.xaml or page, i just want to know is this normal? so generic.xaml only works for custom controls styles and we cant use other styles/resources (we need to add resource dictionary for using styles), is it true? |
Beta Was this translation helpful? Give feedback.
@ghost1372 If you want to get styles or resources defined in other packages, you can do that by adding this to your
Page
orApp
resources. So for the resources defined in theSettingsCard
, that would look like this:See an example here in the
SegmentedControl
sample:Labs-Windows/components/SegmentedControl/samples/SegmentedControlStylesSample.xaml
Line 13 in 2eaaa48