mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix CardGroup overwriting DataContext of its children
This commit is contained in:
parent
08687d63cb
commit
fb6b1bb518
2 changed files with 3 additions and 3 deletions
|
|
@ -26,6 +26,7 @@
|
|||
</UserControl.Resources>
|
||||
<Border Background="{DynamicResource Color00B}" BorderBrush="{DynamicResource Color03B}" BorderThickness="1"
|
||||
CornerRadius="5">
|
||||
<ItemsControl ItemsSource="{Binding Content}" ItemContainerStyleSelector="{StaticResource CardStyleSelector}" />
|
||||
<ItemsControl ItemsSource="{Binding Content, RelativeSource={RelativeSource AncestorType=cc:CardGroup}}"
|
||||
ItemContainerStyleSelector="{StaticResource CardStyleSelector}" />
|
||||
</Border>
|
||||
</UserControl>
|
||||
|
|
|
|||
|
|
@ -13,13 +13,12 @@ public partial class CardGroup : UserControl
|
|||
set { SetValue(ContentProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ContentProperty =
|
||||
public static new readonly DependencyProperty ContentProperty =
|
||||
DependencyProperty.Register(nameof(Content), typeof(ObservableCollection<Card>), typeof(CardGroup));
|
||||
|
||||
public CardGroup()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
Content = new ObservableCollection<Card>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue