コード例 #1
0
        private static UIElement MakeSpace(RingLabel label)
        {
            var space = new Rectangle();

            BindingOperations.SetBinding(space, FrameworkElement.WidthProperty, new Binding
            {
                Source = label, Path = new PropertyPath("FontSize"), Mode = BindingMode.TwoWay
            });

            BindingOperations.SetBinding(space, FrameworkElement.HeightProperty, new Binding
            {
                Source = label, Path = new PropertyPath("FontSize"), Mode = BindingMode.TwoWay
            });

            return space;
        }
コード例 #2
0
        private static UIElement MakeSpace(RingLabel label)
        {
            var space = new Rectangle();

            BindingOperations.SetBinding(space, FrameworkElement.WidthProperty, new Binding
            {
                Source = label, Path = new PropertyPath("FontSize"), Mode = BindingMode.TwoWay
            });

            BindingOperations.SetBinding(space, FrameworkElement.HeightProperty, new Binding
            {
                Source = label, Path = new PropertyPath("FontSize"), Mode = BindingMode.TwoWay
            });

            return(space);
        }