41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
|
using CtrEditor.ObjetosSim;
|
||
|
using Ookii.Dialogs.Wpf;
|
||
|
using System.Windows;
|
||
|
using System.Windows.Controls;
|
||
|
using Xceed.Wpf.Toolkit.PropertyGrid;
|
||
|
|
||
|
namespace CtrEditor.Controls
|
||
|
{
|
||
|
public partial class PanelEdicionControl : UserControl
|
||
|
{
|
||
|
public PanelEdicionControl()
|
||
|
{
|
||
|
InitializeComponent();
|
||
|
}
|
||
|
|
||
|
public void CargarPropiedades(osBase selectedObject)
|
||
|
{
|
||
|
UserControlFactory.CargarPropiedadesosDatos(selectedObject, PropertyGridControl);
|
||
|
}
|
||
|
|
||
|
public bool IsKeyboardFocusWithin => PropertyGridControl.IsKeyboardFocusWithin;
|
||
|
|
||
|
private void ImagePathButton_Click(object sender, RoutedEventArgs e)
|
||
|
{
|
||
|
var dlg = new VistaOpenFileDialog
|
||
|
{
|
||
|
Filter = "Image files (*.png;*.jpg;*.bmp)|*.png;*.jpg;*.bmp|All files (*.*)|*.*"
|
||
|
};
|
||
|
|
||
|
if (dlg.ShowDialog() == true)
|
||
|
{
|
||
|
// El DataContext de este botón es el PropertyItem asociado
|
||
|
if ((sender as Button)?.DataContext is PropertyItem propertyItem)
|
||
|
{
|
||
|
propertyItem.Value = dlg.FileName;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|