466 questions
2
votes
1
answer
43
views
Can't get TextBlock to fill the ComboBoxItem in Avalonia
The ItemTemplate for my ComboBox is like this:
new FuncDataTemplate(
typeof(object),
(item, _) => new TextBlock
{
HorizontalAlignment = HorizontalAlignment.Stretch,
Text ...
1
vote
0
answers
55
views
How to preload a TrayIcon's NativeMenu instance in Avalonia
How can I pre-load a NativeMenu instance on a TrayIcon?
Here's a code sample I have tried running (I ran it after the MainWindow got instantiated):
_trayIcon = new TrayIcon
{
Icon = new WindowIcon(...
0
votes
0
answers
58
views
Trying to style an Avalonia Expander Control
I'm trying to style an Avalonia Expander control but I'm unable to fully figure out how to style the header. My main difficulty is styling the chevron button. I'm not sure quite what you call it, but ...
0
votes
1
answer
64
views
How to specify bound property of known name for Avalonia control created in code-behind?
In my Avalonia app, I need to create controls dynamically from a user control's code-behind so I can add them to a StackPanel inside that user control. I know the names of the viewmodel properties to ...
0
votes
1
answer
115
views
Confused about Brushes
So I had this big question about how to change the color of a XAML element from the C# code directly but I managed to stumble upon a solution that works in this question by using SolidColorBrush() to ...
-1
votes
1
answer
59
views
Avalonia DataGridCell not refreshed when using CellStyle
If I set a right-align style for my DataGridCell :
<Style Selector="DataGridCell.right-align">
<Setter Property="HorizontalAlignment" Value="Right" />
&...
0
votes
1
answer
133
views
Overlay Window with transparent click-through background
I want to create a companion app for a video game. Windows only. It's supposed to be always on top and act as an additional UI element. I want to do it w/ Avalonia.
so that means: no obvious window: ...
0
votes
0
answers
135
views
Initializing Mini Apps in C# WASM app with Avalonia.Browser
In Telegram docs, https://core.telegram.org/bots/webapps#initializing-mini-apps,
To connect your Mini App to the Telegram client, place the script telegram-web-app.js in the <head> tag before ...
1
vote
0
answers
59
views
Detecting theme change for XAML-based update
In my AvaloniaUI application I have a user control that's basically a PathIcon with a TextBlock caption, the contents of which are bound to dependency properties. One DP is IsActive, which when true ...
2
votes
1
answer
168
views
Custom Calendar Date Picker in Avalonia in JetBrains Rider
I am building a custom Calendar Date Picker in Avalonia in JetBrains Rider. Unable to modify the calendar popout. I need to remove the empty space on the right hand side.
Here is the code.
<Style ...
0
votes
1
answer
162
views
Property not updating view when getting changed from another VM
I am using Avalonia with CommunityToolkit MVVM. When I change the Property (integer) within the original VM, where it is defined, it does update the view. When I change the Property from a child class,...
0
votes
0
answers
32
views
I can't load image in Avalonia in radiobutton
I want to create my own style for a radio button in Avalonia, but when I want to set an image using a binding, the image doesn't load. If I try to load the image directly as an image source, it works.
...
0
votes
0
answers
98
views
Showing AutocompleteBox dropdown when textbox is empty
I'm using Avalonia 11.0 and I need to accomplish the following behaviour on a custom Autocompletebox control:
If the input text is empty the dialog should show all the items of the collection the ...
-1
votes
2
answers
203
views
Avalonia Binding property to custom control cast to other type and throw exception [closed]
I have Custom control, looking like this:
using Avalonia;
using Avalonia.Controls;
using Client.Attributes;
using Client.ViewModels;
namespace Client.Controls;
[ViewModel(typeof(...
0
votes
0
answers
75
views
Vertically align an Avalonia CheckBox square/tick box with its contents
I'm trying to vertically align the square/tick box of an Avalonia CheckBox within its contents automatically, but apparently it's not that trivial for some reason. Here's the code:
<UserControl .......
1
vote
1
answer
100
views
Isn't visible of Path in Template Control in Avalonia
I want to design a template control of button in my project. The AXAML markup and C# code are:
<Styles
xmlns="https://github.com/avaloniaui"
xmlns:controls="using:...
0
votes
0
answers
56
views
How to align multiple lines of text in Avalonia UI using variable-width font (Segoe UI)
I'm currently developing a macOS application using Avalonia.
This application displays information in the UI (specifically in a TextBlock with ViewModel), and at the same time, it writes the same ...
0
votes
0
answers
57
views
How to animate a Border with its content, plus ComboBox (including dropdown)?
So I found this button animation trick on StackOverflow:
<Button.Styles>
<Style Selector="Button">
<Setter Property="FontSize" Value="14" />
...
0
votes
0
answers
46
views
Unauthorized Access to file on Desktop in Avalonia app on macOS
We've got a macOS Avalonia problem when trying to package multiple builds for different cpu architectures in the same macOS .app bundle.
We are attempting to place the entire x64 and arm64 build ...
0
votes
1
answer
352
views
How to style Avalonia TabStrip - specifically :pointerover and the tab strip height
I'm having a little bit of trouble with an Avalonia TabStrip. I want to style it without tab headers, the background color from a bound value and not too high.
The whole idea is that this tab strip ...
2
votes
0
answers
215
views
Why can't I run Android and iOS versions of the Avalonia UI app on Fedora Linux?
I set up Fedora Linux with the KDE desktop environment and installed Rider. I also downloaded the necessary templates and plugins. After that, I created a cross-platform Avalonia UI app in Rider, but ...
0
votes
0
answers
34
views
MacOS App getting different behavior once packaged
I have this C# console application that I have built a GUI around using Avalonia. When debugging using JetBrains Rider, I get my expected behavior from the app where it calls a Python script using zsh....
0
votes
0
answers
35
views
Display UI tests while testsing
I have a simple app that contains a button, and the content of that button changes after it is pressed (Avalonia for app and Avalonia Headless Tests for UI tests). I'm trying to make my UI tests ...
0
votes
1
answer
96
views
How to plot histogram without gaps?
I'm trying to plot a Histogram in Avalonia with C# using Livecharts2. However some empty space occurs between the columns.
How to avoid this empty space between columns?
For example in two column ...
0
votes
0
answers
53
views
Avalonia/WPF Passing a Router into a ControlTemplate
Long story short, I have an Avalonia project where I'm using the SimpleRouter library to achieve routing. The code is very similar to the full code example, using a ServiceCollection and I can access ...