You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
|
2 years ago
|
using System;
|
||
|
|
using Avalonia.Controls;
|
||
|
|
using speedLight.UI.Helpers;
|
||
|
|
using speedLight.UI.Models;
|
||
|
|
using speedLight.UI.ViewModels;
|
||
|
|
|
||
|
|
namespace speedLight.UI.Views;
|
||
|
|
|
||
|
|
public partial class MainWindow : Window
|
||
|
|
{
|
||
|
|
public MainWindow()
|
||
|
|
{
|
||
|
|
InitializeComponent();
|
||
|
|
}
|
||
|
|
|
||
|
|
private void h_FillCmbList()
|
||
|
|
{
|
||
|
|
foreach (Picture picture in ((MainWindowViewModel) DataContext).Pictures.Items)
|
||
|
|
{
|
||
|
|
cmbList.Items.Add(picture);
|
||
|
|
}
|
||
|
|
cmbSpeed.Items.Add("")
|
||
|
|
}
|
||
|
|
|
||
|
|
private void CmbList_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||
|
|
{
|
||
|
|
Picture? obj = (Picture)(cmbList.SelectedValue);
|
||
|
|
if (obj == null) return;
|
||
|
|
((MainWindowViewModel)DataContext).ImageFromWebsite = ImageHelper.LoadFromWeb(new Uri(obj.Url));
|
||
|
|
}
|
||
|
|
|
||
|
|
private void CmbList_OnDropDownOpened(object? sender, EventArgs e)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
private void StyledElement_OnDataContextChanged(object? sender, EventArgs e)
|
||
|
|
{
|
||
|
|
if (cmbList.Items.Count == 0) h_FillCmbList();
|
||
|
|
}
|
||
|
|
|
||
|
|
private void CmbSpeed_OnSelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||
|
|
{
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|