C
C#3mo ago
Jason_Bjorn

✅ Avalonia - Can't see anything even though control is styled

I am trying to follow along with this lovely example. https://github.com/AvaloniaUI/Avalonia.Samples/blob/main/src/Avalonia.Samples/CustomControls/RatingControlSample/README.adoc The problem I am having is that the example uses ReactiveUI and I am using the community toolkit, but really that shouldn't matter since there isn't any MVVM going on in my code. I just want to see some stars. For some reason I can see the stars in the resource file
No description
2 Replies
Jason_Bjorn
Jason_BjornOP3mo ago
But I can't see it in the main window when running.
No description
Jason_Bjorn
Jason_BjornOP3mo ago
The main window is super simple so I am not sure how I could've messed that up
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:AvaloniaRatingsControl.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:AvaloniaRatingsControl.Controls"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="AvaloniaRatingsControl.Views.MainWindow"
x:CompileBindings="True"
x:DataType="vm:MainWindowViewModel"
Icon="/Assets/avalonia-logo.ico"
Title="RatingControlSample">


<Design.DataContext>
<vm:MainWindowViewModel />
</Design.DataContext>
<controls:RatingControl NumberOfStars="5" Value="4"/>
</Window>
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:AvaloniaRatingsControl.ViewModels"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="using:AvaloniaRatingsControl.Controls"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="AvaloniaRatingsControl.Views.MainWindow"
x:CompileBindings="True"
x:DataType="vm:MainWindowViewModel"
Icon="/Assets/avalonia-logo.ico"
Title="RatingControlSample">


<Design.DataContext>
<vm:MainWindowViewModel />
</Design.DataContext>
<controls:RatingControl NumberOfStars="5" Value="4"/>
</Window>
Want results from more Discord servers?
Add your server