- plugin zeile geeändert um user eingabe zu nutzen - ftp geändert für schnelleres testen der verbindung und nutzen der user eingabe - function erweitert bei ftp daten in globale variable zu speichern -> addvar, editvar - FTP Ordner aufrufen und zurück funktion hinzugefügt / fehler behoben
50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Reactive;
|
|
using System.Reactive.Disposables;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Markup.Xaml;
|
|
using Avalonia.ReactiveUI;
|
|
using KeyAuth;
|
|
using ReactiveUI;
|
|
using Valheim_Dashboard.ViewModels;
|
|
|
|
namespace Valheim_Dashboard.Views;
|
|
|
|
public partial class FtpView : ReactiveUserControl<FtpViewModel>
|
|
{
|
|
public FtpView()
|
|
{
|
|
|
|
InitializeComponent();
|
|
//DataContext = new FtpViewModel();
|
|
|
|
// Aktivierungslogik für Bindings
|
|
this.WhenActivated(disposables =>
|
|
{
|
|
// Binde den aktuellen Pfad an die TextBox
|
|
this.OneWayBind(ViewModel, vm => vm.CurrentPath, v => v.CurrentPathTextBox_.Text)
|
|
.DisposeWith(disposables);
|
|
|
|
// Konvertiere die ObservableCollection<string> zu IEnumerable<object>
|
|
this.OneWayBind(ViewModel, vm => vm.Files, v => v.FtpFileList_.ItemsSource)
|
|
.DisposeWith(disposables);
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
private TextBox CurrentPathTextBox_ => this.FindControl<TextBox>("CurrentPathTextBox");
|
|
private ListBox FtpFileList_ => this.FindControl<ListBox>("FtpFileList");
|
|
} |