avaloniaui / avalonia.labs Goto Github PK
View Code? Open in Web Editor NEWExperimental Controls for Avalonia
License: MIT License
Experimental Controls for Avalonia
License: MIT License
We need a better example for StepBar, an example where you switch the content everytime you press Next or Previous and also for each one, we need to evaluate CanGoNext or CanGoPrevious differently for each step
I failed to display my Lottie animation who's Lottie version is 5.5.2 with the Lottie controller. I am wondering whether there exist the maximum Lottie version that is supported by the Lottie controller.
The nuget feed https://nuget.avaloniaui.net/repository/avaloniaui-all/index.json is not available.
Is it a temporary situation?
After the first cycle of selecting the next/prev item the animation never runs again for the next cycle.
Hello
I am trying to use the experimental TabControl but seems I cannot switch page by using a button as header.
<labs:TabItem Header="Page 1">
This is Page 1
</labs:TabItem>
<labs:TabItem Header="Page 2">
This is Page 2
</labs:TabItem>
<labs:TabItem>
<labs:TabItem.Header>
<Button>Button Page 3</Button>
</labs:TabItem.Header>
<labs:TabItem.Content>
<TextBlock>Page 3</TextBlock>
</labs:TabItem.Content>
</labs:TabItem>
<labs:TabItem>
<labs:TabItem.Header>
<Button>Button Page 4</Button>
</labs:TabItem.Header>
<labs:TabItem.Content>
<TextBlock>Page 4</TextBlock>
</labs:TabItem.Content>
</labs:TabItem>
I can navigate to Page 1 and Page 2 but not Page 3 and Page 4 when I click on the button.
Is there a way to use buttons as headers?
Steps to reproduce:
Expected: content of tab 1 is shown
Actual: content for tab is empty
Note: switching again to tab 2 and back to tab 1 fixes this. After doing that the issue will not occur anymore until navigated back to Welcome Page and coming back to "Tab Layout", then the cycle repeats.
When resizing a window with flexpanel to a size where the flexpanel is completely squashed the layouting code throws an InvalidOperationException
.
Steps to reproduce:
NaN
Unhandled exception. System.InvalidOperationException: Invalid Arrange rectangle.
at Avalonia.Layout.Layoutable.Arrange(Rect rect)
at Avalonia.Labs.Panels.FlexPanel.ArrangeOverride(Size finalSize) in /var/home/jangernert/Projects/Avalonia.Labs/src/Avalonia.Labs.Panels/FlexPanel.cs:line 349
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.Arrange(Rect rect)
at Avalonia.Controls.Border.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.Arrange(Rect rect)
at Avalonia.Controls.DockPanel.ArrangeOverride(Size arrangeSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.Arrange(Rect rect)
at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.Arrange(Rect rect)
at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.Arrange(Rect rect)
at Avalonia.Controls.DockPanel.ArrangeOverride(Size arrangeSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
at Avalonia.Controls.TransitioningContentControl.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.Arrange(Rect rect)
at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.Arrange(Rect rect)
at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.Arrange(Rect rect)
at Avalonia.Layout.LayoutHelper.ArrangeChildInternal(Layoutable child, Size availableSize, Thickness padding)
at Avalonia.Controls.Primitives.VisualLayerManager.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
at Avalonia.Controls.WindowBase.ArrangeCore(Rect finalRect)
at Avalonia.Layout.Layoutable.Arrange(Rect rect)
at Avalonia.Layout.LayoutManager.Arrange(Layoutable control)
at Avalonia.Layout.LayoutManager.ExecuteArrangePass()
at Avalonia.Layout.LayoutManager.ExecuteLayoutPass()
at Avalonia.Controls.WindowBase.HandleResized(Size clientSize, WindowResizeReason reason)
at Avalonia.Controls.Window.HandleResized(Size clientSize, WindowResizeReason reason)
at Avalonia.X11.X11Window.<OnEvent>b__111_0()
at Avalonia.Threading.DispatcherOperation.InvokeCore()
at Avalonia.Threading.DispatcherOperation.Execute()
at Avalonia.Threading.Dispatcher.ExecuteJob(DispatcherOperation job)
at Avalonia.Threading.Dispatcher.ExecuteJobsCore(Boolean fromExplicitBackgroundProcessingCallback)
at Avalonia.Threading.Dispatcher.Signaled()
at Avalonia.X11.X11PlatformThreading.CheckSignaled()
at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken cancellationToken)
at Avalonia.Threading.DispatcherFrame.Run(IControlledDispatcherImpl impl)
at Avalonia.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken)
at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args)
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, ShutdownMode shutdownMode)
at Avalonia.Labs.Catalog.Desktop.Program.Main(String[] args) in /var/home/jangernert/Projects/Avalonia.Labs/samples/Avalonia.Labs.Catalog.Desktop/Program.cs:line 14
Hello,
I was playing around with a few QR implementation and found this repo. I like the design and hope this will be part of Avalonia some day.
However, I could get the QR to work. I couldn't scan a single generated QR code.
Steps to reproduce:
ViewModel:
private string _qrCodeString = "This is a Test!";
public string QrCodeString
{
get => _qrCodeString;
set => this.RaiseAndSetIfChanged(ref _qrCodeString, value);
}
Note: Somehow using a plain text without binding won't generate the initial bit matrix and no code will be displayed. Looks like an unrelated issue.
View:
<qr:QrCode Data="{Binding QrCodeString}"
ErrorCorrection="Medium"
Padding="20"
Background="white"
Foreground="Black"
Width="250" Height="250"/>
Result:
This QR-code is invalid and can not be scanned by the default Android QR scanner.
At first, I thought the round corners confused the scanner. I also noticed that the edges looked cutoff and there were way to few pixels in the QR code.
After digging, I found QuietZoneCount
and QuietMargin
. As I understand QR codes, there should be a ~4 dots padding area around the QR code. However, the current implementation actually removes 4 rows / columns from every edge. Therefore, losing data.
Setting QuietZoneCount
to 0
and adding this safety safe to IsValid
fixes the codes again.
if (x < 0 || y < 0 || x >= bitMatrix.Width || y >= bitMatrix.Height)
return false;
Expected result:
This is a working QR code, that can be scanned.
If I can figure out the original intent of the code, I can create a PR to fix this.
While there is a release on GitHub for 11.0.0, the nuget packages are still version 11.0.0-rc2.2
I use the prism library, and I get this error when I switch to a different page and then back.
avalonia 11.0
windows10
.net7
<se:Lottie Canvas.Left="16" Canvas.Top="24" Height="32" Width="32" Path="avares://AGaxSat.Monitor/Resources/Logos/Wifi_Signal.json">
se:Lottie.RenderTransform
</se:Lottie.RenderTransform>
</se:Lottie>
at SkiaSharp.Skottie.Animation.get_Size()
at Avalonia.Labs.Lottie.Lottie.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Controls.Canvas.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Controls.Canvas.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Controls.Grid.MeasureCell(Int32, Boolean)
at Avalonia.Controls.Grid.MeasureCellsGroup(Int32, Avalonia.Size, Boolean, Boolean, Boolean ByRef)
at Avalonia.Controls.Grid.MeasureCellsGroup(Int32, Avalonia.Size, Boolean, Boolean)
at Avalonia.Controls.Grid.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.LayoutHelper.MeasureChild(Avalonia.Layout.Layoutable, Avalonia.Size, Avalonia.Thickness, Avalonia.Thickness)
at Avalonia.Controls.Border.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Controls.StackPanel.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Controls.Presenters.ScrollContentPresenter.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Controls.Grid.MeasureCell(Int32, Boolean)
at Avalonia.Controls.Grid.MeasureCellsGroup(Int32, Avalonia.Size, Boolean, Boolean, Boolean ByRef)
at Avalonia.Controls.Grid.MeasureCellsGroup(Int32, Avalonia.Size, Boolean, Boolean)
at Avalonia.Controls.Grid.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.LayoutHelper.MeasureChild(Avalonia.Layout.Layoutable, Avalonia.Size, Avalonia.Thickness, Avalonia.Thickness)
at Avalonia.Controls.Border.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.LayoutHelper.MeasureChild(Avalonia.Layout.Layoutable, Avalonia.Size, Avalonia.Thickness, Avalonia.Thickness)
at Avalonia.Controls.Border.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Controls.DockPanel.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Controls.Grid.MeasureCell(Int32, Boolean)
at Avalonia.Controls.Grid.MeasureCellsGroup(Int32, Avalonia.Size, Boolean, Boolean, Boolean ByRef)
at Avalonia.Controls.Grid.MeasureCellsGroup(Int32, Avalonia.Size, Boolean, Boolean)
at Avalonia.Controls.Grid.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.LayoutHelper.MeasureChild(Avalonia.Layout.Layoutable, Avalonia.Size, Avalonia.Thickness, Avalonia.Thickness)
at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.LayoutHelper.MeasureChild(Avalonia.Layout.Layoutable, Avalonia.Size, Avalonia.Thickness, Avalonia.Thickness)
at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Avalonia.Size)
at Avalonia.Layout.Layoutable.MeasureCore(Avalonia.Size)
at Avalonia.Layout.Layoutable.Measure(Avalonia.Size)
at Avalonia.Layout.LayoutManager.Measure(Avalonia.Layout.Layoutable)
at Avalonia.Layout.LayoutManager.ExecuteMeasurePass()
at Avalonia.Layout.LayoutManager.InnerLayoutPass()
at Avalonia.Layout.LayoutManager.ExecuteLayoutPass()
at Avalonia.Layout.LayoutManager.ExecuteQueuedLayoutPass()
at Avalonia.Media.MediaContext.FireInvokeOnRenderCallbacks()
at Avalonia.Media.MediaContext.RenderCore()
at Avalonia.Media.MediaContext.Render()
at Avalonia.Threading.DispatcherOperation.InvokeCore()
at Avalonia.Threading.DispatcherOperation.Execute()
at Avalonia.Threading.Dispatcher.ExecuteJob(Avalonia.Threading.DispatcherOperation)
at Avalonia.Threading.Dispatcher.ExecuteJobsCore()
at Avalonia.Threading.Dispatcher.Signaled()
at Avalonia.Win32.Win32Platform.WndProc(IntPtr, UInt32, IntPtr, IntPtr)
at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG ByRef)
at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG ByRef)
at Avalonia.Win32.Win32DispatcherImpl.RunLoop(System.Threading.CancellationToken)
at Avalonia.Threading.DispatcherFrame.Run(Avalonia.Threading.IControlledDispatcherImpl)
at Avalonia.Threading.Dispatcher.PushFrame(Avalonia.Threading.DispatcherFrame)
at Avalonia.Threading.Dispatcher.MainLoop(System.Threading.CancellationToken)
at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(System.String[])
at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(Avalonia.AppBuilder, System.String[], Avalonia.Controls.ShutdownMode)
at AGaxSat.Program.Main(System.String[])
11.1.0-beta1, 11.2.999-cibuild0046793-alpha, e31fc59e9c9d62f5efc7c39a6fbb2bf4a330ff3b
No response
On 11.1.0-beta
and upper, if remove following line work
Porting WinUI ContentDialog.
I consider it an essential component, I known that there are 3rd party libraries that implement it, but they are not always up to date.
Do we have any plan of which control will be ported to main repo?
Semi theme need to prepare for this.
AsyncImage currently doesn't support file caching for web uris. Ideally, a cache helper should be provided, allowing the image to cache downloaded files either in memory, or on the file system.
Is it expected behavior that the NavigationControl does not add content to the logical tree?
Step bar will have weird behavior if you press too fast on previous or next.
I think this is the cause of the problem: In StepBar.cs, the 200 milliseconds is too long.
if (_bar is ProgressBar progressBar)
{
var current = progressBar.Value;
progressBar.BeginAnimation(ProgressBar.ValueProperty
, TimeSpan.FromMilliseconds(200)
, (double)selectIndex);
}
Hi folks,
I did not find Q&A here, sorry.
I would like to use ContentDialog but I want this to run upon a Panel (and block just this Panel) instead of block the entire Window.
Is it possible?
AsyncImage uses HttpClient in several bad ways:
Currently inside AsyncImage.cs:
using var client = new HttpClient();
Link
I think it's a bad practice create a new HttpClient per control and force the auto-disposal of the HttpClient.
Why:
When opening many AsyncImages we create many clients in parallel to load the images which in turn:
What AsyncImage should do:
AsyncImage should enable supplying a HttpClient by the consumer in order to allow shared use of HttpClient(s) which can handle multiple requests in parallel and this would address both these problems.
If the developer wants to use that auto-disposing feature he should set some boolean flag - however, auto-disposing should ultimately be disabled by default (in order to prevent the Socket-Exhaustion issue). And in the Control's Help-Text the Socket-Exhaustion-Problem should maybe get referenced in the infotext of that AutoDisposeHttpClient -Property
[Which would only be required if the Consumer did not supply his own HttpClient instance, which can have rate-limiting integrated etc. and which should be disposed by himself and not the control then]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.