consolidate all repos to one for archive
This commit is contained in:
47
semester_3/uporabniski_vmesniki/MyApp/EditWindow.xaml.cs
Normal file
47
semester_3/uporabniski_vmesniki/MyApp/EditWindow.xaml.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
|
||||
namespace MyApp
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for EditWindow.xaml
|
||||
/// </summary>
|
||||
public partial class EditWindow : Window
|
||||
{
|
||||
ProgramData data;
|
||||
|
||||
internal EditWindow(ProgramData data)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.data = data;
|
||||
this.DataContext = data.SelectedItem;
|
||||
comboBox.ItemsSource = data.GenreList;
|
||||
}
|
||||
|
||||
private void Image_Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dialog = new Microsoft.Win32.OpenFileDialog();
|
||||
//dialog.FileName = "Document"; // Default file name
|
||||
dialog.DefaultExt = "*.*"; // Default file extension
|
||||
dialog.Filter = "Image Files|*.BMP;*.DIB;*.RLE;*.JPG;*.JPEG;*.JPE;*.JFIF;*.GIF;*.TIF;*.TIFF;*.PNG;";
|
||||
|
||||
bool? result = dialog.ShowDialog();
|
||||
if (result == true)
|
||||
{
|
||||
data.SelectedItem.IconSource = dialog.FileName;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if(comboBox.SelectedItem is string s)
|
||||
{
|
||||
data.SelectedItem.Genra = s;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user