liwuqingxin / Avalonia.Svg

Svg render for Avalonia.
MIT License
17 stars 1 forks source link

missing file? #1

Open lokiofmute opened 11 months ago

lokiofmute commented 11 months ago

hi!

I cloned your project, and I noticed the sample contains a path which is... on your local harddisk. D:\SVGLogos.db

I looked around in your github project - and maybe I am a blind bat who doesn't find his own socks in the drawer ;-) - but I can't seem to find the file.

Would you mind sharing it? Or maybe even change the path to a file that's included in the project, so that it works without crashing.

Thanks! Loki

liwuqingxin commented 11 months ago

@lokiofmute Sorry I have no idea about the file 'SVGLogos.db'. I don't have it on my local hard disk too. Could you please provide the details about the error?

微信截图_20231111195349 微信图片_20231111195618

lokiofmute commented 11 months ago

@lokiofmute Sorry I have no idea about the file 'SVGLogos.db'. I don't have it on my local hard disk too. Could you please provide the details about the error?

It's in your source code of the Svg.Avalonia.Sample, the file MainWindowViewModel.cs tries to load this file..

Have a look at the constructor of that class:

    public MainWindowViewModel()
    {
        this.WhenAnyValue(x => x.SearchText)
        .Throttle(TimeSpan.FromMilliseconds(400))
        .ObserveOn(RxApp.MainThreadScheduler)
        .Subscribe(Search!);

        _iconify = new IconifyViewModel(Path.Combine(Environment.CurrentDirectory, 
                           "Svg.Avalonia.Sample", @"D:\SVGLogos.db"));
        SvgLocadAsync();
    }

The error is... that the file does not exist ;-)

-> you did not seem to provide it along with the Sample project.

It looks like it's some database file with SVG content inside, which is not in the Sample project, thus making it crash.

Kind regards, loki

liwuqingxin commented 11 months ago

You have confused me. I have the project Nlnet.Avalonia.Svg.Sample but Svg.Avalonia.Sample. The file MainWindowViewModel of Nlnet.Avalonia.Svg.Sample is here. Please check it again.


微信图片_20231112174428