42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Dialogs.Internal;
|
|
using Avalonia.Markup.Xaml;
|
|
using Avalonia.Platform.Storage;
|
|
using Avalonia.ReactiveUI;
|
|
using demo_trade.ViewModels;
|
|
using ReactiveUI;
|
|
using System.Collections.Generic;
|
|
using Tmds.DBus.Protocol;
|
|
|
|
namespace demo_trade;
|
|
|
|
public partial class OrderShowDialog : ReactiveWindow<OrderShowDialogViewModel>
|
|
{
|
|
public OrderShowDialog()
|
|
{
|
|
this.WhenActivated(disposables => { });
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
private void NumericUpDown_ValueChanged(object? sender, Avalonia.Controls.NumericUpDownValueChangedEventArgs e)
|
|
{
|
|
var numeric = (sender as NumericUpDown);
|
|
if (numeric.Tag == null) return;
|
|
string? aritcle = numeric.Tag.ToString();
|
|
if (numeric.Value == null) return;
|
|
ViewModel.NumericChange(aritcle, (int)numeric.Value );
|
|
}
|
|
|
|
private static FilePickerFileType Pdf { get; } = new FilePickerFileType("All pdf") { Patterns = new[] { ".pdf" } };
|
|
|
|
private async void Save_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
|
|
{
|
|
var file = await TopLevel.GetTopLevel(this).StorageProvider.SaveFilePickerAsync(new Avalonia.Platform.Storage.FilePickerSaveOptions
|
|
{
|
|
Title = "Ñîõðàíèòü òàëîí",
|
|
FileTypeChoices = new List<FilePickerFileType> { Pdf }
|
|
});
|
|
if (file != null) ViewModel!.SaveFile(file.Path.AbsolutePath);
|
|
}
|
|
} |