コード例 #1
0
        // ************************************************************************
        private void SetTextWrapping()
        {
            var ribbonButton = this.AssociatedObject as RibbonButton;

            if (ribbonButton != null)
            {
                var ribbonTwoLineText = UiUtility.FindVisualChild <RibbonTwoLineText>(ribbonButton);
                if (ribbonTwoLineText != null)
                {
                    ribbonTwoLineText.LineStackingStrategy = LineStackingStrategy.BlockLineHeight;

                    var binding = new Binding("HasTwoLine");
                    binding.Source = this;
                    binding.Mode   = BindingMode.OneWay;
                    ribbonTwoLineText.SetBinding(RibbonTwoLineText.HasTwoLinesProperty, binding);
                }
            }
        }