diff --git a/doc/lightweight-styling.md b/doc/lightweight-styling.md
index 2b2b96c47..6b7578baa 100644
--- a/doc/lightweight-styling.md
+++ b/doc/lightweight-styling.md
@@ -130,6 +130,8 @@ With this XAML we are given the following visual result, notice the third Button
![Material - Button lightweight styling](assets/material-button-pointerover-lightweight-styling.png)
+It's also possible to customize a control using [the ResourcePathOverride extension](material-controls-extensions.md#ResourcePathOverride)
+
## Resource Keys
For more information about the lightweight styling resource keys used in each control, check out the following links:
diff --git a/doc/material-controls-extensions.md b/doc/material-controls-extensions.md
index cb8131294..67ec02965 100644
--- a/doc/material-controls-extensions.md
+++ b/doc/material-controls-extensions.md
@@ -131,3 +131,68 @@ The following control styles have support for surface tint:
| Control | Supporting Styles |
|---------|---------------------|
| Button | ElevatedButtonStyle |
+
+
+## ResourcePathOverride
+
+This extension allows you to set the path of a dictionary in your project for a specific control. It makes [lightweight styling](lightweight-styling.md) easier by enabling controls, like buttons, to link directly to resource dictionaries instead of requiring each resource to be written on the page. This means you can have multiple buttons with the same style but different colors simply by linking them to different resource dictionaries. It also allows for the reuse of these dictionaries across various controls, making the styling process more efficient and manageable.
+
+Here is an example of how LightWeightStyling could be applied could be used on a checkbox.
+* CheckBox:
+
+ ```xml
+
+ ```
+
+* ControlResourcesOverride/CheckBox.xaml content :
+
+ ```xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ```
+
diff --git a/src/library/Uno.Material/Extensions/ControlExtensions.cs b/src/library/Uno.Material/Extensions/ControlExtensions.cs
index 33a89d008..3490b01d7 100644
--- a/src/library/Uno.Material/Extensions/ControlExtensions.cs
+++ b/src/library/Uno.Material/Extensions/ControlExtensions.cs
@@ -130,6 +130,29 @@ public static class ControlExtensions
#endregion
+ #region DependencyProperty: Ressource
+ public static readonly DependencyProperty ResourcesProperty =
+ DependencyProperty.RegisterAttached("Resources", typeof(ResourceDictionary), typeof(ControlExtensions), new PropertyMetadata(null, OnResourcesChanged));
+
+ public static ResourceDictionary GetResources(UIElement element)
+ {
+ return (ResourceDictionary)element.GetValue(ResourcesProperty);
+ }
+
+ public static void SetResources(UIElement element, ResourceDictionary value)
+ {
+ element.SetValue(ResourcesProperty, value);
+ }
+
+ private static void OnResourcesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ if (d is Control control && e.NewValue is ResourceDictionary newResources)
+ {
+ control.Resources.MergedDictionaries.Add(newResources);
+ }
+ }
+ #endregion
+
private static void OnElevationChanged(DependencyObject element, DependencyPropertyChangedEventArgs e)
=> SurfaceTintExtensions.OnElevationChanged(element, (int)e.NewValue);
diff --git a/src/samples/UWP/Uno.Themes.Samples.Shared/Content/Extensions/ControlExtensionsSamplePage.xaml b/src/samples/UWP/Uno.Themes.Samples.Shared/Content/Extensions/ControlExtensionsSamplePage.xaml
index 810edc992..78aebcdc8 100644
--- a/src/samples/UWP/Uno.Themes.Samples.Shared/Content/Extensions/ControlExtensionsSamplePage.xaml
+++ b/src/samples/UWP/Uno.Themes.Samples.Shared/Content/Extensions/ControlExtensionsSamplePage.xaml
@@ -2,12 +2,13 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:example="http://schemas.microsoft.com/expression/blend/2008"
xmlns:android="http://uno.ui/android"
xmlns:ios="http://uno.ui/ios"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:um="using:Uno.Material"
xmlns:smtx="using:ShowMeTheXAML"
- mc:Ignorable="d android ios">
+ mc:Ignorable="d android ios example">
M 2 0 C 0.8999999761581421 0 0 0.8999999761581421 0 2 C 0 3.100000023841858 0.8999999761581421 4 2 4 C 3.100000023841858 4 4 3.100000023841858 4 2 C 4 0.8999999761581421 3.100000023841858 0 2 0 Z M 14 0 C 12.899999976158142 0 12 0.8999999761581421 12 2 C 12 3.100000023841858 12.899999976158142 4 14 4 C 15.100000023841858 4 16 3.100000023841858 16 2 C 16 0.8999999761581421 15.100000023841858 0 14 0 Z M 8 0 C 6.899999976158142 0 6 0.8999999761581421 6 2 C 6 3.100000023841858 6.899999976158142 4 8 4 C 9.100000023841858 4 10 3.100000023841858 10 2 C 10 0.8999999761581421 9.100000023841858 0 8 0 ZM 2 4 C 3.100000023841858 4 4 3.100000023841858 4 2 C 4 0.8999999761581421 3.100000023841858 0 2 0 C 0.8999999761581421 0 0 0.8999999761581421 0 2 C 0 3.100000023841858 0.8999999761581421 4 2 4 Z M 2 6 C 0.8999999761581421 6 0 6.899999976158142 0 8 C 0 9.100000023841858 0.8999999761581421 10 2 10 C 3.100000023841858 10 4 9.100000023841858 4 8 C 4 6.899999976158142 3.100000023841858 6 2 6 Z M 2 12 C 0.8999999761581421 12 0 12.899999976158142 0 14 C 0 15.100000023841858 0.8999999761581421 16 2 16 C 3.100000023841858 16 4 15.100000023841858 4 14 C 4 12.899999976158142 3.100000023841858 12 2 12 Z
@@ -151,6 +152,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/samples/UWP/Uno.Themes.Samples.Shared/ControlResourcesOverride/CheckBox.xaml b/src/samples/UWP/Uno.Themes.Samples.Shared/ControlResourcesOverride/CheckBox.xaml
new file mode 100644
index 000000000..90a455103
--- /dev/null
+++ b/src/samples/UWP/Uno.Themes.Samples.Shared/ControlResourcesOverride/CheckBox.xaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/samples/UWP/Uno.Themes.Samples.Shared/Styles/Button.xaml b/src/samples/UWP/Uno.Themes.Samples.Shared/Styles/Button.xaml
index 89969bf66..87178e6d6 100644
--- a/src/samples/UWP/Uno.Themes.Samples.Shared/Styles/Button.xaml
+++ b/src/samples/UWP/Uno.Themes.Samples.Shared/Styles/Button.xaml
@@ -4,11 +4,67 @@
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:not_win="http://uno.ui/not_win"
xmlns:xamarin="http://uno.ui/xamarin"
+ xmlns:um="using:Uno.Material"
xmlns:android="http://uno.ui/android"
xmlns:ios="http://uno.ui/ios"
xmlns:wasm="http://uno.ui/wasm"
mc:Ignorable="xamarin android ios wasm not_win">
+
+