DIYGrid - adding dep prop to allow rows horizontal scrollbar to be strictly collapsed

This commit is contained in:
Jake Norbut committed 2019-01-22 12:23:00 -06:00
1 parent 3c82327f1a
commit dcbc6e756e
3 files changed
+11 -1

No files matched your search

@@ -76,6 +76,7 @@
RowStyle="{StaticResource {x:Static sp:OrderBookView.RowStyleKey}}"
RowTemplate="{StaticResource {x:Static sp:OrderBookView.RowTemplateKey}}"
SelectionHighlight="{Binding grid_settings_manager.selection_highlight, Mode=OneWay}"
RowsHorizontalScrollBarVisibility="Collapsed"
>
<c:DIYGrid.Resources>
<ResourceDictionary>
@@ -139,6 +139,7 @@ namespace mbts.ui.controls {
public static readonly Thickness
DefaultCellPadding = new Thickness(4, 2, 4, 2),
AnimatableCellPadding = new Thickness(8, 2, 4, 2);
public static readonly Visibility DefaultRowsHorizontalScrollBarVisibility = Visibility.Visible;
#region RoutedCommands
public static readonly RoutedCommand SortCommand = new RoutedCommand(), DefaultRowCommand = new RoutedCommand();
@@ -695,6 +696,14 @@ namespace mbts.ui.controls {
public static readonly DependencyProperty SelectionModeProperty = ListBox.SelectionModeProperty.AddOwner(typeof(DIYGrid));
public Visibility RowsHorizontalScrollBarVisibility {
get { return (Visibility)GetValue(RowsHorizontalScrollBarVisibilityProperty); }
set { SetValue(RowsHorizontalScrollBarVisibilityProperty, value); }
}
public static readonly DependencyProperty RowsHorizontalScrollBarVisibilityProperty = DependencyProperty.Register(
nameof(RowsHorizontalScrollBarVisibility), typeof(Visibility), typeof(DIYGrid), new PropertyMetadata(DefaultRowsHorizontalScrollBarVisibility));
#endregion
// Internal Methods
@@ -332,7 +332,7 @@
</ControlTemplate>
</bts:DIYGridRowsPresenter.Template>
</bts:DIYGridRowsPresenter>
<ScrollBar Grid.Row="3" Grid.Column="1" Orientation="Horizontal" LargeChange="10" x:Name="_scroll_horiz" />
<ScrollBar Grid.Row="3" Grid.Column="1" Orientation="Horizontal" LargeChange="10" x:Name="_scroll_horiz" Visibility="{TemplateBinding RowsHorizontalScrollBarVisibility}" />
<!-- todo: All edit controls go in a canvas - edit api is called with an edit type. Hide all controls -->
<!-- This stole hours of my life. The Text binding down there used to be 'value' and I was encountering -->