466 questions
13
votes
2
answers
7k
views
How is Avalonia to develop crossplatform application?
I am a WPF developer. Our team is looking for a good cross-platform solution to replace the old desktop product developed with WPF. We recently found that Avalonia might be one of the great ways, but ...
10
votes
1
answer
3k
views
Transparency and click through in Avalonia
I am thinking about porting my app made in WPF to Avalonia.
My first requirement is to enable click-through transparency (same as <Window Background="{x:Null}" WindowStyle="None"...
8
votes
0
answers
1k
views
Avalonia C# app published with PublishAot flag still contains DLLs in the output directory
I have an app that uses NET8 and Avalonia and when I publish it with "Produce single file" flag and this flag in csproj <IncludeNativeLibrariesForSelfExtract>true</...
7
votes
1
answer
4k
views
Avalonia - How to place the Tab control's tabs vertically like the OneNote Desktop UI
I am new to Avalonia. In WPF, you can easily place the tab control's tabs vertically, demonstrated in below article
https://www.wpf-tutorial.com/tabcontrol/tab-positions/
How could I achieve similar ...
7
votes
1
answer
2k
views
Avalonia: How to animate points in path using code
I'm trying to figure out how to do animations in Avalonia.
I have a path with 4 linesegements and I want to animate each point to a new position. In WPF I have done it like this:
public void ...
6
votes
2
answers
6k
views
Horizontal centering of button text in AvaloniaUI Button
I have been trying various techniques to try and get the button label text center aligned. When I look at the button in the Avalonia DevTools inpspector, I can see the the AccessText TextAlignment is ...
5
votes
1
answer
3k
views
Call method on application exit in Avalonia
I need to call method when application is closing in Avalonia. Honestly on startup too, but this can be handled by view model constructor.
The obstacle is that Avalonia documentation is empty and ...
5
votes
1
answer
6k
views
Resource.xaml in Avalonia
I am creating an app using avalonia which has some UI stuff in another assembly because of re-usability. Within this additional assembly, i want to have a Resource.xml file which is referenced by the ...
5
votes
1
answer
6k
views
Avalonia How To Create Custom Popup
A little explanation first:
This is source code of Popup element
And this is example of using Popup DatePicker and it's xaml
I've tried use this example on empty window like this
Here is result:
So ...
5
votes
1
answer
314
views
Register program to Windows share menu
Windows 10 introduced a new share menu, which can be accessed, among other ways, by right-clicking a file in the File Explorer and choosing "Share".
I'm developing a Windows program and I'd ...
5
votes
3
answers
1k
views
In WPF, when Visibility is set to Collapsed, the control won't occupy any space. How can this be done in Avalonia?
I want to hide a control in Avalonia, and have the space occupied by this control be occupied by adjacent controls instead, just like when you set Visibility to Collapsed in WPF.
4
votes
2
answers
6k
views
"Unable to resolve type" when referencing a xaml file through namespaces
I'm trying to build the example project that is provided in the Avalonia website but I'm having difficulty with certain parts.
I want to use a xaml element in a xaml window in another file like so:
&...
4
votes
2
answers
4k
views
Avalonia Get All Windows
Is there a way to get a list of all windows in Avalonia?
The equivalent of this in WPF
Application.Current.Windows
My requirement is to activate or close a certain window based on its DataContext.
If ...
4
votes
1
answer
3k
views
AvaloniaUI: Capture mouse button up/down globally
Is there a possibility in AvaloniaUI, to globally capture mouse press button up/down? To be notified about this events outside of any controls (or possibly outside of any particular view model)?
4
votes
2
answers
5k
views
Show dialog from ViewModel in ReactiveUI Avalonia (MVVM)
I have Window, inheriting from ReactWindow, and it's connected to its Viewmodel .
Everything is working as expected (binding, clicking stuff, hitting commands). So it's working. (code is below)
When ...
4
votes
1
answer
88
views
Unable to implement INotifyPropertyChanged with System.Reflection.Emit
I'm trying to implement a dynamic class that can be bound to an Avalonia DataGrid. This class should implement INotifyPropertyChanged in order to use DataGrid edition. After search, it seems the best ...
4
votes
1
answer
2k
views
AvaloniaUI: Setup was already called on one of AppBuilder instances
Whenever I try to restart Avalonia application form base application, I get an exception: "Setup was already called on one of AppBuilder instances." on SetupWithLifetime() call.
Application ...
4
votes
0
answers
650
views
WiX HEAT5151: Could not harvest data from a file that was expected to be an assembly
Im working on a WiX installer for an Avaloina UI application. When using heat.exe to generate my components, I get errors for every DLL in my publish folder which say:
1>heat.exe(0,0): warning ...
4
votes
2
answers
2k
views
dotnet publish osx-x64 doesn't generate executable
I have an Avalonia project I'm tried to build for mac. But when I use dotnet publish to generate the build for osx, there is no executable file generated. It generates a .dll file with the same name ...
3
votes
2
answers
3k
views
LayoutTransform / ScaleTransform in Avalonia?
What's the equivalent of LayoutTransform in Avalonia?
<Slider.LayoutTransform>
<ScaleTransform ScaleY="0.7" ScaleX="0.7" />
</Slider.LayoutTransform>
3
votes
2
answers
2k
views
How do I style an Avalonia NumericUpDown control integer-only?
Every time I click the Up or Down button of an Avalonia NumericUpDown control a period with a zero gets added to the value, i.e. it increases as 2.0, 3.0, 4.0 etc. instead of 2, 3, 4 (which would be ...
3
votes
3
answers
2k
views
Avalonia DataGrid Enter handling
I'm using Avalonia.Controls.DataGrid. By default, when the grid has focus and Enter is pressed, it automatically handles the event and moves the selection to the next item. How can I prevent this ...
3
votes
2
answers
4k
views
How to set a focus to TextBox in Avalonia
I have TextBox and Button, when I click Button, the text from TextBox sends to server. And TextBox loses focus. How i can set focus to the TextBox after Button click? I've read about FocusManager, but ...
3
votes
1
answer
2k
views
Binding a list of rectangles to a canvas in AvaloniaUI
I am trying to bind an observable collection of rectangles to an items control with a canvas as the item panel, but there seems to be no way of binding the Canvas.Left and Canvas.Top properties to the ...
3
votes
3
answers
4k
views
How to draw pixel-by-pixel on bitmap in AvaloniaUI?
I am trying to write a drawing application that allows users to select two points on canvas and draws a line between those points pixel-by-pixel. In WinForms that would be an easy solution - create a ...