abdul
abdul
CC#
Created by abdul on 12/17/2023 in #help
Avalonia UI: Issue with code generation
Locked down my error. It was the 6th line in ToDoListView.axaml. It was refererring to a type in the wrong namespace. It should have been M2ASCII.Views.ToDoListView instead of M2ASCII.ToDoListView
6 replies
CC#
Created by abdul on 12/17/2023 in #help
Avalonia UI: Issue with code generation
Of course. Here is ToDoListView.axaml:
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="250" d:DesignHeight="450"
x:Class="M2ASCII.ToDoListView">
<DockPanel>
<Button DockPanel.Dock="Bottom"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center">
Add Item
</Button>
<StackPanel>
<CheckBox Margin="4">Walk the dog</CheckBox>
<CheckBox Margin="4">Buy some milk</CheckBox>
</StackPanel>
</DockPanel>
</UserControl>
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="250" d:DesignHeight="450"
x:Class="M2ASCII.ToDoListView">
<DockPanel>
<Button DockPanel.Dock="Bottom"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Center">
Add Item
</Button>
<StackPanel>
<CheckBox Margin="4">Walk the dog</CheckBox>
<CheckBox Margin="4">Buy some milk</CheckBox>
</StackPanel>
</DockPanel>
</UserControl>
And here is ToDoListView.axaml.cs:
using Avalonia.Controls;

namespace M2ASCII.Views;

public partial class ToDoListView : UserControl
{
public ToDoListView()
{
InitializeComponent();
}
}
using Avalonia.Controls;

namespace M2ASCII.Views;

public partial class ToDoListView : UserControl
{
public ToDoListView()
{
InitializeComponent();
}
}
6 replies