571 questions
0
votes
0
answers
8
views
How to make a button Loss the focus after pressing it in avalonia?
I have the following code
<Window.Styles>
<Style Selector="Button.player_control">
<Setter Property="Background" Value="Transparent"/>
<...
0
votes
0
answers
10
views
Trying to use the graphics composition feature of AvaloniaUI with DirectX 11, but I cannot render my ID3D11Texture2D into Avalonia visual
I created following class and set it as content of the MainWindow.
public class DXControl : Control{
static IDXGIFactory7 DXGIFactory = DXGI.CreateDXGIFactory1<IDXGIFactory7>();
static ...
0
votes
0
answers
38
views
How can I scale an Avalonia.UI App for high DPI Displays?
Yes, 4 years somebody asked the exact same question (Avalonia UI Scaling Issues) but maybe now it's possible to scale an Avalonia ui app. Cause when running my app on a 2.8 K display (Fedora 41 KDE ...
0
votes
0
answers
37
views
How to integrate AvaloniaUI with camera video streams on Linux
I know that using window handles on Linux is very troublesome, so I want to display the yuv12 format stream output by the camera directly. My device is a hikvision camera, which is accessed directly ...
0
votes
1
answer
39
views
Getting stuck at simple Property Binding in Avalonia
I am at the very beginning of a simple application using Avalonia. I just tried to add a simple Data Binding for a List of Objects with one simple string property.
This is what the DataSources Class ...
0
votes
1
answer
37
views
NativeControlHost with SDL2 not capturing keys
I have application that is written with use of Avalonia and I want to embed into it an SLD2 application (the SDL2 application is written in C# with use of the SDL2-CS wrapper).
I used ...
-1
votes
1
answer
36
views
TextBlock in DataTemplate of ListBox not updating when ObservableCollection<T> that is it's source has one of the properties of T updated
I have a ListBox in an Avalonia project that is bound to an ObeservableCollection<MyType> which is grabbed from an EF Core request _myContext.MyTypes.ToObservableCollection(). For the most part ...
0
votes
0
answers
56
views
Material Icons didn‘t show on my Avalonia Project
I add Material.Icons.Avalonia Nuget package to my Avalonia MVVM project,however,when I try to show a icon on my button component,it doesn't work,and nothing showed on my button.
Here are code with ...
0
votes
1
answer
110
views
XOpenDisplay failed when using pkexec to launch Avalonia application with elevated privileges
I'm trying to run an Avalonia application with elevated privileges using pkexec on a Linux system. The command I use is:
pkexec /home/depaula/MyApp/RedundancyServerIHM
However, I'm encountering the ...
0
votes
1
answer
201
views
Change the background color of a focused TextBox to transparent using Avalonia
I've tried to change the Background color of a focused TextBox to transparent in Avalonia.
The Textbox is in a Templated User Control and I want it to be fully transaparent since it's inside a border.
...
0
votes
0
answers
92
views
Making a URL Router in Avalonia C#
Im trying to make a URL router for avalonia. I want this strictly for the browser. I want it to handle URL requests as it should. For example if the user acceses my website like this: https://example....
1
vote
2
answers
99
views
How to embed a LibVLCSharp MediaPlayer inside an Avalonia window?
It seems that LibVLCSharp.Avalonia is rendering the video player on a separate window, which is causing issues for my application.
I am following the example code here, and it works well. However, I ...
0
votes
2
answers
112
views
Creating a dynamic amount of buttons based on a ObservableCollection using AvaloniaUI
I'm trying to create a ScrollViewer and/or ComboBox that contains a dynamic amount of buttons based on an Observable Collection. My current approach creates a dynamic amount of buttons with the ...
0
votes
0
answers
73
views
How to add data validation to the DataGrid's Columns in Avalonia?
I have .Net 8.0 / AvalonuaUI application for editing tables with CommunityToolkit for MVVM.
The configuration of the table is determined at runtime. Therefore, I bind the DataGrid to an object[] ...
0
votes
1
answer
64
views
What is the best practice to bind and manipulate properties on a user control in a view model with ReactiveUI?
Coming from the web world you can easily create reusable components for a myriad of reasons. Many of these reusable components allow you to manipulate data properties given from set from a parent ...
0
votes
1
answer
243
views
Reusable control using AvaloniaUI and CommunityToolkit.Mvvm
I'm currently playing around with Avalonia and want to build reusable controls that can be used at multiple places all over my final application.
To keep it simple, I want a UserControl named ...
1
vote
1
answer
88
views
UI automation of avalonia with pywinauto
i am working on some UI automation, and so far worked with pywinauto to do that, but now i want to automate an application, that used avalonia for its UI and pywinauto doesn't seem to be able to ...
0
votes
0
answers
73
views
Create Persistent dock target in Dock.Avalonia
I am trying to create a UI application with Docking/Floating windows (Kinda like Visual Studio) using C#, Avalonia and the Docking system wieslawsoltes/Dock.
However i cant find a way to make the ...
0
votes
0
answers
133
views
Multi-Page Desktop App in Avalonia giving invalid thread error
im trying to build a desktop app for Mac and Windows, using Avalonia UI. I am now working on adding multiple pages to the app but nothing I do seems to want to work!
I have essentially fully copied ...
1
vote
1
answer
163
views
Custom-shaped and borderless window in Avalonia UI
I need to make a custom window in Avalonia UI, free of any OS decorations (Windows 11 in this case). So far I was able to find a bunch of properties that made the window completely transparent, but ...
0
votes
0
answers
41
views
WinForms ErrorProvider alternative at Avalonia
I'm currently in the process of migrating a Windows Forms application to Avalonia, and I'm struggling to find a suitable replacement for the built-in ErrorProvider control.
In WinForms, the ...
0
votes
1
answer
66
views
Avalonia Treeview Selected Command
I'm trying to get an event to fire when I select a node on a treeview. I'm using a button to capture the command. I've had some ChatGPT help to no avail :-(
<TreeView.ItemTemplate>
...
1
vote
2
answers
158
views
Avalonia: Can't bind to ColumnDefinition.Width
I have in my Avalonia user control a Grid whose column I want to hide when a bool property of my viewmodel (which derives from ReactiveObject) is set true by a viewmodel method (code at bottom). ...
-1
votes
2
answers
126
views
Avalonia UI - ComboBox not working a t runtime
I have a ComboBox definition in my project which "works perfectly well" in the design view. Meaning that on click, the various ComboBoxItems can be seen and selected. However, I do not have ...
1
vote
1
answer
307
views
Implementing Navigation in Avalonia with MVVM Community Toolkit
I'm trying to implement a simple navigation which is just a MainWindow with a ContentPresenter on top of it. Most of the code is autogenerated. I only added a ContentPresenter, bound its content to a ...
3
votes
1
answer
76
views
FluentAvaloniaUI NavigationItem Icon
I'm developing a software in C# using Avalonia (It's the first time I've used it and I still have some difficulty).
I added the FluentAvaloniaUI nuget package for the controls and LucideAvalonia for ...
0
votes
2
answers
136
views
TabControl in avalonia not working as expected
Following is the MainWindowViewModel.cs code :
using System;
using System.Collections.ObjectModel;
using System.Linq;
using CommunityToolkit.Mvvm.ComponentModel;
using Neuroflow.Views;
using Neuroflow....
0
votes
1
answer
79
views
Expander Header Style Alignments
I'm trying to build an expander with the Heading beside the arrow and controls on the right side. Similar to this:
I've attempted on doing this, but there's no real information about how to control ...
1
vote
0
answers
38
views
Avalonia TreeView TreeDataTemplate not working as expected
I'm using this TreeDataTemplate for my treeview where I select the TreeDataTemplate via a datatemplate selector (IDataTemplate). And setting the Itemssource in the TreeDataTemplate declaration. But ...
0
votes
0
answers
95
views
Long term file access on Avalonia cross platform application
I am trying to make an Avalonia cross platform application that lets you pick one or multiple images with a file picker. Once the images are selected, i store the file path into a collection that the ...
0
votes
2
answers
78
views
How to add binding to the button inside DataGrid?
I don't understand how to add binding to the button inside DataGrid. Can you please help me?
What I have:
I can connect any simple button and I can give it some functionality. But when I want to do a ...
0
votes
1
answer
114
views
Input to focused TextBox in Avalonia MVVM app
I am writing and application for a touchscreen, using .NET 8, Avalonia UI and Community toolkit MVVM.
In my view I have three TextBoxes.
I have created a UserControll which is a numpad that will be ...
0
votes
0
answers
57
views
Apply to user control a style using converter with multiple values and value sources
I am working in Avalonia and have a user control (UC) whose IsVisible value I want to bind to properties of both its DataContext and that of the parent control. In the parent control/view I have an ...
0
votes
0
answers
44
views
The problem of memory leakage when closing the window
The essence of my program is to create a window for all screens through the tray. In this case, the main program flow ends when the tray is closed. The bottom line is that when creating and closing a ...
0
votes
1
answer
266
views
Styling Avalonia Slider Conntrol
I would like to style the sizes and colors of Avalonia Slider Control.
Visually it seems to work but it stops the sliding functionailty, I tried to look at the Slider source code to find out how to do ...
0
votes
0
answers
40
views
Does ObservableCollection support cross thread use in Avalonia?
I am a novice to Avalonia. I've encountered with InvalidOperationException and I've found that's because I called ObservableCollection.Add() in another thread.I used Dispatcher.UIThread.Invoke() and ...
2
votes
2
answers
318
views
How to bind multiple controls to a single model value in Avalonia UI MVVM without making the model object contain [ObservableProperty]
When using MVVM Community Toolkit, C#, .NET and Avalonia UI, I find myself making my model objects observable because it solves a recurring problem that I encounter when editing a model value from ...
0
votes
1
answer
250
views
Avalonia DataContext is null in code behind
I have the following application structure:
Views:
MainWindow
MainView
View1
View2
ViewModels:
MainViewModel
MainWindow:
<Window xmlns="https://github.com/avaloniaui"
xmlns:x=&...
-2
votes
1
answer
111
views
Setting DataGrid SelectedItem does not select item in grid
I have an Avalonia DataGrid. ItemSource and SelectedItem are binded in axaml.
After i refresh collection DataGrid loses focus and SelectedItem becomes null.
I want to get selected item back on ...
2
votes
1
answer
245
views
In Avalonia, how do I calculate the size of a text without rendering it?
I'm using Avalonia 11.1 and I'd like to know the size of my TextBlock's content before actually rendering it, so that I can align components properly in one go.
I can't find any ready-to-use function ...
-1
votes
1
answer
114
views
Global keyboard shortcut with windows key on Windows with .NET 8
I am writing an app switcher inspired by Contexts kind of for fun, and got stuck on reacting to a global keyboard shortcut. I am using .NET 8 + Avalonia.
What I got so far:
using System;
using System....
0
votes
0
answers
90
views
How to recursively read folders with Avalonia StorageProvider (Android)
I am letting a user chose a folder on the device through topLevel.StorageProvider.OpenFolderPickerAsync. When the folder gets returned succesfully, i use the following code to try to read all ...
1
vote
1
answer
390
views
How to draw on a canvas in avalonia?
I am learning Avalonia for a small project and I really enjoy it, but I can't find much documentation on drawing in a canvas.
My goal is very simple: to draw a grid on my canvas...
However, every time ...
0
votes
0
answers
204
views
Avalonia Binding not updating
why is my binding not working correctly, its grabbing the value once but never updating
after this.RaisPropertyChanged...
public ScreenViewModel Screen => screen;
public bool SetScreen(...
0
votes
1
answer
86
views
Colors change but without the transition
Latest versions on all (Windows, Avalonia, .NET)
I have a style and I wish to incorporate a transition for changing the foreground color when I hoover over my button.
I'm using :
<Style Selector=&...
0
votes
1
answer
250
views
Avalonia - Changing DataTemplate based on collection values throws ArgumentOutOfRangeException
I'm learning Avalonia and am trying to have an ItemsControl switch between two different DataTemplates based on a property in an ObservableCollection of custom objects.
I have an ObservableCollection&...
0
votes
1
answer
272
views
Avalonia ReactiveUI: How to Refresh UI When ObservableCollection of ViewModels Updates in Parent ViewModel?
I’ve created a parent container called HomeViewModel, which contains an ObservableCollection of two GameViewModel instances. Each GameViewModel corresponds to a specific game and includes a button to ...
0
votes
0
answers
99
views
How to click on the selected row again to unselect it in Avalonia DataGrid?
The default behaviour of a DataGrid is to select when a row is clicked , however I also wish for the row to un-select if it was previously already selected when clicked.
I find the code for WPF,but ...
0
votes
0
answers
70
views
Cannot publish AvaloniaUI app for Android - error NETSDK1084 There is no application host available for the specified RuntimeIdentifier
I try to publish AvaloniaUI app for Android. I create the "Folder" publish profile with the following settings:
Then I click on Publish.
The following error appears:
Error XA1030: The '...
0
votes
0
answers
150
views
Avalonia Background Jobs
How to connect background tasks to Avalonia. Conditionally, I need messages to be uploaded to a file every 5 minutes in my desktop application for windows and linux. I didn't find a question on this ...