remove psuedo classes from listboxpreview behavior.
MODIFY
WalletWasabi.Fluent/Behaviors/ListBoxPreviewBehavior.cs
WalletWasabi.Fluent/Behaviors/ListBoxPreviewBehavior.cs
@@ -9,8 +9,6 @@ namespace WalletWasabi.Fluent.Behaviors
{
public class ListBoxPreviewBehavior : DisposingBehavior<ListBox>
{
- private ListBoxItem? _previewControl;
-
/// <summary>
/// Defines the <see cref="PreviewItem"/> property.
/// </summary>
@@ -23,22 +21,6 @@ namespace WalletWasabi.Fluent.Behaviors
set => SetValue(PreviewItemProperty, value);
}
- private void ClearPreviewPseudoClass(ListBoxItem? listBoxItem)
- {
- if (listBoxItem?.Classes is IPseudoClasses pc)
- {
- pc.Remove(":previewitem");
- }
- }
-
- private void AddPreviewPseudoClass(ListBoxItem listBoxItem)
- {
- if (listBoxItem.Classes is IPseudoClasses pc)
- {
- pc.Add(":previewitem");
- }
- }
-
protected override void OnAttached(CompositeDisposable disposables)
{
if (AssociatedObject is null)
@@ -61,7 +43,7 @@ namespace WalletWasabi.Fluent.Behaviors
{
if (listBoxItem.DataContext != PreviewItem)
{
- SetPreviewItem(listBoxItem);
+ PreviewItem = listBoxItem.DataContext;
}
}
else
@@ -72,18 +54,8 @@ namespace WalletWasabi.Fluent.Behaviors
.DisposeWith(disposables);
}
- private void SetPreviewItem(ListBoxItem listBoxItem)
- {
- ClearPreviewPseudoClass(_previewControl);
- _previewControl = listBoxItem;
- PreviewItem = listBoxItem.DataContext;
- AddPreviewPseudoClass(_previewControl);
- }
-
private void ClearPreviewItem()
{
- ClearPreviewPseudoClass(_previewControl);
- _previewControl = null;
PreviewItem = null;
}
}

remove psuedo classes from listboxpreview behavior.