When I post code, I would like the option to not use wordwrap, but instead show a horizontal scrollbar, like stackoverflow does.
This doesn't look good:
<UserControl x:Class="AttributeTableViewer.AttributeTableView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ui="clr-namespace:AttributeTableViewer"
xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
xmlns:editing="clr-namespace:ArcGIS.Desktop.Editing;assembly=ArcGIS.Desktop.Editing"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
d:DataContext="{Binding Path=ui.AttributeTableViewModel}">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" LastChildFill="True" KeyboardNavigation.TabNavigation="Local">
<TabControl SelectedIndex="{Binding TabControlSelectedIndex, Mode=TwoWay}"
Visibility="{Binding IsVisibleTabControl, Converter={StaticResource BooleanToVisibilityConverter}}"
ItemsSource="{Binding TabItems}">
<TabControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding TableName}" VerticalAlignment="Center" />
<Button Command="{Binding DataContext.TableCloseCommand, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}"
CommandParameter="{Binding TableName}" Margin="20,0,0,0" BorderThickness="0" VerticalAlignment="Center">
<Image Source="Images/Close16.png"/>
</Button>
</StackPanel>
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="testing"/>
<editing:TableControl Grid.Row="1" TableContent="{Binding TableContent}"
RowContextMenu="{Binding RowContextMenu}"
SelectedRowContextMenu="{Binding RowContextMenu}" />
</Grid>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
</DockPanel>
</Grid>
</UserControl>
This is more readable, but a user can't copy and paste:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.