2

In my custom behavior I have created the following dependency property:

public double FontSize
{
    get { return (double)GetValue(FontSizeProperty); }
    set { SetValue(FontSizeProperty, value); }
}

public static readonly DependencyProperty FontSizeProperty = DependencyProperty.Register(
        "FontSize",
        typeof (double),
        typeof (CustomBehavior),
        new PropertyMetadata(11, null));
  1. How to bind value, 'couse In Blend binding button is disabled.
  2. How to show dropdown list of standart font sizes like for Textblock in Text category
ChrisF
  • 134,786
  • 31
  • 255
  • 325
Bobasoft
  • 75
  • 3
  • 9

1 Answers1

0

I don't know if this helps or if you already found the answer but I here it goes for ...

Part 2 of your question:

You first declare an enum of items:

public enum DDItems
{
    Default = 0,
    Item1 = 1,
    Item2 = 2,
    Item3 = 3,
    Item4 = 4,
    Item5 = 5
}

And then you have the dependency property like this:

    public DDItems TextSearchModeABC
    {
        get
        {
            return (DDItems)GetValue(MyItemProperty);
        }
        set
        {
            SetValue(MyItemProperty, value);
        }
    }

    public static readonly DependencyProperty MyItemProperty =
        DependencyProperty.Register("MyItemProperty", typeof(DDItems), typeof(MyControlType), new PropertyMetadata(null));

Hope this helps.

asuciu
  • 1,234
  • 2
  • 21
  • 35