Ejemplo n.º 1
0
        public override void BindCellContent(FrameworkElement cellContent, DataGridRow row)
        {
            System.Windows.Controls.TextBlock textBlock = (System.Windows.Controls.TextBlock)cellContent;

            if (Binding == null)
            {
                textBlock.ClearValue(System.Windows.Controls.TextBlock.TextProperty);
                return;
            }

            textBlock.HorizontalAlignment = base.HorizontalAlignment;
            textBlock.VerticalAlignment   = base.VerticalAlignment;
            textBlock.TextWrapping        = TextWrapping;
            textBlock.TextTrimming        = TextTrimming;
            textBlock.Margin = new Thickness(4, 4, 4, 4);
            if (FlowDirection != null)
            {
                textBlock.FlowDirection = (FlowDirection)FlowDirection;
            }
            if (Binding != null)
            {
                Binding newBinding = CopyBinding(Binding);
                newBinding.Source = row.DataItem;
                newBinding.Mode   = BindingMode.OneWay;
                textBlock.SetBinding(System.Windows.Controls.TextBlock.TextProperty, newBinding);
            }
        }
Ejemplo n.º 2
0
        private FrameworkElement CreateMessageBoxView(DialogViewModelBase viewModel)
        {
            var textBlock = new System.Windows.Controls.TextBlock();

            textBlock.Margin = new Thickness(4);
            textBlock.SetBinding(System.Windows.Controls.TextBlock.TextProperty, "Message");
            textBlock.TextWrapping = TextWrapping.Wrap;
            return(new Jamiras.Controls.OkCancelView(textBlock));
        }