diff --git a/Material.Avalonia.Demo/Material.Avalonia.Demo.csproj b/Material.Avalonia.Demo/Material.Avalonia.Demo.csproj index 49bb2937..4275fdcb 100644 --- a/Material.Avalonia.Demo/Material.Avalonia.Demo.csproj +++ b/Material.Avalonia.Demo/Material.Avalonia.Demo.csproj @@ -24,4 +24,10 @@ + + + + ShowMeTheXamlStyles.axaml + + diff --git a/Material.Avalonia.Demo/Styles/ShowMeTheXamlStyles.XamlDisplayAvaloniaEditThemeBehavior.cs b/Material.Avalonia.Demo/Styles/ShowMeTheXamlStyles.XamlDisplayAvaloniaEditThemeBehavior.cs new file mode 100644 index 00000000..47737daa --- /dev/null +++ b/Material.Avalonia.Demo/Styles/ShowMeTheXamlStyles.XamlDisplayAvaloniaEditThemeBehavior.cs @@ -0,0 +1,20 @@ +using System.Runtime.InteropServices; +using ShowMeTheXaml.Avalonia.AvaloniaEdit; + +namespace Material.Avalonia.Demo.Styles; + +public class CustomXamlDisplayAvaloniaEditThemeBehavior : XamlDisplayAvaloniaEditThemeBehavior { + protected override void OnAttachedToVisualTree() { + if (RuntimeInformation.ProcessArchitecture == Architecture.Wasm) { + return; + } + base.OnAttachedToVisualTree(); + } + + protected override void OnDetachedFromVisualTree() { + if (RuntimeInformation.ProcessArchitecture == Architecture.Wasm) { + return; + } + base.OnDetachedFromVisualTree(); + } +} \ No newline at end of file diff --git a/Material.Avalonia.Demo/Styles/ShowMeTheXamlStyles.axaml b/Material.Avalonia.Demo/Styles/ShowMeTheXamlStyles.axaml index 174de87e..edf04a08 100644 --- a/Material.Avalonia.Demo/Styles/ShowMeTheXamlStyles.axaml +++ b/Material.Avalonia.Demo/Styles/ShowMeTheXamlStyles.axaml @@ -3,7 +3,8 @@ xmlns:avaloniaEdit="https://github.com/avaloniaui/avaloniaedit" xmlns:avaloniaEdit1="clr-namespace:ShowMeTheXaml.Avalonia.AvaloniaEdit;assembly=ShowMeTheXaml.Avalonia.AvaloniaEdit" xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia" - xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"> + xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles" + xmlns:styles="clr-namespace:Material.Avalonia.Demo.Styles">