diff --git a/nukebuild/RefAssemblyGenerator.cs b/nukebuild/RefAssemblyGenerator.cs index e1c19c69a3..dc96849fe7 100644 --- a/nukebuild/RefAssemblyGenerator.cs +++ b/nukebuild/RefAssemblyGenerator.cs @@ -71,10 +71,10 @@ public class RefAssemblyGenerator foreach (var nested in type.NestedTypes) ProcessType(nested, obsoleteCtor); - var hideMethods = (type.IsInterface && type.Name.EndsWith("Impl")) + var hideMembers = (type.IsInterface && type.Name.EndsWith("Impl")) || HasPrivateApi(type.CustomAttributes); - var injectMethod = hideMethods + var injectMethod = hideMembers || type.CustomAttributes.Any(a => a.AttributeType.FullName == "Avalonia.Metadata.NotClientImplementableAttribute"); @@ -95,21 +95,47 @@ public class RefAssemblyGenerator foreach (var m in type.Methods) { - if (hideMethods || HasPrivateApi(m.CustomAttributes)) + if (hideMembers || HasPrivateApi(m.CustomAttributes)) { - var dflags = MethodAttributes.Public | MethodAttributes.Family | MethodAttributes.FamORAssem | - MethodAttributes.FamANDAssem | MethodAttributes.Assembly; - m.Attributes = ((m.Attributes | dflags) ^ dflags) | MethodAttributes.Assembly; + HideMethod(m); } MarkAsUnstable(m, obsoleteCtor, forceUnstable); } + foreach (var p in type.Properties) + { + if (HasPrivateApi(p.CustomAttributes)) + { + if (p.SetMethod != null) + HideMethod(p.SetMethod); + if (p.GetMethod != null) + HideMethod(p.GetMethod); + } + } + + foreach (var f in type.Fields) + { + if (hideMembers || HasPrivateApi(f.CustomAttributes)) + { + var dflags = FieldAttributes.Public | FieldAttributes.Family | FieldAttributes.FamORAssem | + FieldAttributes.FamANDAssem | FieldAttributes.Assembly; + f.Attributes = ((f.Attributes | dflags) ^ dflags) | FieldAttributes.Assembly; + } + } + foreach (var m in type.Properties) MarkAsUnstable(m, obsoleteCtor, forceUnstable); foreach (var m in type.Events) MarkAsUnstable(m, obsoleteCtor, forceUnstable); } + static void HideMethod(MethodDefinition m) + { + var dflags = MethodAttributes.Public | MethodAttributes.Family | MethodAttributes.FamORAssem | + MethodAttributes.FamANDAssem | MethodAttributes.Assembly; + m.Attributes = ((m.Attributes | dflags) ^ dflags) | MethodAttributes.Assembly; + } + static void MarkAsUnstable(IMemberDefinition def, MethodReference obsoleteCtor, ICustomAttribute unstableAttribute) { if (def.CustomAttributes.Any(a => a.AttributeType.FullName == "System.ObsoleteAttribute")) diff --git a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs b/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs index 70ce6107ad..2219966daa 100644 --- a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs +++ b/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml.cs @@ -117,9 +117,8 @@ namespace ControlCatalog.Pages private void ScrollTo(int index) { System.Diagnostics.Debug.WriteLine("Scroll to " + index); - var layoutManager = ((TopLevel)VisualRoot!).LayoutManager; var element = _repeater.GetOrCreateElement(index); - layoutManager.ExecuteLayoutPass(); + ((TopLevel)VisualRoot!).UpdateLayout(); element.BringIntoView(); } diff --git a/samples/GpuInterop/MainWindow.axaml.cs b/samples/GpuInterop/MainWindow.axaml.cs index 7cf0bc00e2..8d359fe7ef 100644 --- a/samples/GpuInterop/MainWindow.axaml.cs +++ b/samples/GpuInterop/MainWindow.axaml.cs @@ -11,7 +11,7 @@ namespace GpuInterop { InitializeComponent(); this.AttachDevTools(); - Renderer.Diagnostics.DebugOverlays = RendererDebugOverlays.Fps; + RendererDiagnostics.DebugOverlays = RendererDebugOverlays.Fps; } private void InitializeComponent() diff --git a/samples/RenderDemo/MainWindow.xaml.cs b/samples/RenderDemo/MainWindow.xaml.cs index d85f3b6051..be47ffd6e9 100644 --- a/samples/RenderDemo/MainWindow.xaml.cs +++ b/samples/RenderDemo/MainWindow.xaml.cs @@ -21,7 +21,7 @@ namespace RenderDemo void BindOverlay(Expression> expr, RendererDebugOverlays overlay) => vm.WhenAnyValue(expr).Subscribe(x => { - var diagnostics = Renderer.Diagnostics; + var diagnostics = RendererDiagnostics; diagnostics.DebugOverlays = x ? diagnostics.DebugOverlays | overlay : diagnostics.DebugOverlays & ~overlay; diff --git a/samples/RenderDemo/Pages/AnimationsPage.xaml b/samples/RenderDemo/Pages/AnimationsPage.xaml index d764af8978..f80389c832 100644 --- a/samples/RenderDemo/Pages/AnimationsPage.xaml +++ b/samples/RenderDemo/Pages/AnimationsPage.xaml @@ -347,12 +347,8 @@ - - - Hover to activate Keyframe Animations. -