Ошибка AVLN:0004 Unable to resolve type VideoFile from namespace

Рейтинг: 0Ответов: 0Опубликовано: 11.07.2023

Мужики, всем привет. Пытаюсь разобраться с Avalonia, не могу понять что я делаю не так, у меня в main есть класс VideoFile, у которого есть метод FileName

public class VideoFile
    {
        public string FilePath { get; set; }
        public string FileName { get; set; }
        public List<string> Output { get; set; }

        public VideoFile(string filePath)
        {
            FilePath = filePath;
            FileName = Path.GetFileName(filePath);
            Output = new List<string>();
        }

То есть он берет имя файла и его путь, но на путь можно немного забить, он нужен только для выполнения команды, выводить его не нужно, а вот имя файла нужно.

И я вот не могу понять как avalonia объяснить, что имя файла она должна брать из этого класса.

Ошибка AVLN:0004 Unable to resolve type VideoFile from namespace clr-namespace:avalonvidprocapp, строка 23, позиция 31. Сама строка

<DataTemplate x:DataType="local:VideoFile">

Собственно вот мой код axaml

<Window xmlns="https://github.com/avaloniaui"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:avalonvidprocapp"
    x:Class="avalonvidprocapp.MainWindow"  
    x:CompileBindings="True"
    Title="Video Processing App" Width="800" Height="450">
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <Button x:Name="SelectFolderButton" Content="Select Video Folder" HorizontalAlignment="Left" Margin="150,0,0,0" VerticalAlignment="Center" Width="113"/>
    <TextBox x:Name="VideoFolderTextBox" Margin="306,0,10,0" VerticalAlignment="Center" IsReadOnly="True"/>

    <ItemsControl x:Name="FileItemsControl" Grid.Row="1" Margin="10" VerticalAlignment="Stretch">
        <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapPanel Orientation="Horizontal" />
            </ItemsPanelTemplate>
        </ItemsControl.ItemsPanel>
        <ItemsControl.ItemTemplate>
            <DataTemplate x:DataType="local:VideoFile">
                <Border BorderBrush="Black" BorderThickness="1" Margin="5" Padding="5">
                    <StackPanel>
                        <TextBlock Text="{Binding FileName}" />
                        <ListBox ItemsSource="{Binding Output}" />
                    </StackPanel>
                </Border>
            </DataTemplate>
        </ItemsControl.ItemTemplate>
    </ItemsControl>

    <Button x:Name="SelectFFmpegButton" Content="Select FFprobe" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" Width="98"/>
    <TextBox x:Name="FFmpegTextBox" Grid.Row="2" HorizontalAlignment="Stretch" Margin="150,10,10,10" VerticalAlignment="Bottom" IsReadOnly="True"/>

    <Button x:Name="StartButton" Content="Start" HorizontalAlignment="Right" Margin="10" VerticalAlignment="Bottom"/>
</Grid>

Ответы

Ответов пока нет.