Archived
1
0
This repository has been archived on 2026-04-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
FoxTube/FoxTube/Controls/ItemsGrid.xaml.cs
T
Michael Gordeev 0d3438d82d Added advert cards
2019-12-05 01:50:54 +03:00

32 lines
738 B
C#

using FoxTube.Controls.Cards;
using FoxTube.Core.Helpers;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace FoxTube.Controls
{
public sealed partial class ItemsGrid : UserControl
{
UIElementCollection Items => grid.Children;
public int ItemsCount => Items.Count;
public ItemsGrid() =>
InitializeComponent();
public void Add(UIElement item)
{
empty.Opacity = 0;
if (!StoreInterop.AdsDisabled && ItemsCount % 5 == 0 && ItemsCount > 0)
Items.Add(new AdvertCard());
Items.Add(item);
}
public void Clear()
{
Items.Clear();
empty.Opacity = 1;
}
}
}