From a0e772885cd6672ccd8da5035be52a21fab9af06 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Mon, 18 Nov 2019 17:19:16 -0600 Subject: [PATCH] fix flickering mview hyperlink hover background --- .../Modules/Market/MarketView/MarketViewVM.cs | 1 + .../Market/MarketView/MarketViewView.xaml | 19 ++++++++++--------- .../spark/view/Controls/DIYGrid/DIYGrid.cs | 8 ++++++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/client/spark/Modules/Market/MarketView/MarketViewVM.cs b/src/client/spark/Modules/Market/MarketView/MarketViewVM.cs index 2352b591e..cc3166989 100644 --- a/src/client/spark/Modules/Market/MarketView/MarketViewVM.cs +++ b/src/client/spark/Modules/Market/MarketView/MarketViewVM.cs @@ -268,6 +268,7 @@ namespace mbts.spark { void on_view_generated(HyperlinkCell cell_view) { cell_view.SetValue(ColumnKeyProperty, col_key); cell_view.SetValue(ColumnProperty, col); + cell_view.SetBinding(GridProperty, new Binding { RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(DIYGrid), 1) }); if (tooltip != null) { cell_view.ToolTip = tooltip; } else if (tooltip_binding != null) { diff --git a/src/client/spark/Modules/Market/MarketView/MarketViewView.xaml b/src/client/spark/Modules/Market/MarketView/MarketViewView.xaml index 2d44c491a..99e9e40ef 100644 --- a/src/client/spark/Modules/Market/MarketView/MarketViewView.xaml +++ b/src/client/spark/Modules/Market/MarketView/MarketViewView.xaml @@ -8,7 +8,6 @@ xmlns:c="clr-namespace:mbts.ui.controls" xmlns:cv="clr-namespace:mbts.ui.converters" xmlns:usp="clr-namespace:mbts.ui.spark" - xmlns:sys="clr-namespace:System;assembly=mscorlib" u:WindowStyle.UnsafeWindow="{Binding Path='(u:WindowStyle.UnsafeWindow)', RelativeSource={RelativeSource AncestorType=bv:SparkWindowView}}" FocusManager.IsFocusScope="True" Background="{StaticResource CommonBackground}" @@ -35,14 +34,16 @@ - - - - - - - - + + + + + + + + + + diff --git a/src/client/spark/view/Controls/DIYGrid/DIYGrid.cs b/src/client/spark/view/Controls/DIYGrid/DIYGrid.cs index 118c44e72..ae0108936 100644 --- a/src/client/spark/view/Controls/DIYGrid/DIYGrid.cs +++ b/src/client/spark/view/Controls/DIYGrid/DIYGrid.cs @@ -681,6 +681,14 @@ namespace mbts.ui.controls { } #endregion + #region Grid + public static readonly DependencyProperty GridProperty = + DependencyProperty.RegisterAttached("Grid", typeof(DIYGrid), typeof(DIYGrid)); + + public static DIYGrid GetGrid(DependencyObject d) => d.GetValue(GridProperty) as DIYGrid; + public static void SetGrid(DependencyObject d, DIYGrid value) => d.SetValue(GridProperty, value); + #endregion + #region ColumnKey public static readonly DependencyProperty ColumnKeyProperty = DependencyProperty.RegisterAttached("ColumnKey",