Development 110218-1
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using FoxTube.Controls;
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
namespace FoxTube.Classes
|
||||
{
|
||||
public class AdSizeTrigger : StateTriggerBase
|
||||
{
|
||||
private Advert _class;
|
||||
|
||||
public Advert Class
|
||||
{
|
||||
get { return _class; }
|
||||
set
|
||||
{
|
||||
_class = value;
|
||||
SetActive(!_class.OverrideSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -282,7 +282,8 @@ namespace FoxTube
|
||||
if(!purchased)
|
||||
{
|
||||
AdsDisabled = false;
|
||||
NotPurchased.Invoke();
|
||||
if(NotPurchased != null)
|
||||
NotPurchased.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
xmlns:ad="using:Microsoft.Advertising.WinRT.UI"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d">
|
||||
mc:Ignorable="d"
|
||||
xmlns:classes="using:FoxTube.Classes">
|
||||
|
||||
<Grid>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
@@ -13,6 +14,7 @@
|
||||
<VisualState>
|
||||
<VisualState.StateTriggers>
|
||||
<AdaptiveTrigger MinWindowWidth="320"/>
|
||||
<classes:AdSizeTrigger Class="{x:Bind Instance}"/>
|
||||
</VisualState.StateTriggers>
|
||||
|
||||
<VisualState.Setters>
|
||||
@@ -20,10 +22,10 @@
|
||||
<Setter Target="ad.Height" Value="50"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState>
|
||||
<VisualState.StateTriggers>
|
||||
<AdaptiveTrigger MinWindowWidth="640"/>
|
||||
<classes:AdSizeTrigger Class="{x:Bind Instance}"/>
|
||||
</VisualState.StateTriggers>
|
||||
|
||||
<VisualState.Setters>
|
||||
@@ -31,10 +33,10 @@
|
||||
<Setter Target="ad.Height" Value="100"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
|
||||
<VisualState>
|
||||
<VisualState.StateTriggers>
|
||||
<AdaptiveTrigger MinWindowWidth="728"/>
|
||||
<classes:AdSizeTrigger Class="{x:Bind Instance}"/>
|
||||
</VisualState.StateTriggers>
|
||||
|
||||
<VisualState.Setters>
|
||||
@@ -44,9 +46,14 @@
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ad:AdControl Name="ad" ApplicationId="{x:Bind AppId}"
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<ad:AdControl VerticalAlignment="Top"
|
||||
Name="ad" ApplicationId="{x:Bind AppId}"
|
||||
AdUnitId="{x:Bind AdUnitId}"
|
||||
Height="50"
|
||||
Width="300"/>
|
||||
Height="{x:Bind Height}"
|
||||
Width="{x:Bind Width}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
@@ -21,6 +22,12 @@ namespace FoxTube.Controls
|
||||
{
|
||||
public string AdUnitId { get; set; } = "test";
|
||||
public string AppId => "3f83fe91-d6be-434d-a0ae-7351c5a997f1";
|
||||
public bool OverrideSize { get; set; } = false;
|
||||
public Advert Instance => this;
|
||||
|
||||
public int Height { get; set; } = 50;
|
||||
public int Width { get; set; } = 300;
|
||||
|
||||
public Advert()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
|
||||
@@ -96,6 +96,7 @@
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Classes\AdSizeTrigger.cs" />
|
||||
<Compile Include="Classes\Caption.cs" />
|
||||
<Compile Include="Classes\DownloadItemContainer.cs" />
|
||||
<Compile Include="Classes\InboxItem.cs" />
|
||||
@@ -432,7 +433,7 @@
|
||||
<Version>4.3.2</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="YoutubeExplode">
|
||||
<Version>4.4.0</Version>
|
||||
<Version>4.5.1</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="YoutubeExtractor">
|
||||
<Version>0.10.11</Version>
|
||||
|
||||
@@ -93,7 +93,9 @@ namespace FoxTube
|
||||
|
||||
SecretsVault.AuthorizationStateChanged += Vault_AuthorizationStateChanged;
|
||||
SecretsVault.SubscriptionsChanged += SecretsVault_SubscriptionsChanged;
|
||||
SecretsVault.NotPurchased += () => removeAds.Visibility = Visibility.Visible;
|
||||
SecretsVault.CheckAuthorization();
|
||||
SecretsVault.CheckAddons();
|
||||
SetTitleBar();
|
||||
Initialize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user