コード例 #1
0
        public static void EnumAdded(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            object value = d.GetValue(EnumBindingProperty);

            bindedValue = value;
            dictionary  = EnumDataSource.GetLocalizedValues(value.GetType());
        }
コード例 #2
0
        public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
        {
            if (UseLocalizedValues)
            {
                this.DisplayMemberPath       = "Value";
                this.SelectedValueMemberPath = "Value";
                ItemsSourceBinding           = new Binding()
                {
                    Source = EnumDataSource.GetLocalizedValues(DataType)
                };
            }
            else
            {
                ItemsSource = EnumDataSource.GetAvailableValues(DataType);
            }

            return(base.CreateCellElement(cell, dataItem));
        }