2026-03-30 17:09:29 +09:00

69 lines
2.2 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace VisionCommonUI {
/// <summary>
/// Interaction logic for UCContentComboBox.xaml
/// </summary>
[ContentProperty("InnerContent")]
public partial class UCContentComboBox : UserControl {
public static Type _classType = typeof(UCContentComboBox);
public static readonly DependencyProperty InnerContentProperty
= DependencyProperty.Register(
nameof(InnerContent),
typeof(FrameworkElement),
_classType);
public FrameworkElement InnerContent {
get { return (FrameworkElement)GetValue(InnerContentProperty); }
set { SetValue(InnerContentProperty, value); }
}
public static readonly DependencyProperty ItemsSourceProperty
= DependencyProperty.Register(
nameof(ItemsSource),
typeof(IEnumerable),
_classType);
public IEnumerable ItemsSource {
get { return (IEnumerable)GetValue(ItemsSourceProperty); }
set { SetValue(ItemsSourceProperty, value); }
}
public static readonly DependencyProperty SelectedItemProperty
= DependencyProperty.Register(
nameof(SelectedItem),
typeof(object),
_classType,
new FrameworkPropertyMetadata(
null,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault
));
public object SelectedItem {
get { return (object)GetValue(SelectedItemProperty); }
set { SetValue(SelectedItemProperty, value); }
}
public UCContentComboBox() {
InitializeComponent();
DataContext = this;
}
}
}