I have this style in App.xaml:
<Style Selector="DropDown /template/ ToggleButton#toggle">
<Setter Property="Background" Value="#000000" />
</Style>
but it's not working, is it possible to override the Background property in this ToggleButton?
@kekekeks sorry if I'm so boring. I added UseSkia
var builder = AppBuilder.Configure(app)
.UsePlatformDetect()
.UseSkia()
.SetupWithoutStarting();
and moved "new Bitmap 2
var r = AvaloniaLocator.Current.GetService<IPlatformRenderInterface>();Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
var fb = new Framebuffer(PixelFormat.Bgra8888, (int)this.Width, (int)this.Height);
using (var target = r.CreateRenderTarget(new object[] { fb }))
using (var ctx = new DrawingContext(target.CreateDrawingContext(null)))
{
ImmediateRenderer.Render(this, ctx);
}
Trace.WriteLine(stopwatch.ElapsedMilliseconds);
var bmp = new Bitmap(PixelFormat.Bgra8888, fb.Address, fb.Width, fb.Height, fb.RowBytes);
bmp.Save(@"D:\test1.bmp");
fb.Deallocate();
using (var rtb = new RenderTargetBitmap((int)this.Width, (int)this.Height))
{
stopwatch.Restart();
rtb.Render(this);
Trace.WriteLine(stopwatch.ElapsedMilliseconds);
rtb.Save(@"D:\test2.png");
}
but RenderTargetBitmap Render seems to be little bit faster than ImmediateRenderer.Render
Is this the right way? Am I measuring the right time?
little bit faster
Now do RTB first and framebuffer second, you'll see the opposite results
It is a nuget only issue. Seems that MonoMac is broken or something.
https://pastebin.com/Dcbau4f1
Here is the stacktrace.
When I switched from nuget to referencing the Avalonia projects directly by including them to the solution, everything worked fine.
Using .net core 2.0
var monomac = typeof(NSApplication).Assembly;
var name = monomac.GetName ().ToString ();
foreach (var a in AppDomain.CurrentDomain.GetAssemblies ()) {
foreach (var r in a.GetReferencedAssemblies ()) {
if (name == r.ToString ()) {
Console.WriteLine(a.GetName());
break;
}
}
}
make netstandard
from src
directory and copy bin/Release/net461/MonoMac.dll
to ~/.nuget/packages/monomac.netstandard/0.0.3/lib/**
make netstandard
you can use regular dotnet build
make generated_sources 64BIT=1
make[1]: *** No rule to make target `../maccore/src/./CoreGraphics/CGPoint.cs', needed by `core.dll'. Stop.
make: *** [netstandard] Error 2
÷
git submodule update --init --recursive
../maccore/src/./CoreGraphics/CGPoint.cs