36 lines
1.2 KiB
C#
36 lines
1.2 KiB
C#
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Markup.Xaml;
|
|
using Avalonia.ReactiveUI;
|
|
using demo_trade.ViewModels;
|
|
using ReactiveUI;
|
|
|
|
namespace demo_trade;
|
|
|
|
public partial class OrderManagerControl : ReactiveUserControl<OrderManagerViewModel>
|
|
{
|
|
public OrderManagerControl()
|
|
{
|
|
this.WhenActivated(disposables => { });
|
|
AvaloniaXamlLoader.Load(this);
|
|
}
|
|
|
|
private void DeliveryDatePicker_SelectedDateChanged(object? sender, Avalonia.Controls.DatePickerSelectedValueChangedEventArgs e)
|
|
{
|
|
var datePicker = (DatePicker)sender;
|
|
int? orderId = datePicker.Tag as int?;
|
|
if (orderId != null && datePicker.SelectedDate != null && datePicker.IsEnabled) {
|
|
ViewModel.OrderDateChanged(orderId.Value, datePicker.SelectedDate.Value);
|
|
}
|
|
}
|
|
|
|
private void StatusComboBox_SelectionChanged(object? sender, Avalonia.Controls.SelectionChangedEventArgs e)
|
|
{
|
|
var comboBox = (ComboBox)sender;
|
|
int? orderId = comboBox.Tag as int?;
|
|
if (orderId != null && comboBox.SelectedIndex > 0 && comboBox.IsEnabled)
|
|
{
|
|
ViewModel.OrderStatusChanged(orderId.Value, comboBox.SelectedIndex);
|
|
}
|
|
}
|
|
} |