diff --git a/Install/CardIdleRemastered.exe b/Install/CardIdleRemastered.exe index 2241fa0..cc069b3 100644 Binary files a/Install/CardIdleRemastered.exe and b/Install/CardIdleRemastered.exe differ diff --git a/Install/ru-Ru/CardIdleRemastered.resources.dll b/Install/ru-Ru/CardIdleRemastered.resources.dll index 8e0a9a2..a990df9 100644 Binary files a/Install/ru-Ru/CardIdleRemastered.resources.dll and b/Install/ru-Ru/CardIdleRemastered.resources.dll differ diff --git a/README.md b/README.md index 149288f..eb1e4b8 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ OS Windows 7 and higher .Net Framework 4.5 +Stable Internet connection + You should be logged into your Steam account via Steam client to start idling. --- diff --git a/SourceCode/CardIdleRemastered/AccountModel.cs b/SourceCode/CardIdleRemastered/AccountModel.cs index f5cf994..fd29d24 100644 --- a/SourceCode/CardIdleRemastered/AccountModel.cs +++ b/SourceCode/CardIdleRemastered/AccountModel.cs @@ -12,6 +12,7 @@ using System.Windows.Data; using System.Windows.Input; using System.Windows.Threading; +using CardIdleRemastered.Converters; using CardIdleRemastered.Commands; using CardIdleRemastered.ViewModels; @@ -21,6 +22,7 @@ public class AccountModel : ObservableModel, IDisposable { #region Fields private readonly AccountUpdater _updater; + private readonly PricesUpdater _pricesUpdater; private readonly IdleManager _idler; private readonly ShowcaseManager _showcaseManager; @@ -36,6 +38,7 @@ public class AccountModel : ObservableModel, IDisposable private bool _isAuthorized; private bool _showInTaskbar = true; + private bool _showBackground = true; private int _activeProcessCount; private int _totalCards; private int _totalGames; @@ -59,7 +62,8 @@ public class AccountModel : ObservableModel, IDisposable public AccountModel() { - _updater = new AccountUpdater(this); + _pricesUpdater = new PricesUpdater(); + _updater = new AccountUpdater(this, _pricesUpdater); _idler = new IdleManager(this); _showcaseManager = new ShowcaseManager(); _updater.BadgeListSync += SyncShowcases; @@ -165,6 +169,17 @@ public bool ShowInTaskbar } } + public bool ShowBackground + { + get { return _showBackground; } + set + { + _showBackground = value; + OnPropertyChanged(); + OnPropertyChanged("BackgroundUrl"); + } + } + public IdleManager Idler { get { return _idler; } @@ -206,6 +221,8 @@ public string BackgroundUrl { get { + if (false == ShowBackground) + return null; if (String.IsNullOrWhiteSpace(_customBackgroundUrl) == false) return _customBackgroundUrl; return _backgroundUrl; @@ -292,24 +309,6 @@ public string SyncTime #endregion - /// <summary> - /// Initialize timer to regularly check Steam client status - /// </summary> - public void InitSteamTimer() - { - _tmSteamStatus = new DispatcherTimer(); - _tmSteamStatus.Interval = new TimeSpan(0, 0, 5); - bool steamRunning = false; - _tmSteamStatus.Tick += (sender, args) => - { - bool connected = IsSteamRunning; - if (steamRunning != connected) - OnPropertyChanged("IsSteamRunning"); - steamRunning = connected; - }; - _tmSteamStatus.Start(); - } - public void AddBadge(BadgeModel badge) { AllBadges.Add(badge); @@ -388,6 +387,54 @@ public async void LoadCardIdleProfile() CardIdleProfile = await new SteamParser().LoadCardIdleProfileAsync(); } + public FileStorage PricesStorage + { + get { return _pricesUpdater.Storage; } + set { _pricesUpdater.Storage = value; } + } + + public void Startup() + { + InitSteamTimer(); + CheckLatestRelease(); + LoadCardIdleProfile(); + DownloadPricesCatalog(); + LoadAccount(); + } + + /// <summary> + /// Initialize timer to regularly check Steam client status + /// </summary> + public void InitSteamTimer() + { + _tmSteamStatus = new DispatcherTimer(); + _tmSteamStatus.Interval = new TimeSpan(0, 0, 5); + bool steamRunning = false; + _tmSteamStatus.Tick += (sender, args) => + { + bool connected = IsSteamRunning; + if (steamRunning != connected) + OnPropertyChanged("IsSteamRunning"); + steamRunning = connected; + }; + _tmSteamStatus.Start(); + } + + public async void DownloadPricesCatalog() + { + var dt = DateTime.Today; + int dayNum = dt.Year * 10000 + dt.Month * 100 + dt.Day; + if (dayNum > Storage.PricesCatalogDate) + { + bool success = await _pricesUpdater.DownloadCatalog(); + if (success) + { + Storage.PricesCatalogDate = dayNum; + Storage.Save(); + } + } + } + /// <summary> /// Load account when application starts /// </summary> @@ -400,7 +447,7 @@ public async void LoadAccount() Level = Storage.SteamLevel; AvatarUrl = Storage.SteamAvatarUrl; - CustomBackgroundUrl = Storage.CustomBackgroundUrl; + BackgroundUrl = Storage.SteamBackgroundUrl; FavoriteBadge = new BadgeLevelData @@ -410,6 +457,7 @@ public async void LoadAccount() }; } + CustomBackgroundUrl = Storage.CustomBackgroundUrl; BadgePropertiesFilters.Deserialize<BadgeProperty>(Storage.BadgeFilter); ShowcasePropertiesFilters.Deserialize<ShowcaseProperty>(Storage.ShowcaseFilter); @@ -434,6 +482,7 @@ public async void LoadAccount() AllowShowcaseSync = Storage.AllowShowcaseSync; ShowInTaskbar = Storage.ShowInTaskbar; + ShowBackground = Storage.ShowBackground; PropertyChanged += SaveConfiguration; Idler.PropertyChanged += SaveConfiguration; @@ -459,6 +508,7 @@ public async void LoadAccount() foreach (var id in games) { var game = await new SteamParser().GetGameInfo(id); + game.PropertyChanged += BadgeIdleStatusChanged; Games.Insert(idx, game); idx++; } @@ -918,7 +968,7 @@ private void SaveConfiguration(object sender, PropertyChangedEventArgs e) } else if (e.PropertyName == "BackgroundUrl") { - Storage.SteamBackgroundUrl = account.BackgroundUrl ?? string.Empty; + Storage.SteamBackgroundUrl = account._backgroundUrl ?? string.Empty; save = true; } @@ -952,6 +1002,11 @@ private void SaveConfiguration(object sender, PropertyChangedEventArgs e) Storage.ShowInTaskbar = account.ShowInTaskbar; save = true; } + else if (e.PropertyName == "ShowBackground") + { + Storage.ShowBackground = account.ShowBackground; + save = true; + } else if (e.PropertyName == "FavoriteBadge") { if (account.FavoriteBadge != null) diff --git a/SourceCode/CardIdleRemastered/AccountUpdater.cs b/SourceCode/CardIdleRemastered/AccountUpdater.cs index fb50c94..14e6922 100644 --- a/SourceCode/CardIdleRemastered/AccountUpdater.cs +++ b/SourceCode/CardIdleRemastered/AccountUpdater.cs @@ -11,14 +11,16 @@ namespace CardIdleRemastered public class AccountUpdater { private AccountModel _account; + private PricesUpdater _pricesUpdater; private DispatcherTimer _tmSync; private DispatcherTimer _tmCounter; private TimeSpan _interval; private int _counter; - public AccountUpdater(AccountModel account) + public AccountUpdater(AccountModel account, PricesUpdater pricesUpdater) { _account = account; + _pricesUpdater = pricesUpdater; _tmSync = new DispatcherTimer(); _tmSync.Tick += SyncBanges; @@ -135,7 +137,9 @@ private async Task<IEnumerable<BadgeModel>> LoadBadgesAsync() if (badge.RemainingCard > 0) { if (b == null) + { _account.AddBadge(badge); + } else { b.RemainingCard = badge.RemainingCard; @@ -148,6 +152,7 @@ private async Task<IEnumerable<BadgeModel>> LoadBadgesAsync() if (b != null) _account.RemoveBadge(b); } + badge.CardPrice = _pricesUpdater.GetCardPrice(badge.AppId); } _account.UpdateTotalValues(); diff --git a/SourceCode/CardIdleRemastered/App.xaml.cs b/SourceCode/CardIdleRemastered/App.xaml.cs index e6e9992..858e45c 100644 --- a/SourceCode/CardIdleRemastered/App.xaml.cs +++ b/SourceCode/CardIdleRemastered/App.xaml.cs @@ -41,6 +41,7 @@ private void LaunchCardIdle(object sender, StartupEventArgs e) _account = new AccountModel(); _account.Storage = storage; _account.ShowcaseStorage = new FileStorage("ShowcaseDb.txt"); + _account.PricesStorage = new FileStorage(Path.Combine(appFolder, "PricesDb.txt")); Palette = PaletteItemsCollection.Create(); if (storage.AppBrushes != null) @@ -55,10 +56,7 @@ private void LaunchCardIdle(object sender, StartupEventArgs e) var w = new BadgesWindow { DataContext = _account }; w.Show(); - _account.InitSteamTimer(); - _account.CheckLatestRelease(); - _account.LoadCardIdleProfile(); - _account.LoadAccount(); + _account.Startup(); } private void LogTaskSchedulerUnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs arg) diff --git a/SourceCode/CardIdleRemastered/Badges/BadgeIdentity.cs b/SourceCode/CardIdleRemastered/Badges/BadgeIdentity.cs index 63dd4a5..7f49103 100644 --- a/SourceCode/CardIdleRemastered/Badges/BadgeIdentity.cs +++ b/SourceCode/CardIdleRemastered/Badges/BadgeIdentity.cs @@ -5,6 +5,7 @@ namespace CardIdleRemastered public abstract class BadgeIdentity : ObservableModel { private bool _canCraft; + double? _cardPrice; protected BadgeIdentity() { @@ -25,6 +26,16 @@ protected BadgeIdentity(string appId, string title) /// </summary> public string UnlockedBadge { get; set; } + public double? CardPrice + { + get { return _cardPrice; } + set + { + _cardPrice = value; + OnPropertyChanged(); + } + } + /// <summary> /// Indication of a badge which can be crafted /// </summary> diff --git a/SourceCode/CardIdleRemastered/Badges/BadgeStockModel.cs b/SourceCode/CardIdleRemastered/Badges/BadgeStockModel.cs new file mode 100644 index 0000000..30ef671 --- /dev/null +++ b/SourceCode/CardIdleRemastered/Badges/BadgeStockModel.cs @@ -0,0 +1,19 @@ +namespace CardIdleRemastered.Badges +{ + public class BadgeStockModel + { + public string Name { get; set; } + + public string CardRelease { get; set; } + + public int Count { get; set; } + + public double Normal { get; set; } + + public double Foil { get; set; } + + public int NormalStock { get; set; } + + public int FoilStock { get; set; } + } +} diff --git a/SourceCode/CardIdleRemastered/CardIdleRemastered.csproj b/SourceCode/CardIdleRemastered/CardIdleRemastered.csproj index a43ea17..d2336a7 100644 --- a/SourceCode/CardIdleRemastered/CardIdleRemastered.csproj +++ b/SourceCode/CardIdleRemastered/CardIdleRemastered.csproj @@ -67,6 +67,7 @@ <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> + <Reference Include="System.Web.Extensions" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> <Reference Include="System.Core" /> @@ -90,7 +91,10 @@ </ApplicationDefinition> <Compile Include="AccountModel.cs" /> <Compile Include="AccountUpdater.cs" /> + <Compile Include="Badges\BadgeStockModel.cs" /> + <Compile Include="Converters\BooleanToLengthConverter.cs" /> <Compile Include="Info\ProfileInfo.cs" /> + <Compile Include="PricesUpdater.cs" /> <Compile Include="ViewModels\PaletteItemsCollection.cs" /> <Compile Include="ViewModels\PaletteItemVm.cs" /> <Compile Include="Badges\BadgeIdentity.cs" /> @@ -105,6 +109,12 @@ <Compile Include="ShowcaseManager.cs" /> <Compile Include="ViewModels\FilterStatesCollection.cs" /> <Compile Include="ViewModels\SelectionItemVm.cs" /> + <Compile Include="Views\AboutPage.xaml.cs"> + <DependentUpon>AboutPage.xaml</DependentUpon> + </Compile> + <Compile Include="Views\BadgesPage.xaml.cs"> + <DependentUpon>BadgesPage.xaml</DependentUpon> + </Compile> <Compile Include="Views\BadgesWindow.xaml.cs"> <DependentUpon>BadgesWindow.xaml</DependentUpon> </Compile> @@ -130,9 +140,21 @@ <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> </Compile> + <Compile Include="Views\QueuePage.xaml.cs"> + <DependentUpon>QueuePage.xaml</DependentUpon> + </Compile> <Compile Include="Views\SearchPopup.cs" /> <Compile Include="Converters\TranslationConverter.cs" /> <Compile Include="SteamParser.cs" /> + <Compile Include="Views\SettingsPage.xaml.cs"> + <DependentUpon>SettingsPage.xaml</DependentUpon> + </Compile> + <Compile Include="Views\ShowcasesPage.xaml.cs"> + <DependentUpon>ShowcasesPage.xaml</DependentUpon> + </Compile> + <Compile Include="Views\TimeIdlePage.xaml.cs"> + <DependentUpon>TimeIdlePage.xaml</DependentUpon> + </Compile> <Page Include="Themes\Generic.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -141,6 +163,14 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Views\AboutPage.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\BadgesPage.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Views\BadgesWindow.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -165,6 +195,22 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Views\QueuePage.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\SettingsPage.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\ShowcasesPage.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\TimeIdlePage.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> </ItemGroup> <ItemGroup> <Compile Include="Properties\AssemblyInfo.cs"> diff --git a/SourceCode/CardIdleRemastered/Converters/BooleanToLengthConverter.cs b/SourceCode/CardIdleRemastered/Converters/BooleanToLengthConverter.cs new file mode 100644 index 0000000..2b4c955 --- /dev/null +++ b/SourceCode/CardIdleRemastered/Converters/BooleanToLengthConverter.cs @@ -0,0 +1,29 @@ + +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace CardIdleRemastered.Converters +{ + public class BooleanToLengthConverter : IValueConverter + { + private GridLengthConverter lengthConverter = new GridLengthConverter(); + + #region IValueConverter implementation + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if ((value is bool) && (bool)value && parameter != null) + return lengthConverter.ConvertFromInvariantString(parameter.ToString()); + return new GridLength(0); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + #endregion + } +} diff --git a/SourceCode/CardIdleRemastered/Converters/EnumLocalizationConverter.cs b/SourceCode/CardIdleRemastered/Converters/EnumLocalizationConverter.cs index 9e69d13..b113824 100644 --- a/SourceCode/CardIdleRemastered/Converters/EnumLocalizationConverter.cs +++ b/SourceCode/CardIdleRemastered/Converters/EnumLocalizationConverter.cs @@ -1,13 +1,10 @@ using System; -using System.Collections.Generic; using System.Globalization; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Data; using CardIdleRemastered.Properties; -namespace CardIdleRemastered +namespace CardIdleRemastered.Converters { /// <summary> /// Converter provides a frienly name for Enum values from App Resources diff --git a/SourceCode/CardIdleRemastered/Converters/TranslationConverter.cs b/SourceCode/CardIdleRemastered/Converters/TranslationConverter.cs index a63858e..ac51ff2 100644 --- a/SourceCode/CardIdleRemastered/Converters/TranslationConverter.cs +++ b/SourceCode/CardIdleRemastered/Converters/TranslationConverter.cs @@ -1,13 +1,10 @@ using System; -using System.Collections.Generic; using System.Globalization; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Data; using CardIdleRemastered.Properties; -namespace CardIdleRemastered +namespace CardIdleRemastered.Converters { public class TranslationConverter : IValueConverter { diff --git a/SourceCode/CardIdleRemastered/ISettingsStorage.cs b/SourceCode/CardIdleRemastered/ISettingsStorage.cs index 1014a2a..79c9d8b 100644 --- a/SourceCode/CardIdleRemastered/ISettingsStorage.cs +++ b/SourceCode/CardIdleRemastered/ISettingsStorage.cs @@ -32,7 +32,13 @@ public interface ISettingsStorage byte SwitchSeconds { get; set; } bool AllowShowcaseSync { get; set; } + bool ShowInTaskbar { get; set; } + bool ShowBackground { get; set; } + + string Dimensions { get; set; } + + int PricesCatalogDate { get; set; } StringCollection IdleQueue { get; } diff --git a/SourceCode/CardIdleRemastered/IdleManager.cs b/SourceCode/CardIdleRemastered/IdleManager.cs index d70050c..ec36ce5 100644 --- a/SourceCode/CardIdleRemastered/IdleManager.cs +++ b/SourceCode/CardIdleRemastered/IdleManager.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using System.Windows.Threading; +using CardIdleRemastered.Converters; namespace CardIdleRemastered { diff --git a/SourceCode/CardIdleRemastered/PricesUpdater.cs b/SourceCode/CardIdleRemastered/PricesUpdater.cs new file mode 100644 index 0000000..7854c69 --- /dev/null +++ b/SourceCode/CardIdleRemastered/PricesUpdater.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading.Tasks; +using System.Web.Script.Serialization; +using CardIdleRemastered.Badges; + +namespace CardIdleRemastered +{ + public class PricesUpdater + { + private Dictionary<string, BadgeStockModel> _prices; + + public FileStorage Storage { get; set; } + + private Dictionary<string, BadgeStockModel> Prices + { + get + { + if (_prices == null) + { + var values = Storage.ReadContent(); + var js = new JavaScriptSerializer(); + _prices = js.Deserialize<Dictionary<string, BadgeStockModel>>(values); + } + return _prices; + } + } + + public async Task<bool> DownloadCatalog() + { + try + { + string values = await new SteamParser().DownloadString("http://api.steamcardexchange.net/GetBadgePrices.json"); + Storage.WriteContent(values); + _prices = null; + } + catch (Exception ex) + { + Logger.Exception(ex, ""); + return false; + } + return true; + } + + public double? GetCardPrice(string appId) + { + BadgeStockModel badge; + Prices.TryGetValue(appId, out badge); + if (badge != null) + return Math.Round(badge.Normal / badge.Count, 2); + return null; + } + } +} diff --git a/SourceCode/CardIdleRemastered/Properties/AssemblyInfo.cs b/SourceCode/CardIdleRemastered/Properties/AssemblyInfo.cs index f76ee4c..9bfbab5 100644 --- a/SourceCode/CardIdleRemastered/Properties/AssemblyInfo.cs +++ b/SourceCode/CardIdleRemastered/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CardIdleRemastered")] -[assembly: AssemblyCopyright("Copyright © ASh 2017")] +[assembly: AssemblyCopyright("Copyright © ASh 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.4.3.0")] -[assembly: AssemblyFileVersion("2.4.3.0")] +[assembly: AssemblyVersion("2.5.0.0")] +[assembly: AssemblyFileVersion("2.5.0.0")] diff --git a/SourceCode/CardIdleRemastered/Properties/Resources.Designer.cs b/SourceCode/CardIdleRemastered/Properties/Resources.Designer.cs index 735d7ff..85a644e 100644 --- a/SourceCode/CardIdleRemastered/Properties/Resources.Designer.cs +++ b/SourceCode/CardIdleRemastered/Properties/Resources.Designer.cs @@ -250,6 +250,15 @@ public static string CfgPeriodicSwitchRepeatCount { } } + /// <summary> + /// Looks up a localized string similar to Show Background. + /// </summary> + public static string CfgShowBackground { + get { + return ResourceManager.GetString("CfgShowBackground", resourceCulture); + } + } + /// <summary> /// Looks up a localized string similar to Show Icon in TaskBar. /// </summary> diff --git a/SourceCode/CardIdleRemastered/Properties/Resources.resx b/SourceCode/CardIdleRemastered/Properties/Resources.resx index d5fc33b..0722ad2 100644 --- a/SourceCode/CardIdleRemastered/Properties/Resources.resx +++ b/SourceCode/CardIdleRemastered/Properties/Resources.resx @@ -181,6 +181,9 @@ <data name="CfgPeriodicSwitchRepeatCount" xml:space="preserve"> <value>Periodic Switch Repeat Count</value> </data> + <data name="CfgShowBackground" xml:space="preserve"> + <value>Show Background</value> + </data> <data name="CfgShowInTaskBar" xml:space="preserve"> <value>Show Icon in TaskBar</value> </data> diff --git a/SourceCode/CardIdleRemastered/Properties/Resources.ru-Ru.resx b/SourceCode/CardIdleRemastered/Properties/Resources.ru-Ru.resx index f239e01..945e60c 100644 --- a/SourceCode/CardIdleRemastered/Properties/Resources.ru-Ru.resx +++ b/SourceCode/CardIdleRemastered/Properties/Resources.ru-Ru.resx @@ -177,6 +177,9 @@ <data name="CfgPeriodicSwitchRepeatCount" xml:space="preserve"> <value>Повторять переключения (раз)</value> </data> + <data name="CfgShowBackground" xml:space="preserve"> + <value>Показывать фон профиля</value> + </data> <data name="CfgShowInTaskBar" xml:space="preserve"> <value>Отображать в панели задач</value> </data> diff --git a/SourceCode/CardIdleRemastered/SettingsStorage.cs b/SourceCode/CardIdleRemastered/SettingsStorage.cs index df9df8b..ea45aa2 100644 --- a/SourceCode/CardIdleRemastered/SettingsStorage.cs +++ b/SourceCode/CardIdleRemastered/SettingsStorage.cs @@ -37,7 +37,13 @@ public class SettingsStorage : FileStorage, ISettingsStorage public byte SwitchSeconds { get; set; } public bool AllowShowcaseSync { get; set; } + public bool ShowInTaskbar { get; set; } + public bool ShowBackground { get; set; } + + public string Dimensions { get; set; } + + public int PricesCatalogDate { get; set; } public StringCollection IdleQueue { get; private set; } @@ -58,6 +64,7 @@ public void Init() Games = new StringCollection(); ShowInTaskbar = true; + ShowBackground = true; ReadXml(); } @@ -107,6 +114,9 @@ private void ReadXml() AllowShowcaseSync = ReadBool(xml.Element("AllowShowcaseSync")); ShowInTaskbar = ReadBool(xml.Element("ShowInTaskbar"), true); + ShowBackground = ReadBool(xml.Element("ShowBackground"), true); + Dimensions = (string)xml.Element("Dimensions"); + PricesCatalogDate = ReadInt(xml.Element("PricesCatalogDate")); IdleQueue.AddRange(GetStringList(xml.Element("IdleQueue"))); Blacklist.AddRange(GetStringList(xml.Element("Blacklist"))); @@ -184,6 +194,9 @@ private void WriteXml() new XElement("SwitchSeconds", SwitchSeconds), new XElement("AllowShowcaseSync", AllowShowcaseSync), new XElement("ShowInTaskbar", ShowInTaskbar), + new XElement("ShowBackground", ShowBackground), + new XElement("Dimensions", Dimensions), + new XElement("PricesCatalogDate", PricesCatalogDate), new XElement("IdleQueue", String.Join(",", IdleQueue.Cast<string>())), new XElement("Blacklist", String.Join(",", Blacklist.Cast<string>())), new XElement("ShowcaseBookmarks", String.Join(",", ShowcaseBookmarks.Cast<string>())), diff --git a/SourceCode/CardIdleRemastered/ShowcaseManager.cs b/SourceCode/CardIdleRemastered/ShowcaseManager.cs index f06e597..ec7c60e 100644 --- a/SourceCode/CardIdleRemastered/ShowcaseManager.cs +++ b/SourceCode/CardIdleRemastered/ShowcaseManager.cs @@ -70,6 +70,7 @@ private static void UpdateCompletion(BadgeShowcase showcase, BadgeModel badge) showcase.UnlockedBadge = badge.UnlockedBadge; showcase.IsCompleted = badge.UnlockedBadge != null; showcase.CanCraft = badge.CanCraft; + showcase.CardPrice = badge.CardPrice; foreach (var level in showcase.CommonBadges) level.IsCompleted = level.Name == badge.UnlockedBadge; } diff --git a/SourceCode/CardIdleRemastered/Themes/SharedResources.xaml b/SourceCode/CardIdleRemastered/Themes/SharedResources.xaml index ae7df19..29d0966 100644 --- a/SourceCode/CardIdleRemastered/Themes/SharedResources.xaml +++ b/SourceCode/CardIdleRemastered/Themes/SharedResources.xaml @@ -1,10 +1,12 @@ <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:CardIdleRemastered" + xmlns:cvt="clr-namespace:CardIdleRemastered.Converters" xmlns:commands="clr-namespace:CardIdleRemastered.Commands"> - <local:EnumLocalizationConverter x:Key="EnumTranslator" /> - <local:TranslationConverter x:Key="strTranslator" /> + <cvt:EnumLocalizationConverter x:Key="EnumTranslator" /> + <cvt:TranslationConverter x:Key="strTranslator" /> + <cvt:BooleanToLengthConverter x:Key="LengthConverter" /> <commands:NavigationCommand x:Key="Redirect"/> <!-- http://stackoverflow.com/questions/27045396/wpf-datagrid-highlight-selected-row-even-when-selecteditem-is-a-bound-property --> diff --git a/SourceCode/CardIdleRemastered/Views/AboutPage.xaml b/SourceCode/CardIdleRemastered/Views/AboutPage.xaml new file mode 100644 index 0000000..66ee445 --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/AboutPage.xaml @@ -0,0 +1,119 @@ +<UserControl x:Class="CardIdleRemastered.Views.AboutPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:CardIdleRemastered" + mc:Ignorable="d" + d:DesignHeight="480" d:DesignWidth="640" + d:DataContext="{d:DesignInstance Type=local:AccountModel, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Themes/SharedResources.xaml"/> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </UserControl.Resources> + + <Grid Name="LayoutRoot" Background="{StaticResource DarkTheme}" Opacity="0.8"> + <Grid MaxHeight="480" Margin="20"> + <Grid.Resources> + <Style TargetType="RowDefinition"> + <Setter Property="Height" Value="Auto"/> + </Style> + <Style TargetType="TextBlock"> + <Setter Property="HorizontalAlignment" Value="Center"/> + <Setter Property="Foreground" Value="White"/> + </Style> + </Grid.Resources> + <Grid.RowDefinitions> + <RowDefinition /> + <RowDefinition /> + <RowDefinition /> + <RowDefinition Height="*"/> + <RowDefinition /> + <RowDefinition /> + <RowDefinition /> + <RowDefinition Height="*"/> + <RowDefinition /> + <RowDefinition /> + <RowDefinition /> + <RowDefinition Height="*"/> + <RowDefinition /> + <RowDefinition /> + </Grid.RowDefinitions> + <TextBlock> + <Run Text="Card Idle Remastered" Foreground="{StaticResource TitleBrush}"/> + <Run Text="(© ASh)" Foreground="{StaticResource NameBrush}" /> + </TextBlock> + <TextBlock Grid.Row="1" Text="is a WPF remake of"/> + <TextBlock Grid.Row="2"> + <Run Text="Idle Master" Foreground="{StaticResource TitleBrush}"/> + <Run Text="(© jshackles)" Foreground="{StaticResource NameBrush}"/> + </TextBlock> + + <TextBlock Grid.Row="4" Text="Source codes are available on GitHub"/> + <TextBlock Grid.Row="5" Name="LblCardIdle" + Text="https://github.com/AlexanderSharykin/CardIdleRemastered" + Style="{StaticResource Link}"> + <TextBlock.InputBindings> + <MouseBinding Gesture="LeftClick" + Command="{StaticResource Redirect}" + CommandParameter="{Binding ElementName=LblCardIdle, Path=Text}"/> + </TextBlock.InputBindings> + </TextBlock> + <TextBlock Grid.Row="6" Name="LblIm" + Text="https://github.com/jshackles/idle_master" + Style="{StaticResource Link}"> + <TextBlock.InputBindings> + <MouseBinding Gesture="LeftClick" + Command="{StaticResource Redirect}" + CommandParameter="{Binding ElementName=LblIm, Path=Text}"/> + </TextBlock.InputBindings> + </TextBlock> + + <TextBlock Grid.Row="8" Text="Notifications about new releases in my Twitter"/> + <TextBlock Grid.Row="9" Name="LblTwitter" + Text="https://twitter.com/Alex_Sharykin" + Style="{StaticResource Link}"> + <TextBlock.InputBindings> + <MouseBinding Gesture="LeftClick" + Command="{StaticResource Redirect}" + CommandParameter="{Binding ElementName=LblTwitter, Path=Text}"/> + </TextBlock.InputBindings> + </TextBlock> + <TextBlock Grid.Row="10" Name="LblHashtag" + Text="https://twitter.com/hashtag/CardIdleRemastered" + Style="{StaticResource Link}"> + <TextBlock.InputBindings> + <MouseBinding Gesture="LeftClick" + Command="{StaticResource Redirect}" + CommandParameter="{Binding ElementName=LblHashtag, Path=Text}"/> + </TextBlock.InputBindings> + </TextBlock> + + <StackPanel Grid.Row="12"> + <TextBlock> + <Run Text="Showcase data is obtained from"/> + <Run Text="Steam Card Exchange .Net" Foreground="{StaticResource TitleBrush}"/> + </TextBlock> + <TextBlock> + <Run Text="More details in"/> + <Run Text="CardTrades" Foreground="{StaticResource TitleBrush}"/> + <Run Text="Steam group"/> + </TextBlock> + </StackPanel> + + <TextBlock Name="LblSce" Grid.Row="13" + Text="http://steamcommunity.com/groups/card-trading-card-trades" + Style="{StaticResource Link}"> + <TextBlock.InputBindings> + <MouseBinding Gesture="LeftClick" + Command="{StaticResource Redirect}" + CommandParameter="{Binding ElementName=LblSce, Path=Text}"/> + </TextBlock.InputBindings> + </TextBlock> + </Grid> + </Grid> +</UserControl> \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/AboutPage.xaml.cs b/SourceCode/CardIdleRemastered/Views/AboutPage.xaml.cs new file mode 100644 index 0000000..e7da42e --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/AboutPage.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace CardIdleRemastered.Views +{ + /// <summary> + /// Interaction logic for AboutPage.xaml + /// </summary> + public partial class AboutPage : UserControl + { + public AboutPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/BadgesPage.xaml b/SourceCode/CardIdleRemastered/Views/BadgesPage.xaml new file mode 100644 index 0000000..5fd8570 --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/BadgesPage.xaml @@ -0,0 +1,194 @@ +<UserControl x:Class="CardIdleRemastered.Views.BadgesPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:res="clr-namespace:CardIdleRemastered.Properties" + xmlns:local="clr-namespace:CardIdleRemastered" + xmlns:views="clr-namespace:CardIdleRemastered.Views" + mc:Ignorable="d" + d:DesignHeight="480" d:DesignWidth="640" + d:DataContext="{d:DesignInstance Type=local:AccountModel, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Themes/SharedResources.xaml"/> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </UserControl.Resources> + + <Grid Name="LayoutRoot"> + <Grid.RowDefinitions> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <Grid.Resources> + <DataTemplate x:Key="ProgressCell" DataType="{x:Type local:BadgeModel}"> + <Border Background="Transparent" + Cursor="Hand" Padding="4" + BorderBrush="{DynamicResource DynGridHeaders}" BorderThickness="1" + VerticalAlignment="Center"> + <StackPanel> + <TextBlock Text="{Binding Path=BadgeProgress}" + Foreground="Black" + TextWrapping="Wrap" TextAlignment="Center"/> + <TextBlock TextAlignment="Center" Margin="0,2" Foreground="Black"> + <TextBlock.Text> + <MultiBinding StringFormat="{}{0} / {1} "> + <Binding Path="CardsCurrent"/> + <Binding Path="CardsTotal"/> + </MultiBinding> + </TextBlock.Text> + </TextBlock> + </StackPanel> + + <Border.InputBindings> + <MouseBinding Gesture="MiddleClick" + Command="{StaticResource Redirect}" + CommandParameter="{Binding Path=BadgeUrl}" /> + </Border.InputBindings> + </Border> + </DataTemplate> + + <DataTemplate x:Key="IdleCell" DataType="{x:Type local:BadgeModel}"> + <StackPanel Orientation="Vertical" VerticalAlignment="Center"> + <Button Command="{Binding Path=DataContext.StartBadgeIdleCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Content="▷" ToolTip="{x:Static res:Resources.Start}"> + <Button.Style> + <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CmdButton}"> + <Style.Triggers> + <DataTrigger Binding="{Binding Path=HasTrial}" Value="True"> + <Setter Property="Background" Value="Gold"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Button.Style> + </Button> + <Button Command="{Binding Path=DataContext.StopBadgeIdleCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Content="❚❚" + ToolTip="{x:Static res:Resources.Stop}" + Style="{StaticResource CmdButton}" Margin="0,5,0,0"/> + </StackPanel> + </DataTemplate> + + <DataTemplate x:Key="QueueCell" DataType="{x:Type local:BadgeModel}"> + <StackPanel Orientation="Vertical" VerticalAlignment="Center"> + <Button Content="▲" + ToolTip="{x:Static res:Resources.EnqueueFirst}" + Command="{Binding Path=DataContext.EnqueueBadgeHighCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Style="{StaticResource CmdButton}"/> + <Button Content="▼" + ToolTip="{x:Static res:Resources.EnqueueLast}" + Command="{Binding Path=DataContext.EnqueueBadgeLowCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Style="{StaticResource CmdButton}" Margin="0,5,0,0"/> + </StackPanel> + </DataTemplate> + + <DataTemplate x:Key="BlacklistCell" DataType="{x:Type local:BadgeModel}"> + <Button Command="{Binding Path=DataContext.BlacklistBadgeCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Content="⨉"> + <Button.Style> + <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CmdButton}"> + <Style.Triggers> + <DataTrigger Binding="{Binding Path=IsBlacklisted}" Value="True"> + <Setter Property="Background" Value="Black"/> + <Setter Property="Foreground" Value="White"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Button.Style> + </Button> + </DataTemplate> + </Grid.Resources> + + <DataGrid ItemsSource="{Binding Path=Badges}" + CellStyle="{StaticResource GameCellStyle}" + LoadingRow="SetLoadingRowNumber"> + <DataGrid.Columns> + <DataGridTemplateColumn Header="{x:Static res:Resources.Game}" + CellTemplate="{StaticResource GameImgCell}" + Width="Auto" MinWidth="230"/> + <DataGridTextColumn + Header="{x:Static res:Resources.Hours}" Binding="{Binding Path=HoursPlayed}" + IsReadOnly="True" + Width="*" ElementStyle="{StaticResource DataGridText}"/> + <DataGridTextColumn + Header="{x:Static res:Resources.Cards}" Binding="{Binding Path=RemainingCard}" + IsReadOnly="True" + Width="*" ElementStyle="{StaticResource DataGridText}"/> + <DataGridTextColumn + Header="$" Binding="{Binding Path=CardPrice, StringFormat='\{0:0.00}'}" + IsReadOnly="True" + Width="40" ElementStyle="{StaticResource DataGridText}"/> + <DataGridTemplateColumn Header="{x:Static res:Resources.BadgeProgress}" + CellTemplate="{StaticResource ProgressCell}" + Width="*"/> + <DataGridTemplateColumn Header="{x:Static res:Resources.Idle}" CellTemplate="{StaticResource IdleCell}" Width="*"/> + <DataGridTemplateColumn Header="{x:Static res:Resources.QueueHeader}" CellTemplate="{StaticResource QueueCell}" Width="*"/> + <DataGridTemplateColumn Header="{x:Static res:Resources.Blacklist}" CellTemplate="{StaticResource BlacklistCell}" Width="*"/> + </DataGrid.Columns> + </DataGrid> + + <DockPanel Grid.Row="1" Margin="0,4,0,5" + HorizontalAlignment="Stretch"> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Right"> + <Label Content="{x:Static res:Resources.ToolSearch}" Foreground="White"/> + <TextBox Text="{Binding Path=GameTitle, Delay=400, UpdateSourceTrigger=PropertyChanged}" + MinWidth="100" Padding="5,0,5,0" + VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/> + </StackPanel> + + <views:SearchPopup DockPanel.Dock="Left" + Content="{x:Static res:Resources.ToolShow}" + SearchOptions="{Binding Path=BadgePropertiesFilters}" + SearchOptionTemplate="{StaticResource PopupContent}"/> + + <Grid > + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + <Button Content="▲" + Margin="10,0,0,0" + ToolTip="{x:Static res:Resources.EnqueueTop}" + Command="{Binding Path=EnqueueAllCmd}" + VerticalContentAlignment="Stretch" + CommandParameter="0" + HorizontalAlignment="Right" + Style="{StaticResource CmdButton}"/> + <Button Grid.Column="1" Margin="5,0,0,0" + Content="▼" + ToolTip="{x:Static res:Resources.EnqueueBottom}" + Command="{Binding Path=EnqueueAllCmd}" + CommandParameter="1" + Style="{StaticResource CmdButton}" + HorizontalAlignment="Center"> + </Button> + <Button Grid.Column="2" Margin="5,0,0,0" + Content="#" + FontSize="18" + ToolTip="{x:Static res:Resources.DequeueAll}" + Command="{Binding Path=DequeueAllCmd}" + Style="{StaticResource CmdButton}" + HorizontalAlignment="Center"/> + <Button Grid.Column="3" Margin="5,0,0,0" + Content="⟳" + FontSize="18" + ToolTip="{x:Static res:Resources.SyncBadges}" + Command="{Binding Path=ForceSyncCmd}" + Style="{StaticResource CmdButton}" + HorizontalAlignment="Center"/> + </Grid> + </DockPanel> + </Grid> +</UserControl> \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/BadgesPage.xaml.cs b/SourceCode/CardIdleRemastered/Views/BadgesPage.xaml.cs new file mode 100644 index 0000000..ee4572b --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/BadgesPage.xaml.cs @@ -0,0 +1,20 @@ +using System.Windows.Controls; + +namespace CardIdleRemastered.Views +{ + /// <summary> + /// Interaction logic for BadgesPage.xaml + /// </summary> + public partial class BadgesPage : UserControl + { + public BadgesPage() + { + InitializeComponent(); + } + + private void SetLoadingRowNumber(object sender, DataGridRowEventArgs e) + { + e.Row.Header = (e.Row.GetIndex() + 1).ToString(); + } + } +} \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/BadgesWindow.xaml b/SourceCode/CardIdleRemastered/Views/BadgesWindow.xaml index 0bf3426..af86df7 100644 --- a/SourceCode/CardIdleRemastered/Views/BadgesWindow.xaml +++ b/SourceCode/CardIdleRemastered/Views/BadgesWindow.xaml @@ -4,12 +4,11 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:res="clr-namespace:CardIdleRemastered.Properties" - xmlns:loc="clr-namespace:CardIdleRemastered" - xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" + xmlns:loc="clr-namespace:CardIdleRemastered" xmlns:views="clr-namespace:CardIdleRemastered.Views" Title="{Binding CurrentVersion, StringFormat={x:Static res:Resources.Title}}" - Height="Auto" Width="Auto" - WindowStartupLocation="CenterScreen" + Height="Auto" Width="Auto" + WindowStartupLocation="CenterScreen" ShowInTaskbar="{Binding ShowInTaskbar}" Background="{DynamicResource DarkTheme}" mc:Ignorable="d" @@ -27,896 +26,227 @@ <Grid.Background> <ImageBrush ImageSource="{Binding Path=BackgroundUrl}"/> </Grid.Background> - <Grid.RowDefinitions> - <RowDefinition Height="200" /> - <RowDefinition Height="*"/> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="25*"/> - <ColumnDefinition Width="50*"/> - <ColumnDefinition Width="25*"/> - </Grid.ColumnDefinitions> + <Grid Margin="50,0"> + <Grid.RowDefinitions> + <RowDefinition Height="200" /> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="{Binding Path=ShowBackground, Converter={StaticResource LengthConverter}, ConverterParameter='25*'}"/> + <ColumnDefinition Width="50*"/> + <ColumnDefinition Width="{Binding Path=ShowBackground, Converter={StaticResource LengthConverter}, ConverterParameter='25*'}"/> + </Grid.ColumnDefinitions> - <Grid Grid.Row="0" Grid.Column="1" + <Grid Grid.Row="0" Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="-10,0,-10,-10" Background="#324252"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="3*"/> - <ColumnDefinition Width="*"/> - </Grid.ColumnDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="3*"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> - <Border Margin="25" Name="AvatarBorder" + <Border Margin="25" Name="AvatarBorder" HorizontalAlignment="Left" VerticalAlignment="Top"> - <Image Source="{Binding Path=AvatarUrl}" + <Image Source="{Binding Path=AvatarUrl}" MinWidth="10" MinHeight="10" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="UniformToFill"/> - <Border.Style> - <Style TargetType="{x:Type Border}"> - <Setter Property="BorderBrush" Value="White"/> - <Style.Triggers> - <DataTrigger Binding="{Binding Path=IsCardIdleActive}" Value="True"> - <Setter Property="BorderThickness" Value="2"/> - <Setter Property="BorderBrush" Value="LimeGreen"/> - </DataTrigger> - </Style.Triggers> - </Style> - </Border.Style> - </Border> + <Border.Style> + <Style TargetType="{x:Type Border}"> + <Setter Property="BorderBrush" Value="White"/> + <Style.Triggers> + <DataTrigger Binding="{Binding Path=IsCardIdleActive}" Value="True"> + <Setter Property="BorderThickness" Value="2"/> + <Setter Property="BorderBrush" Value="LimeGreen"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + </Border> - <Grid Grid.Row="0" Grid.Column="1" Margin="0,25,0,0" - HorizontalAlignment="Center"> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition/> - <ColumnDefinition Width="Auto"/> - </Grid.ColumnDefinitions> + <Grid Grid.Row="0" Grid.Column="1" Margin="0,25,0,0" + HorizontalAlignment="Left"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition/> + <ColumnDefinition Width="Auto"/> + </Grid.ColumnDefinitions> - <Label Content="{Binding Path=UserName}" + <Label Content="{Binding Path=UserName}" VerticalAlignment="Top" FontSize="24" Foreground="White"/> - <StackPanel Grid.Row="0" Grid.Column="1"> - <Label Content="{x:Static res:Resources.Login}" + <StackPanel Grid.Row="0" Grid.Column="1"> + <Label Content="{x:Static res:Resources.Login}" Background="Transparent" BorderThickness="0" VerticalAlignment="Top" Margin="5" Padding="5"> - <Label.Style> - <Style TargetType="{x:Type Label}"> - <Setter Property="Foreground" Value="White"/> - <Style.Triggers> - <DataTrigger Binding="{Binding IsAuthorized}" Value="True"> - <Setter Property="Visibility" Value="Collapsed"/> - </DataTrigger> - <Trigger Property="IsMouseOver" Value="True"> - <Setter Property="Foreground" Value="Green"/> - </Trigger> - </Style.Triggers> - </Style> - </Label.Style> - <Label.InputBindings> - <MouseBinding Gesture="LeftClick" Command="{Binding Path=LoginCmd}" /> - </Label.InputBindings> - </Label> - - <Label Content="{x:Static res:Resources.Logout}" + <Label.Style> + <Style TargetType="{x:Type Label}"> + <Setter Property="Foreground" Value="White"/> + <Style.Triggers> + <DataTrigger Binding="{Binding IsAuthorized}" Value="True"> + <Setter Property="Visibility" Value="Collapsed"/> + </DataTrigger> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Foreground" Value="Green"/> + </Trigger> + </Style.Triggers> + </Style> + </Label.Style> + <Label.InputBindings> + <MouseBinding Gesture="LeftClick" Command="{Binding Path=LoginCmd}" /> + </Label.InputBindings> + </Label> + + <Label Content="{x:Static res:Resources.Logout}" Background="Transparent" BorderThickness="0" VerticalAlignment="Top" Margin="5" Padding="5"> - <Label.Style> - <Style TargetType="{x:Type Label}"> - <Setter Property="Foreground" Value="White"/> + <Label.Style> + <Style TargetType="{x:Type Label}"> + <Setter Property="Foreground" Value="White"/> + <Style.Triggers> + <DataTrigger Binding="{Binding IsAuthorized}" Value="False"> + <Setter Property="Visibility" Value="Collapsed"/> + </DataTrigger> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Foreground" Value="Red"/> + </Trigger> + </Style.Triggers> + </Style> + </Label.Style> + <Label.InputBindings> + <MouseBinding Gesture="LeftClick" Command="{Binding Path=LogoutCmd}" /> + </Label.InputBindings> + </Label> + </StackPanel> + + <TextBlock Grid.Row="1" Grid.Column="0" Margin="5" + Foreground="{Binding BorderBrush, ElementName=AvatarBorder}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Text" Value="{x:Static res:Resources.NotInGame}"/> <Style.Triggers> - <DataTrigger Binding="{Binding IsAuthorized}" Value="False"> - <Setter Property="Visibility" Value="Collapsed"/> + <DataTrigger Binding="{Binding Path=IsCardIdleActive}" Value="True"> + <Setter Property="Text" > + <Setter.Value> + <Binding Path="ActiveProcessCount" + StringFormat="{x:Static res:Resources.GamesRunning}"/> + </Setter.Value> + </Setter> </DataTrigger> - <Trigger Property="IsMouseOver" Value="True"> - <Setter Property="Foreground" Value="Red"/> - </Trigger> </Style.Triggers> </Style> - </Label.Style> - <Label.InputBindings> - <MouseBinding Gesture="LeftClick" Command="{Binding Path=LogoutCmd}" /> - </Label.InputBindings> - </Label> - </StackPanel> - - <TextBlock Grid.Row="1" Grid.Column="0" Margin="5" - Foreground="{Binding BorderBrush, ElementName=AvatarBorder}"> - <TextBlock.Style> - <Style TargetType="TextBlock"> - <Setter Property="Text" Value="{x:Static res:Resources.NotInGame}"/> - <Style.Triggers> - <DataTrigger Binding="{Binding Path=IsCardIdleActive}" Value="True"> - <Setter Property="Text" > - <Setter.Value> - <Binding Path="ActiveProcessCount" - StringFormat="{x:Static res:Resources.GamesRunning}"/> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </TextBlock.Style> - </TextBlock> - </Grid> + </TextBlock.Style> + </TextBlock> + </Grid> - <StackPanel Grid.Row="0" Grid.Column="2" Margin="0,25,0,0"> - <Label Content="{x:Static res:Resources.SteamLevel}" HorizontalAlignment="Center" + <StackPanel Grid.Row="0" Grid.Column="2" Margin="0,25,15,0" HorizontalAlignment="Right"> + <Label Content="{x:Static res:Resources.SteamLevel}" HorizontalAlignment="Center" FontSize="24" Foreground="White"/> - <Border BorderBrush="{DynamicResource DynLevelBorder}" BorderThickness="2" CornerRadius="18" + <Border BorderBrush="{DynamicResource DynLevelBorder}" BorderThickness="2" CornerRadius="18" HorizontalAlignment="Center" MinWidth="36" MinHeight="36"> - <Label Content="{Binding Path=Level}" HorizontalAlignment="Center" VerticalAlignment="Center" + <Label Content="{Binding Path=Level}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14" Foreground="White"/> - </Border> + </Border> - <Image Width="54" Height="54" Margin="0,15" + <Image Width="54" Height="54" Margin="0,15" Source="{Binding Path=FavoriteBadge.PictureUrl}" ToolTip="{Binding Path=FavoriteBadge.Name}"/> - </StackPanel> + </StackPanel> - <StackPanel Grid.Column="1" Margin="20" + <StackPanel Grid.Column="1" Margin="20" Background="Transparent" Visibility="{Binding Path=CanUpdateApp, Converter={StaticResource BoolToVisible}}" HorizontalAlignment="Center" VerticalAlignment="Bottom"> - <StackPanel.InputBindings> - <MouseBinding Gesture="LeftClick" Command="{StaticResource ResourceKey=Redirect}" + <StackPanel.InputBindings> + <MouseBinding Gesture="LeftClick" Command="{StaticResource ResourceKey=Redirect}" CommandParameter="https://github.com/AlexanderSharykin/CardIdleRemastered/releases"/> - </StackPanel.InputBindings> - <TextBlock Text="{x:Static res:Resources.NewRelease}" + </StackPanel.InputBindings> + <TextBlock Text="{x:Static res:Resources.NewRelease}" Style="{StaticResource LinkNoToolTip}"/> - <TextBlock Text="{Binding Path=NewestRelease.Title, TargetNullValue=?}" + <TextBlock Text="{Binding Path=NewestRelease.Title, TargetNullValue=?}" Style="{StaticResource LinkNoToolTip}"/> - <TextBlock Text="{Binding Path=NewestRelease.Date, TargetNullValue=?}" + <TextBlock Text="{Binding Path=NewestRelease.Date, TargetNullValue=?}" Style="{StaticResource LinkNoToolTip}"/> - <TextBlock Text="{x:Static res:Resources.DownloadRelease}" + <TextBlock Text="{x:Static res:Resources.DownloadRelease}" Style="{StaticResource LinkNoToolTip}"/> - </StackPanel> - </Grid> + </StackPanel> + </Grid> - <TabControl Name="Tabs" Grid.Column="1" Grid.Row="1" Margin="-50,0,0,0" + <TabControl Name="Tabs" Grid.Column="1" Grid.Row="1" Margin="-50,0,0,0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="Transparent" BorderThickness="0" TabStripPlacement="Left"> - <TabItem Header="{x:Static res:Resources.BadgesHeader}" Tag="💳" + <TabItem Header="{x:Static res:Resources.BadgesHeader}" Tag="💳" Visibility="{Binding IsAuthorized, Converter={StaticResource BoolToVisible}}" IsSelected="{Binding IsAuthorized, Mode=OneWay}"> - <TabItem.InputBindings> - <KeyBinding Key="F5" Command="{Binding Path=ForceSyncCmd}"/> - </TabItem.InputBindings> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="*"/> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> - </Grid.RowDefinitions> - <Grid.Resources> - <DataTemplate x:Key="ProgressCell" DataType="{x:Type loc:BadgeModel}"> - <Border Background="Transparent" - Cursor="Hand" Padding="4" - BorderBrush="{DynamicResource DynGridHeaders}" BorderThickness="1" - VerticalAlignment="Center"> - <StackPanel> - <TextBlock Text="{Binding Path=BadgeProgress}" - Foreground="Black" - TextWrapping="Wrap" TextAlignment="Center"/> - <TextBlock TextAlignment="Center" Margin="0,2" Foreground="Black"> - <TextBlock.Text> - <MultiBinding StringFormat="{}{0} / {1} "> - <Binding Path="CardsCurrent"/> - <Binding Path="CardsTotal"/> - </MultiBinding> - </TextBlock.Text> - </TextBlock> - </StackPanel> - - <Border.InputBindings> - <MouseBinding Gesture="MiddleClick" - Command="{StaticResource Redirect}" - CommandParameter="{Binding Path=BadgeUrl}" /> - </Border.InputBindings> - </Border> - </DataTemplate> + <TabItem.InputBindings> + <KeyBinding Key="F5" Command="{Binding Path=ForceSyncCmd}"/> + </TabItem.InputBindings> - <DataTemplate x:Key="IdleCell" DataType="{x:Type loc:BadgeModel}"> - <StackPanel Orientation="Vertical" VerticalAlignment="Center"> - <Button Command="{Binding Path=DataContext.StartBadgeIdleCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Content="▷" ToolTip="{x:Static res:Resources.Start}"> - <Button.Style> - <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CmdButton}"> - <Style.Triggers> - <DataTrigger Binding="{Binding Path=HasTrial}" Value="True"> - <Setter Property="Background" Value="Gold"/> - </DataTrigger> - </Style.Triggers> - </Style> - </Button.Style> - </Button> - <Button Command="{Binding Path=DataContext.StopBadgeIdleCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Content="❚❚" - ToolTip="{x:Static res:Resources.Stop}" - Style="{StaticResource CmdButton}" Margin="0,5,0,0"/> - </StackPanel> - </DataTemplate> + <views:BadgesPage/> + </TabItem> - <DataTemplate x:Key="QueueCell" DataType="{x:Type loc:BadgeModel}"> - <StackPanel Orientation="Vertical" VerticalAlignment="Center"> - <Button Content="▲" - ToolTip="{x:Static res:Resources.EnqueueFirst}" - Command="{Binding Path=DataContext.EnqueueBadgeHighCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Style="{StaticResource CmdButton}"/> - <Button Content="▼" - ToolTip="{x:Static res:Resources.EnqueueLast}" - Command="{Binding Path=DataContext.EnqueueBadgeLowCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Style="{StaticResource CmdButton}" Margin="0,5,0,0"/> - </StackPanel> - </DataTemplate> - - <DataTemplate x:Key="BlacklistCell" DataType="{x:Type loc:BadgeModel}"> - <Button Command="{Binding Path=DataContext.BlacklistBadgeCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Content="⨉"> - <Button.Style> - <Style TargetType="{x:Type Button}" BasedOn="{StaticResource CmdButton}"> - <Style.Triggers> - <DataTrigger Binding="{Binding Path=IsBlacklisted}" Value="True"> - <Setter Property="Background" Value="Black"/> - <Setter Property="Foreground" Value="White"/> - </DataTrigger> - </Style.Triggers> - </Style> - </Button.Style> - </Button> - </DataTemplate> - </Grid.Resources> - - <DataGrid ItemsSource="{Binding Path=Badges}" - CellStyle="{StaticResource GameCellStyle}" - LoadingRow="SetLoadingRowNumber"> - <DataGrid.Columns> - <DataGridTemplateColumn Header="{x:Static res:Resources.Game}" - CellTemplate="{StaticResource GameImgCell}" - Width="Auto"/> - <DataGridTextColumn - Header="{x:Static res:Resources.Hours}" Binding="{Binding Path=HoursPlayed}" - IsReadOnly="True" - Width="*" ElementStyle="{StaticResource DataGridText}"/> - <DataGridTextColumn - Header="{x:Static res:Resources.Cards}" Binding="{Binding Path=RemainingCard}" - IsReadOnly="True" - Width="*" ElementStyle="{StaticResource DataGridText}"/> - <DataGridTemplateColumn Header="{x:Static res:Resources.BadgeProgress}" - CellTemplate="{StaticResource ProgressCell}" - Width="*"/> - <DataGridTemplateColumn Header="{x:Static res:Resources.Idle}" CellTemplate="{StaticResource IdleCell}" Width="*"/> - <DataGridTemplateColumn Header="{x:Static res:Resources.QueueHeader}" CellTemplate="{StaticResource QueueCell}" Width="*"/> - <DataGridTemplateColumn Header="{x:Static res:Resources.Blacklist}" CellTemplate="{StaticResource BlacklistCell}" Width="*"/> - </DataGrid.Columns> - </DataGrid> - - <DockPanel Grid.Row="1" Margin="0,4,0,5" - HorizontalAlignment="Stretch"> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Right"> - <Label Content="{x:Static res:Resources.ToolSearch}" Foreground="White"/> - <TextBox Text="{Binding Path=GameTitle, Delay=400, UpdateSourceTrigger=PropertyChanged}" - MinWidth="100" Padding="5,0,5,0" - VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/> - </StackPanel> - - <views:SearchPopup DockPanel.Dock="Left" - Content="{x:Static res:Resources.ToolShow}" - SearchOptions="{Binding Path=BadgePropertiesFilters}" - SearchOptionTemplate="{StaticResource PopupContent}"/> - - <Grid > - <Grid.ColumnDefinitions> - <ColumnDefinition Width="*"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="*"/> - </Grid.ColumnDefinitions> - <Button Content="▲" - Margin="10,0,0,0" - ToolTip="{x:Static res:Resources.EnqueueTop}" - Command="{Binding Path=EnqueueAllCmd}" - VerticalContentAlignment="Stretch" - CommandParameter="0" - HorizontalAlignment="Right" - Style="{StaticResource CmdButton}"/> - <Button Grid.Column="1" Margin="5,0,0,0" - Content="▼" - ToolTip="{x:Static res:Resources.EnqueueBottom}" - Command="{Binding Path=EnqueueAllCmd}" - CommandParameter="1" - Style="{StaticResource CmdButton}" - HorizontalAlignment="Center"> - </Button> - <Button Grid.Column="2" Margin="5,0,0,0" - Content="#" - FontSize="18" - ToolTip="{x:Static res:Resources.DequeueAll}" - Command="{Binding Path=DequeueAllCmd}" - Style="{StaticResource CmdButton}" - HorizontalAlignment="Center"/> - <Button Grid.Column="3" Margin="5,0,0,0" - Content="⟳" - FontSize="18" - ToolTip="{x:Static res:Resources.SyncBadges}" - Command="{Binding Path=ForceSyncCmd}" - Style="{StaticResource CmdButton}" - HorizontalAlignment="Center"/> - </Grid> - </DockPanel> - </Grid> - </TabItem> - - <TabItem Header="{x:Static res:Resources.QueueHeader}" Tag="☰" + <TabItem Header="{x:Static res:Resources.QueueHeader}" Tag="☰" Visibility="{Binding IsAuthorized, Converter={StaticResource BoolToVisible}}"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="*"/> - <RowDefinition Height="Auto"/> - </Grid.RowDefinitions> - - <DataGrid ItemsSource="{Binding Path=IdleQueueBadges}" - CellStyle="{StaticResource GameCellStyle}" - LoadingRow="SetLoadingRowNumber"> - - <DataGrid.Columns> - <DataGridTemplateColumn Header="{x:Static res:Resources.Game}" - CellTemplate="{StaticResource GameImgCell}" - Width="Auto"/> - <DataGridTextColumn - Header="{x:Static res:Resources.Hours}" Binding="{Binding Path=HoursPlayed}" - IsReadOnly="True" CanUserSort="False" - Width="*" ElementStyle="{StaticResource DataGridText}"/> - <DataGridTextColumn - Header="{x:Static res:Resources.Cards}" Binding="{Binding Path=RemainingCard}" - IsReadOnly="True" CanUserSort="False" - Width="*" ElementStyle="{StaticResource DataGridText}"/> - <DataGridTemplateColumn Header="{x:Static res:Resources.Priority}" Width="*"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <StackPanel Orientation="Vertical" VerticalAlignment="Center"> - <Button Content="▲" - ToolTip="{x:Static res:Resources.PriorityHigher}" - Command="{Binding Path=DataContext.SetHigherPriorityCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Style="{StaticResource CmdButton}"/> - <Button Content="▼" - ToolTip="{x:Static res:Resources.PriorityLower}" - Command="{Binding Path=DataContext.SetLowerPriorityCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Style="{StaticResource CmdButton}" Margin="0,5,0,0"/> - </StackPanel> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="{x:Static res:Resources.DequeueHeader}" Width="*"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Button Command="{Binding Path=DataContext.DequeueBadgeCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Content="#" Style="{StaticResource CmdButton}"/> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - </DataGrid.Columns> - </DataGrid> - - <Grid Grid.Row="1" Margin="0,4,0,5"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="*"/> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="Auto"/> - </Grid.ColumnDefinitions> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> - </Grid.RowDefinitions> - - <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0"> - <Label Content="{x:Static res:Resources.ToolIdleMode}" Foreground="White"/> - <ComboBox - MinWidth="100" - VerticalContentAlignment="Center" - ItemsSource="{Binding Path=Idler.IdleModes}" - SelectedItem="{Binding Path=Idler.Mode, Converter={StaticResource EnumTranslator}}" > - </ComboBox> - </StackPanel> - - <Button Content="{x:Static res:Resources.Start}" - Command ="{Binding IdleCmd}" CommandParameter="1" - Grid.Row="0" Grid.Column="2" - HorizontalAlignment="Right" - Margin="0,0,10,0" Padding="10,4,10,4" - - FontSize="18" - BorderThickness="2" - Background="{DynamicResource DynIdleButtons}" - HorizontalContentAlignment="Center" - VerticalContentAlignment="Center"/> - - <Button Content="{x:Static res:Resources.Stop}" - Command ="{Binding IdleCmd}" CommandParameter="0" - Grid.Row="0" Grid.Column="3" - HorizontalAlignment="Left" - Margin="10,0,0,0" Padding="10,4,10,4" - - FontSize="18" - BorderThickness="2" - Background="{DynamicResource DynIdleButtons}" - HorizontalContentAlignment="Center" - VerticalContentAlignment="Center"/> - </Grid> - </Grid> - </TabItem> + <views:QueuePage/> + </TabItem> - <TabItem Header="{x:Static res:Resources.Showcases}" Tag="💻" + <TabItem Header="{x:Static res:Resources.Showcases}" Tag="💻" Visibility="{Binding IsAuthorized, Converter={StaticResource BoolToVisible}}"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="*"/> - <RowDefinition Height="Auto"/> - </Grid.RowDefinitions> - - <DataGrid Grid.Row="0" - ItemsSource="{Binding Path=AllShowcases}" - VerticalContentAlignment="Stretch" - LoadingRow="SetLoadingRowNumber"> - - <DataGrid.Resources> - <Style TargetType="TextBlock"> - <Setter Property="TextAlignment" Value="Center" /> - <Setter Property="VerticalAlignment" Value="Center" /> - </Style> - </DataGrid.Resources> - - <DataGrid.Columns> - <DataGridTemplateColumn Header="{x:Static res:Resources.Game}" - CellTemplate="{StaticResource GameImgCell}" - Width="Auto"/> - - <DataGridTemplateColumn Header="{x:Static res:Resources.Levels}" Width="*"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Grid> - <Grid.ColumnDefinitions> - <ColumnDefinition/> - <ColumnDefinition Width="Auto"/> - </Grid.ColumnDefinitions> - <ItemsControl ItemsSource="{Binding Path=Levels}" - ItemTemplate="{StaticResource BadgeImageTile}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid Rows="1" Columns="6"/> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - </ItemsControl> - - <Button Grid.Column="1" FontSize="20" ToolTip="{x:Static res:Resources.Bookmark}" - Margin="5,0" - Command="{Binding Path=DataContext.BookmarkShowcaseCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding}"> - <Button.Style> - <Style TargetType="Button" BasedOn="{StaticResource CmdButton}"> - <Setter Property="Content" Value="☆"/> - <Style.Triggers> - <DataTrigger Binding="{Binding Path=IsBookmarked}" Value="True"> - <Setter Property="Background" Value="Gold"/> - <Setter Property="Content" Value="★"/> - </DataTrigger> - </Style.Triggers> - </Style> - </Button.Style> - </Button> - </Grid> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - </DataGrid.Columns> - </DataGrid> - - <DockPanel Grid.Row="1" Margin="0,4,0,5" - HorizontalAlignment="Stretch"> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Right"> - <Label Content="{x:Static res:Resources.ToolSearch}" Foreground="White"/> - <TextBox Text="{Binding Path=ShowcaseTitle, Delay=400, UpdateSourceTrigger=PropertyChanged}" - MinWidth="100" Padding="5,0,5,0" - VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="0,0,5,0"/> - </StackPanel> - - <views:SearchPopup DockPanel.Dock="Left" - Content="{x:Static res:Resources.ToolShow}" - SearchOptions="{Binding Path=ShowcasePropertiesFilters}" - SearchOptionTemplate="{StaticResource PopupContent}"/> - </DockPanel> - </Grid> - </TabItem> - - <TabItem Header="{x:Static res:Resources.TimeIdleHeader}" Tag="◷"> - <Grid Margin="0,10,0,0"> - <Grid.Resources> - <Style x:Key="TileBorder" TargetType="Border"> - <Setter Property="BorderThickness" Value="0"/> - <Setter Property="BorderBrush" Value="MediumPurple"/> - <Setter Property="Background" Value="#B0FFFFFF"/> - <Setter Property="Opacity" Value="1"/> - <Setter Property="Padding" Value="10"/> - </Style> - - <DataTemplate x:Key="GameTile" DataType="{x:Type loc:BadgeModel}"> - <Border Style="{StaticResource TileBorder}"> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto"/> - <RowDefinition Height="Auto"/> - </Grid.RowDefinitions> - - <Image Source="{Binding Path=ImageUrl}" - ToolTip="{Binding Path=Title}" - HorizontalAlignment="Stretch" VerticalAlignment="Stretch" - Width="180" Height="85"/> - - <StackPanel Grid.Row="1" Orientation="Horizontal" - Margin="0,10" - HorizontalAlignment="Center" - VerticalAlignment="Center"> - <Button Command="{Binding Path=DataContext.StartBadgeIdleCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Content="▷" - ToolTip="{x:Static res:Resources.Start}" - Style="{StaticResource CmdButton}" /> - - <Button Command="{Binding Path=DataContext.StopBadgeIdleCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Content="❚❚" - ToolTip="{x:Static res:Resources.Stop}" - Style="{StaticResource CmdButton}" Margin="10,0"/> - - <Button Command="{Binding Path=DataContext.RemoveGameCmd, ElementName=LayoutRoot}" - CommandParameter="{Binding Path=.}" - Content="⨉" - ToolTip="{x:Static res:Resources.RemoveGame}" - Style="{StaticResource CmdButton}"/> - </StackPanel> - </Grid> - </Border> - </DataTemplate> - - <DataTemplate x:Key="NewTile" DataType="{x:Type loc:BadgeModel}"> - - <Border Style="{StaticResource TileBorder}"> - <Grid VerticalAlignment="Top" - ToolTip="{x:Static res:Resources.AddGame}" - Cursor="Hand" - Width="180"> - - <Grid.RowDefinitions> - <RowDefinition Height="85"/> - <RowDefinition Height="52"/> - </Grid.RowDefinitions> - - <Border Background="Gray"/> - - <TextBlock Text="+" FontSize="32" FontWeight="Bold" Foreground="White" - Grid.Row="0" Margin="0" - VerticalAlignment="Center" - HorizontalAlignment="Center"/> - - <Grid.InputBindings> - <MouseBinding Gesture="LeftClick" Command="{Binding Path=DataContext.AddGameCmd, ElementName=LayoutRoot}"/> - </Grid.InputBindings> - </Grid> - - </Border> - </DataTemplate> - </Grid.Resources> - - <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"> - <ItemsControl ItemsSource="{Binding Path=Games}" - VerticalAlignment="Top" HorizontalAlignment="Stretch"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid Columns="3"/> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - - <ItemsControl.ItemTemplate> - <DataTemplate DataType="{x:Type loc:BadgeModel}"> - <ContentControl Content="{Binding}" Margin="5"> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="ContentTemplate" Value="{StaticResource GameTile}"/> - <Style.Triggers> - <DataTrigger Binding="{Binding AppId}" Value="-1"> - <Setter Property="ContentTemplate" Value="{StaticResource NewTile}"/> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </ScrollViewer> - </Grid> - </TabItem> - - <TabItem Header="{x:Static res:Resources.Settings}" Tag="⚙"> - <Grid Background="{StaticResource DarkTheme}" Opacity="0.8"> - <TabControl TabStripPlacement="Bottom" Background="Transparent"> - - <TabItem Header="{x:Static res:Resources.CfgOperationsHeader}" Style="{x:Null}" MinWidth="160"> - <StackPanel Margin="5,0"> - <Label Content="{x:Static res:Resources.QueueHeader}" Foreground="{StaticResource TitleBrush}"/> - <Grid> - <Grid.Style> - <Style TargetType="Grid"> - <Style.Triggers> - <DataTrigger Binding="{Binding Path=Idler.IsActive}" Value="True"> - <Setter Property="IsEnabled" Value="False"/> - </DataTrigger> - </Style.Triggers> - </Style> - </Grid.Style> - - <Grid.Resources> - <Style TargetType="Label"> - <Setter Property="Foreground" Value="White"/> - <Setter Property="VerticalAlignment" Value="Center"/> - </Style> - </Grid.Resources> - - <Grid.RowDefinitions> - <RowDefinition/> - <RowDefinition Height="5"/> - <RowDefinition/> - <RowDefinition Height="5"/> - <RowDefinition/> - <RowDefinition Height="5"/> - <RowDefinition/> - </Grid.RowDefinitions> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto"/> - <ColumnDefinition Width="10"/> - <ColumnDefinition Width="*"/> - </Grid.ColumnDefinitions> + <views:ShowcasesPage/> + </TabItem> - <Label Content="{x:Static res:Resources.CfgIdleProcessCount}"/> + <TabItem Header="{x:Static res:Resources.TimeIdleHeader}" Tag="◷"> + <views:TimeIdlePage Margin="0,10,0,0"/> + </TabItem> - <xctk:ByteUpDown Grid.Row="0" Grid.Column="2" - MinWidth="60" HorizontalAlignment="Left" - Minimum="1" Maximum="30" - Value="{Binding Path=Idler.MaxIdleInstanceCount}"/> + <TabItem Header="{x:Static res:Resources.Settings}" Tag="⚙"> + <views:SettingsPage/> + </TabItem> - <Label Grid.Row="2" Content="{x:Static res:Resources.CfgIdleTrialPeriod}"/> - - <xctk:DoubleUpDown Grid.Row="2" Grid.Column="2" - FormatString="N1" - MinWidth="60" HorizontalAlignment="Left" - Minimum="0" Increment="0.5" - Value="{Binding Path=Idler.TrialPeriod}" /> - - <Label Grid.Row="4" Content="{x:Static res:Resources.CfgPeriodicSwitchRepeatCount}"/> - - <xctk:ByteUpDown Grid.Row="4" Grid.Column="2" - MinWidth="60" HorizontalAlignment="Left" - Minimum="1" Maximum="30" - Value="{Binding Path=Idler.PeriodicSwitchRepeatCount}"/> - - <Label Content="{x:Static res:Resources.CfgSwitchInterval}" Grid.Row="6" Grid.Column="0"/> - - <StackPanel Grid.Row="6" Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Left"> - <xctk:ByteUpDown MinWidth="60" - Minimum="0" Maximum="240" - Value="{Binding Path=Idler.SwitchMinutes}"/> - <Label Content="{x:Static res:Resources.Minutes}"/> - - <xctk:ByteUpDown MinWidth="60" - Minimum="1" Maximum="60" - Value="{Binding Path=Idler.SwitchSeconds}"/> - <Label Content="{x:Static res:Resources.Seconds}"/> - </StackPanel> - </Grid> - - <Separator Margin="0,5"/> - - <Label Content="{x:Static res:Resources.Showcases}" Foreground="{StaticResource TitleBrush}"/> - <CheckBox IsChecked="{Binding Path=AllowShowcaseSync}" Content="{x:Static res:Resources.AllowSync}" Foreground="White"/> - - <Separator Margin="0,5"/> - </StackPanel> - </TabItem> - - <TabItem Header="{x:Static res:Resources.CfgVisualSettings}" Style="{x:Null}" MinWidth="160"> - <StackPanel Margin="5,0"> - <Label Content="{x:Static res:Resources.CfgCustomBackground}" Foreground="{StaticResource TitleBrush}"/> - <TextBox HorizontalAlignment="Stretch" VerticalContentAlignment="Center" - TextWrapping="Wrap" - Text="{Binding Path=CustomBackgroundUrl, UpdateSourceTrigger=LostFocus}"/> - - <Separator Margin="0,5"/> - - <Label Content="{x:Static res:Resources.CfgPalette}" Foreground="{StaticResource TitleBrush}"/> - <ItemsControl ItemsSource="{Binding Source={x:Static loc:App.CardIdle}, Path=Palette}"> - <ItemsControl.ItemTemplate> - <DataTemplate DataType="{x:Type loc:PaletteItemVm}"> - <Grid Margin="0,2"> - <Grid.ColumnDefinitions> - <ColumnDefinition/> - <ColumnDefinition Width="Auto"/> - </Grid.ColumnDefinitions> - - <Label Content="{Binding Path=Name, Mode=OneTime, Converter={StaticResource strTranslator}}" - Foreground="White"/> - <xctk:ColorPicker Grid.Column="1" Width="120" - SelectedColor="{Binding Path=BrushColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" - AvailableColorsHeader="Available" /> - </Grid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - - <Separator Margin="0,5"/> - - <StackPanel Orientation="Horizontal"> - <CheckBox VerticalAlignment="Center" Margin="5,0,0,0" IsChecked="{Binding ShowInTaskbar}"/> - <Label Content="{x:Static res:Resources.CfgShowInTaskBar}" Foreground="{StaticResource TitleBrush}"/> - </StackPanel> - </StackPanel> - </TabItem> - - </TabControl> - </Grid> - </TabItem> - - <TabItem Header="{x:Static res:Resources.AboutHeader}" Tag="💁" + <TabItem Header="{x:Static res:Resources.AboutHeader}" Tag="💁" IsSelected="{Binding IsUnknown, Mode=OneWay}"> - <Grid Background="{StaticResource DarkTheme}" Opacity="0.8"> - <Grid MaxHeight="480" Margin="20"> - <Grid.Resources> - <Style TargetType="RowDefinition"> - <Setter Property="Height" Value="Auto"/> - </Style> - <Style TargetType="TextBlock"> - <Setter Property="HorizontalAlignment" Value="Center"/> - <Setter Property="Foreground" Value="White"/> - </Style> - </Grid.Resources> - <Grid.RowDefinitions> - <RowDefinition /> - <RowDefinition /> - <RowDefinition /> - <RowDefinition Height="*"/> - <RowDefinition /> - <RowDefinition /> - <RowDefinition /> - <RowDefinition Height="*"/> - <RowDefinition /> - <RowDefinition /> - <RowDefinition /> - <RowDefinition Height="*"/> - <RowDefinition /> - <RowDefinition /> - </Grid.RowDefinitions> - <TextBlock> - <Run Text="Card Idle Remastered" Foreground="{StaticResource TitleBrush}"/> - <Run Text="(© ASh)" Foreground="{StaticResource NameBrush}" /> - </TextBlock> - <TextBlock Grid.Row="1" Text="is a WPF remake of"/> - <TextBlock Grid.Row="2"> - <Run Text="Idle Master" Foreground="{StaticResource TitleBrush}"/> - <Run Text="(© jshackles)" Foreground="{StaticResource NameBrush}"/> - </TextBlock> - - <TextBlock Grid.Row="4" Text="Source codes are available on GitHub"/> - <TextBlock Grid.Row="5" Name="LblCardIdle" - Text="https://github.com/AlexanderSharykin/CardIdleRemastered" - Style="{StaticResource Link}"> - <TextBlock.InputBindings> - <MouseBinding Gesture="LeftClick" - Command="{StaticResource Redirect}" - CommandParameter="{Binding ElementName=LblCardIdle, Path=Text}"/> - </TextBlock.InputBindings> - </TextBlock> - <TextBlock Grid.Row="6" Name="LblIm" - Text="https://github.com/jshackles/idle_master" - Style="{StaticResource Link}"> - <TextBlock.InputBindings> - <MouseBinding Gesture="LeftClick" - Command="{StaticResource Redirect}" - CommandParameter="{Binding ElementName=LblIm, Path=Text}"/> - </TextBlock.InputBindings> - </TextBlock> - - <TextBlock Grid.Row="8" Text="Notifications about new releases in my Twitter"/> - <TextBlock Grid.Row="9" Name="LblTwitter" - Text="https://twitter.com/Alex_Sharykin" - Style="{StaticResource Link}"> - <TextBlock.InputBindings> - <MouseBinding Gesture="LeftClick" - Command="{StaticResource Redirect}" - CommandParameter="{Binding ElementName=LblTwitter, Path=Text}"/> - </TextBlock.InputBindings> - </TextBlock> - <TextBlock Grid.Row="10" Name="LblHashtag" - Text="https://twitter.com/hashtag/CardIdleRemastered" - Style="{StaticResource Link}"> - <TextBlock.InputBindings> - <MouseBinding Gesture="LeftClick" - Command="{StaticResource Redirect}" - CommandParameter="{Binding ElementName=LblHashtag, Path=Text}"/> - </TextBlock.InputBindings> - </TextBlock> - - <StackPanel Grid.Row="12"> - <TextBlock> - <Run Text="Showcase data is obtained from"/> - <Run Text="Steam Card Exchange .Net" Foreground="{StaticResource TitleBrush}"/> - </TextBlock> - <TextBlock> - <Run Text="More details in"/> - <Run Text="CardTrades" Foreground="{StaticResource TitleBrush}"/> - <Run Text="Steam group"/> - </TextBlock> - </StackPanel> - - <TextBlock Name="LblSce" Grid.Row="13" - Text="http://steamcommunity.com/groups/card-trading-card-trades" - Style="{StaticResource Link}"> - <TextBlock.InputBindings> - <MouseBinding Gesture="LeftClick" - Command="{StaticResource Redirect}" - CommandParameter="{Binding ElementName=LblSce, Path=Text}"/> - </TextBlock.InputBindings> - </TextBlock> - </Grid> - </Grid> - </TabItem> + <views:AboutPage/> + </TabItem> - <TabItem Header="Card Idle" Tag="👽"> - <views:CardIdlePage/> - </TabItem> - </TabControl> + <TabItem Header="Card Idle" Tag="👽"> + <views:CardIdlePage/> + </TabItem> + </TabControl> - <StackPanel Grid.Row="2" Grid.Column="1" + <StackPanel Grid.Row="2" Grid.Column="1" Visibility="{Binding IsAuthorized, Converter={StaticResource BoolToVisible}}" Orientation="Horizontal" HorizontalAlignment="Center" Margin="15,0"> - <Label Content ="{x:Static res:Resources.NextSync}" Style="{StaticResource PropName}"/> - <TextBlock Text ="{Binding Path=SyncTime}" Style="{StaticResource PropValue}"/> + <Label Content ="{x:Static res:Resources.NextSync}" Style="{StaticResource PropName}"/> + <TextBlock Text ="{Binding Path=SyncTime}" Style="{StaticResource PropValue}"/> - <Label Content ="{x:Static res:Resources.TotalGames}" Style="{StaticResource PropName}"/> - <TextBlock Text="{Binding Path=TotalGames}" Style="{StaticResource PropValue}"/> + <Label Content ="{x:Static res:Resources.TotalGames}" Style="{StaticResource PropName}"/> + <TextBlock Text="{Binding Path=TotalGames}" Style="{StaticResource PropValue}"/> - <Label Content ="{x:Static res:Resources.TotalCards}" Style="{StaticResource PropName}"/> - <TextBlock Text="{Binding Path=TotalCards}" Style="{StaticResource PropValue}"/> - </StackPanel> - - <StackPanel Grid.Column="1" Grid.Row="3"> - <Label Content="{x:Static res:Resources.NoConnection}" Foreground="Red" FontSize="16" FontWeight="Medium" HorizontalAlignment="Center"> - <Label.Style> - <Style TargetType="{x:Type Label}"> - <Style.Triggers> - <DataTrigger Binding="{Binding Path=IsSteamRunning}" Value="True"> - <Setter Property="Visibility" Value="Hidden"/> - </DataTrigger> - </Style.Triggers> - </Style> - </Label.Style> - </Label> - </StackPanel> + <Label Content ="{x:Static res:Resources.TotalCards}" Style="{StaticResource PropName}"/> + <TextBlock Text="{Binding Path=TotalCards}" Style="{StaticResource PropValue}"/> + </StackPanel> + <StackPanel Grid.Column="1" Grid.Row="3"> + <Label Content="{x:Static res:Resources.NoConnection}" Foreground="Red" FontSize="16" FontWeight="Medium" HorizontalAlignment="Center"> + <Label.Style> + <Style TargetType="{x:Type Label}"> + <Style.Triggers> + <DataTrigger Binding="{Binding Path=IsSteamRunning}" Value="True"> + <Setter Property="Visibility" Value="Hidden"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Label.Style> + </Label> + </StackPanel> + </Grid> </Grid> </Window> diff --git a/SourceCode/CardIdleRemastered/Views/BadgesWindow.xaml.cs b/SourceCode/CardIdleRemastered/Views/BadgesWindow.xaml.cs index ef2679a..babc79b 100644 --- a/SourceCode/CardIdleRemastered/Views/BadgesWindow.xaml.cs +++ b/SourceCode/CardIdleRemastered/Views/BadgesWindow.xaml.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel; +using System.Drawing; using System.Windows; -using System.Windows.Controls; using System.Windows.Forms; using Application = System.Windows.Application; @@ -13,16 +13,18 @@ namespace CardIdleRemastered public partial class BadgesWindow : Window { private NotifyIcon _ni; + public BadgesWindow() { InitializeComponent(); DataContextChanged += OnDataContextChanged; + Loaded += OnWindowLoaded; var icoUri = new Uri("pack://application:,,,/CardIdleRemastered;component/CardIdle.ico"); var iconStream = Application.GetResourceStream(icoUri).Stream; _ni = new NotifyIcon { - Icon = new System.Drawing.Icon(iconStream), + Icon = new Icon(iconStream), Text = "Card Idle", Visible = false }; @@ -30,6 +32,31 @@ public BadgesWindow() _ni.DoubleClick += ExpandWindow; } + void OnWindowLoaded(object sender, RoutedEventArgs e) + { + SizeChanged += OnWindowSizeChanged; + LocationChanged += OnWindowLocationChanged; + } + + void OnWindowSizeChanged(object sender, SizeChangedEventArgs e) + { + SaveDimensions(); + } + + void OnWindowLocationChanged(object sender, EventArgs e) + { + SaveDimensions(); + } + + private void SaveDimensions() + { + if (Vm != null) + { + Vm.Storage.Dimensions = new Thickness(Left, Top, RenderSize.Width, RenderSize.Height).ToString(); + Vm.Storage.Save(); + } + } + protected override void OnStateChanged(EventArgs e) { if (WindowState == WindowState.Minimized && !Vm.ShowInTaskbar) @@ -59,6 +86,19 @@ private AccountModel Vm private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e) { Vm = DataContext as AccountModel; + if (Vm != null) + { + string x = Vm.Storage.Dimensions; + if (String.IsNullOrWhiteSpace(x)) + return; + + var d = (Thickness)(new ThicknessConverter().ConvertFromInvariantString(x)); + WindowStartupLocation = WindowStartupLocation.Manual; + Left = Math.Max(0, d.Left); + Top = Math.Max(0, d.Top); + Width = d.Right; + Height = d.Bottom; + } } private void VmOnPropertyChanged(object sender, PropertyChangedEventArgs e) @@ -78,10 +118,5 @@ private void ExpandWindow(object sender, EventArgs e) WindowState = WindowState.Normal; Activate(); } - - private void SetLoadingRowNumber(object sender, DataGridRowEventArgs e) - { - e.Row.Header = (e.Row.GetIndex() + 1).ToString(); - } } } diff --git a/SourceCode/CardIdleRemastered/Views/CardIdlePage.xaml b/SourceCode/CardIdleRemastered/Views/CardIdlePage.xaml index f05e1a5..3b8c228 100644 --- a/SourceCode/CardIdleRemastered/Views/CardIdlePage.xaml +++ b/SourceCode/CardIdleRemastered/Views/CardIdlePage.xaml @@ -1,4 +1,4 @@ -<UserControl x:Class="CardIdleRemastered.Views.CardIdlePage" +<UserControl x:Class="CardIdleRemastered.Views.CardIdlePage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" @@ -6,9 +6,10 @@ xmlns:res="clr-namespace:CardIdleRemastered.Properties" xmlns:local="clr-namespace:CardIdleRemastered" Background="{DynamicResource DarkTheme}" + Opacity="0.8" mc:Ignorable="d" d:DesignHeight="480" d:DesignWidth="640" - d:DataContext="{d:DesignInstance Type=local:AccountModel, IsDesignTimeCreatable=True}"> + d:DataContext="{d:DesignInstance Type=local:AccountModel, IsDesignTimeCreatable=False}"> <UserControl.Resources> <ResourceDictionary> @@ -24,7 +25,7 @@ <RowDefinition/> </Grid.RowDefinitions> - <Grid Margin="0,20,0,0"> + <Grid Margin="0,20,0,0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"/> <ColumnDefinition Width="3*"/> @@ -47,11 +48,11 @@ Stretch="UniformToFill"/> </Border> - <StackPanel Grid.Column="1" HorizontalAlignment="Center"> + <StackPanel Grid.Column="1" HorizontalAlignment="Left"> <Label Content="{Binding Path=UserName, FallbackValue='Card Idle'}" VerticalAlignment="Top" - HorizontalAlignment="Center" + HorizontalAlignment="Left" Padding="5,0,5,5" FontSize="24" Foreground="White"/> @@ -84,14 +85,16 @@ ToolTip="{Binding Path=BadgeTitle}"/> </StackPanel> - <Label Grid.Row="1" Grid.Column="1" + <Label Grid.Row="1" Grid.ColumnSpan="3" Content="{Binding MessageTitle, FallbackValue='How to Help Card Idle'}" HorizontalAlignment="Center" + Visibility="{Binding Path=HasItems, ElementName=ListLines, Converter={StaticResource BoolToVisible}}" FontSize="24" Foreground="{DynamicResource DynStatsHeaders}"/> </Grid> <ItemsControl Grid.Row="1" Margin="25,0" + Name="ListLines" ItemsSource="{Binding MessageLines}" TextElement.Foreground="White"> diff --git a/SourceCode/CardIdleRemastered/Views/CardIdlePage.xaml.cs b/SourceCode/CardIdleRemastered/Views/CardIdlePage.xaml.cs index a69b522..b5e09a0 100644 --- a/SourceCode/CardIdleRemastered/Views/CardIdlePage.xaml.cs +++ b/SourceCode/CardIdleRemastered/Views/CardIdlePage.xaml.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; +using System.Windows.Controls; namespace CardIdleRemastered.Views { diff --git a/SourceCode/CardIdleRemastered/Views/QueuePage.xaml b/SourceCode/CardIdleRemastered/Views/QueuePage.xaml new file mode 100644 index 0000000..754b9a4 --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/QueuePage.xaml @@ -0,0 +1,123 @@ +<UserControl x:Class="CardIdleRemastered.Views.QueuePage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:res="clr-namespace:CardIdleRemastered.Properties" + xmlns:local="clr-namespace:CardIdleRemastered" + mc:Ignorable="d" + d:DesignHeight="480" d:DesignWidth="640" + d:DataContext="{d:DesignInstance Type=local:AccountModel, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Themes/SharedResources.xaml"/> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </UserControl.Resources> + + <Grid Name="LayoutRoot"> + <Grid.RowDefinitions> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + + <DataGrid ItemsSource="{Binding Path=IdleQueueBadges}" + CellStyle="{StaticResource GameCellStyle}" + LoadingRow="SetLoadingRowNumber"> + + <DataGrid.Columns> + <DataGridTemplateColumn Header="{x:Static res:Resources.Game}" + CellTemplate="{StaticResource GameImgCell}" + Width="Auto" MinWidth="230"/> + <DataGridTextColumn + Header="{x:Static res:Resources.Hours}" Binding="{Binding Path=HoursPlayed}" + IsReadOnly="True" CanUserSort="False" + Width="*" ElementStyle="{StaticResource DataGridText}"/> + <DataGridTextColumn + Header="{x:Static res:Resources.Cards}" Binding="{Binding Path=RemainingCard}" + IsReadOnly="True" CanUserSort="False" + Width="*" ElementStyle="{StaticResource DataGridText}"/> + <DataGridTextColumn + Header="$" Binding="{Binding Path=CardPrice, StringFormat='\{0:0.00}'}" + IsReadOnly="True" CanUserSort="False" + Width="40" ElementStyle="{StaticResource DataGridText}"/> + <DataGridTemplateColumn Header="{x:Static res:Resources.Priority}" Width="*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <StackPanel Orientation="Vertical" VerticalAlignment="Center"> + <Button Content="▲" + ToolTip="{x:Static res:Resources.PriorityHigher}" + Command="{Binding Path=DataContext.SetHigherPriorityCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Style="{StaticResource CmdButton}"/> + <Button Content="▼" + ToolTip="{x:Static res:Resources.PriorityLower}" + Command="{Binding Path=DataContext.SetLowerPriorityCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Style="{StaticResource CmdButton}" Margin="0,5,0,0"/> + </StackPanel> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="{x:Static res:Resources.DequeueHeader}" Width="*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Button Command="{Binding Path=DataContext.DequeueBadgeCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Content="#" Style="{StaticResource CmdButton}"/> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + + <Grid Grid.Row="1" Margin="0,4,0,5"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto"/> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + + <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0"> + <Label Content="{x:Static res:Resources.ToolIdleMode}" Foreground="White"/> + <ComboBox + MinWidth="100" + VerticalContentAlignment="Center" + ItemsSource="{Binding Path=Idler.IdleModes}" + SelectedItem="{Binding Path=Idler.Mode, Converter={StaticResource EnumTranslator}}" > + </ComboBox> + </StackPanel> + + <Button Content="{x:Static res:Resources.Start}" + Command ="{Binding IdleCmd}" CommandParameter="1" + Grid.Row="0" Grid.Column="2" + HorizontalAlignment="Right" + Margin="0,0,10,0" Padding="10,4,10,4" + + FontSize="18" + BorderThickness="2" + Background="{DynamicResource DynIdleButtons}" + HorizontalContentAlignment="Center" + VerticalContentAlignment="Center"/> + + <Button Content="{x:Static res:Resources.Stop}" + Command ="{Binding IdleCmd}" CommandParameter="0" + Grid.Row="0" Grid.Column="3" + HorizontalAlignment="Left" + Margin="10,0,0,0" Padding="10,4,10,4" + + FontSize="18" + BorderThickness="2" + Background="{DynamicResource DynIdleButtons}" + HorizontalContentAlignment="Center" + VerticalContentAlignment="Center"/> + </Grid> + </Grid> +</UserControl> \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/QueuePage.xaml.cs b/SourceCode/CardIdleRemastered/Views/QueuePage.xaml.cs new file mode 100644 index 0000000..493242b --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/QueuePage.xaml.cs @@ -0,0 +1,20 @@ +using System.Windows.Controls; + +namespace CardIdleRemastered.Views +{ + /// <summary> + /// Interaction logic for QueuePage.xaml + /// </summary> + public partial class QueuePage : UserControl + { + public QueuePage() + { + InitializeComponent(); + } + + private void SetLoadingRowNumber(object sender, DataGridRowEventArgs e) + { + e.Row.Header = (e.Row.GetIndex() + 1).ToString(); + } + } +} \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/SettingsPage.xaml b/SourceCode/CardIdleRemastered/Views/SettingsPage.xaml new file mode 100644 index 0000000..40cd8a5 --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/SettingsPage.xaml @@ -0,0 +1,151 @@ +<UserControl x:Class="CardIdleRemastered.Views.SettingsPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:res="clr-namespace:CardIdleRemastered.Properties" + xmlns:local="clr-namespace:CardIdleRemastered" + xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" + mc:Ignorable="d" + d:DesignHeight="480" d:DesignWidth="640" + d:DataContext="{d:DesignInstance Type=local:AccountModel, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Themes/SharedResources.xaml"/> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </UserControl.Resources> + + <Grid Name="LayoutRoot" Background="{StaticResource DarkTheme}" Opacity="0.8"> + <TabControl TabStripPlacement="Bottom" Background="Transparent"> + + <TabItem Header="{x:Static res:Resources.CfgOperationsHeader}" Style="{x:Null}" MinWidth="160"> + <StackPanel Margin="5,0"> + <Label Content="{x:Static res:Resources.QueueHeader}" Foreground="{StaticResource TitleBrush}"/> + <Grid> + <Grid.Style> + <Style TargetType="Grid"> + <Style.Triggers> + <DataTrigger Binding="{Binding Path=Idler.IsActive}" Value="True"> + <Setter Property="IsEnabled" Value="False"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <Grid.Resources> + <Style TargetType="Label"> + <Setter Property="Foreground" Value="White"/> + <Setter Property="VerticalAlignment" Value="Center"/> + </Style> + </Grid.Resources> + + <Grid.RowDefinitions> + <RowDefinition/> + <RowDefinition Height="5"/> + <RowDefinition/> + <RowDefinition Height="5"/> + <RowDefinition/> + <RowDefinition Height="5"/> + <RowDefinition/> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="10"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + + <Label Content="{x:Static res:Resources.CfgIdleProcessCount}"/> + + <xctk:ByteUpDown Grid.Row="0" Grid.Column="2" + MinWidth="60" HorizontalAlignment="Left" + Minimum="1" Maximum="30" + Value="{Binding Path=Idler.MaxIdleInstanceCount}"/> + + <Label Grid.Row="2" Content="{x:Static res:Resources.CfgIdleTrialPeriod}"/> + + <xctk:DoubleUpDown Grid.Row="2" Grid.Column="2" + FormatString="N1" + MinWidth="60" HorizontalAlignment="Left" + Minimum="0" Increment="0.5" + Value="{Binding Path=Idler.TrialPeriod}" /> + + <Label Grid.Row="4" Content="{x:Static res:Resources.CfgPeriodicSwitchRepeatCount}"/> + + <xctk:ByteUpDown Grid.Row="4" Grid.Column="2" + MinWidth="60" HorizontalAlignment="Left" + Minimum="1" Maximum="30" + Value="{Binding Path=Idler.PeriodicSwitchRepeatCount}"/> + + <Label Content="{x:Static res:Resources.CfgSwitchInterval}" Grid.Row="6" Grid.Column="0"/> + + <StackPanel Grid.Row="6" Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Left"> + <xctk:ByteUpDown MinWidth="60" + Minimum="0" Maximum="240" + Value="{Binding Path=Idler.SwitchMinutes}"/> + <Label Content="{x:Static res:Resources.Minutes}"/> + + <xctk:ByteUpDown MinWidth="60" + Minimum="1" Maximum="60" + Value="{Binding Path=Idler.SwitchSeconds}"/> + <Label Content="{x:Static res:Resources.Seconds}"/> + </StackPanel> + </Grid> + + <Separator Margin="0,5"/> + + <Label Content="{x:Static res:Resources.Showcases}" Foreground="{StaticResource TitleBrush}"/> + <CheckBox IsChecked="{Binding Path=AllowShowcaseSync}" Content="{x:Static res:Resources.AllowSync}" Foreground="White"/> + + <Separator Margin="0,5"/> + </StackPanel> + </TabItem> + + <TabItem Header="{x:Static res:Resources.CfgVisualSettings}" Style="{x:Null}" MinWidth="160"> + <StackPanel Margin="5,0"> + <StackPanel Orientation="Horizontal"> + <CheckBox VerticalAlignment="Center" Margin="5,0,0,0" IsChecked="{Binding ShowBackground}"/> + <Label Content="{x:Static res:Resources.CfgShowBackground}" Foreground="{StaticResource TitleBrush}"/> + </StackPanel> + + <Label Content="{x:Static res:Resources.CfgCustomBackground}" Foreground="{StaticResource TitleBrush}"/> + <TextBox HorizontalAlignment="Stretch" VerticalContentAlignment="Center" + TextWrapping="Wrap" + Text="{Binding Path=CustomBackgroundUrl, UpdateSourceTrigger=LostFocus}"/> + + <Separator Margin="0,5"/> + + <Label Content="{x:Static res:Resources.CfgPalette}" Foreground="{StaticResource TitleBrush}"/> + <ItemsControl ItemsSource="{Binding Source={x:Static local:App.CardIdle}, Path=Palette}"> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type local:PaletteItemVm}"> + <Grid Margin="0,2"> + <Grid.ColumnDefinitions> + <ColumnDefinition/> + <ColumnDefinition Width="Auto"/> + </Grid.ColumnDefinitions> + + <Label Content="{Binding Path=Name, Mode=OneTime, Converter={StaticResource strTranslator}}" + Foreground="White"/> + <xctk:ColorPicker Grid.Column="1" Width="120" + SelectedColor="{Binding Path=BrushColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" + AvailableColorsHeader="Available" /> + </Grid> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + + <Separator Margin="0,5"/> + + <StackPanel Orientation="Horizontal"> + <CheckBox VerticalAlignment="Center" Margin="5,0,0,0" IsChecked="{Binding ShowInTaskbar}"/> + <Label Content="{x:Static res:Resources.CfgShowInTaskBar}" Foreground="{StaticResource TitleBrush}"/> + </StackPanel> + </StackPanel> + </TabItem> + + </TabControl> + </Grid> +</UserControl> \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/SettingsPage.xaml.cs b/SourceCode/CardIdleRemastered/Views/SettingsPage.xaml.cs new file mode 100644 index 0000000..aa7b6d3 --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/SettingsPage.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace CardIdleRemastered.Views +{ + /// <summary> + /// Interaction logic for SettingsPage.xaml + /// </summary> + public partial class SettingsPage : UserControl + { + public SettingsPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/ShowcasesPage.xaml b/SourceCode/CardIdleRemastered/Views/ShowcasesPage.xaml new file mode 100644 index 0000000..bfafa44 --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/ShowcasesPage.xaml @@ -0,0 +1,105 @@ +<UserControl x:Class="CardIdleRemastered.Views.ShowcasesPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:res="clr-namespace:CardIdleRemastered.Properties" + xmlns:local="clr-namespace:CardIdleRemastered" + xmlns:views="clr-namespace:CardIdleRemastered.Views" + mc:Ignorable="d" + d:DesignHeight="480" d:DesignWidth="640" + d:DataContext="{d:DesignInstance Type=local:AccountModel, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Themes/SharedResources.xaml"/> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </UserControl.Resources> + + <Grid Name="LayoutRoot"> + <Grid.RowDefinitions> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + + <DataGrid Grid.Row="0" + ItemsSource="{Binding Path=AllShowcases}" + VerticalContentAlignment="Stretch" + LoadingRow="SetLoadingRowNumber"> + + <DataGrid.Resources> + <Style TargetType="TextBlock"> + <Setter Property="TextAlignment" Value="Center" /> + <Setter Property="VerticalAlignment" Value="Center" /> + </Style> + </DataGrid.Resources> + + <DataGrid.Columns> + <DataGridTemplateColumn Header="{x:Static res:Resources.Game}" + CellTemplate="{StaticResource GameImgCell}" + Width="Auto" MinWidth="230"/> + + <DataGridTextColumn + Header="$" Binding="{Binding Path=CardPrice, StringFormat='\{0:0.00}'}" + IsReadOnly="True" + Width="40" + ElementStyle="{StaticResource DataGridText}"/> + + <DataGridTemplateColumn Header="{x:Static res:Resources.Levels}" Width="*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition/> + <ColumnDefinition Width="Auto"/> + </Grid.ColumnDefinitions> + <ItemsControl ItemsSource="{Binding Path=Levels}" + ItemTemplate="{StaticResource BadgeImageTile}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Rows="1" Columns="6"/> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + </ItemsControl> + + <Button Grid.Column="1" FontSize="20" ToolTip="{x:Static res:Resources.Bookmark}" + Margin="5,0" + Command="{Binding Path=DataContext.BookmarkShowcaseCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding}"> + <Button.Style> + <Style TargetType="Button" BasedOn="{StaticResource CmdButton}"> + <Setter Property="Content" Value="☆"/> + <Style.Triggers> + <DataTrigger Binding="{Binding Path=IsBookmarked}" Value="True"> + <Setter Property="Background" Value="Gold"/> + <Setter Property="Content" Value="★"/> + </DataTrigger> + </Style.Triggers> + </Style> + </Button.Style> + </Button> + </Grid> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + </DataGrid.Columns> + </DataGrid> + + <DockPanel Grid.Row="1" Margin="0,4,0,5" + HorizontalAlignment="Stretch"> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Right"> + <Label Content="{x:Static res:Resources.ToolSearch}" Foreground="White"/> + <TextBox Text="{Binding Path=ShowcaseTitle, Delay=400, UpdateSourceTrigger=PropertyChanged}" + MinWidth="100" Padding="5,0,5,0" + VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Margin="0,0,5,0"/> + </StackPanel> + + <views:SearchPopup DockPanel.Dock="Left" + Content="{x:Static res:Resources.ToolShow}" + SearchOptions="{Binding Path=ShowcasePropertiesFilters}" + SearchOptionTemplate="{StaticResource PopupContent}"/> + </DockPanel> + </Grid> +</UserControl> \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/ShowcasesPage.xaml.cs b/SourceCode/CardIdleRemastered/Views/ShowcasesPage.xaml.cs new file mode 100644 index 0000000..da40b1d --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/ShowcasesPage.xaml.cs @@ -0,0 +1,20 @@ +using System.Windows.Controls; + +namespace CardIdleRemastered.Views +{ + /// <summary> + /// Interaction logic for ShowcasesPage.xaml + /// </summary> + public partial class ShowcasesPage : UserControl + { + public ShowcasesPage() + { + InitializeComponent(); + } + + private void SetLoadingRowNumber(object sender, DataGridRowEventArgs e) + { + e.Row.Header = (e.Row.GetIndex() + 1).ToString(); + } + } +} \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/TimeIdlePage.xaml b/SourceCode/CardIdleRemastered/Views/TimeIdlePage.xaml new file mode 100644 index 0000000..411547a --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/TimeIdlePage.xaml @@ -0,0 +1,126 @@ +<UserControl x:Class="CardIdleRemastered.Views.TimeIdlePage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:res="clr-namespace:CardIdleRemastered.Properties" + xmlns:local="clr-namespace:CardIdleRemastered" + mc:Ignorable="d" + d:DesignHeight="480" d:DesignWidth="640" + d:DataContext="{d:DesignInstance Type=local:AccountModel, IsDesignTimeCreatable=False}"> + + <UserControl.Resources> + <ResourceDictionary> + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Themes/SharedResources.xaml"/> + </ResourceDictionary.MergedDictionaries> + </ResourceDictionary> + </UserControl.Resources> + + <Grid Name="LayoutRoot"> + <Grid.Resources> + <Style x:Key="TileBorder" TargetType="Border"> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="BorderBrush" Value="MediumPurple"/> + <Setter Property="Background" Value="#B0FFFFFF"/> + <Setter Property="Opacity" Value="1"/> + <Setter Property="Padding" Value="10"/> + </Style> + + <DataTemplate x:Key="GameTile" DataType="{x:Type local:BadgeModel}"> + <Border Style="{StaticResource TileBorder}"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + + <Image Source="{Binding Path=ImageUrl}" + ToolTip="{Binding Path=Title}" + HorizontalAlignment="Stretch" VerticalAlignment="Stretch" + Width="180" Height="85"/> + + <StackPanel Grid.Row="1" Orientation="Horizontal" + Margin="0,10" + HorizontalAlignment="Center" + VerticalAlignment="Center"> + <Button Command="{Binding Path=DataContext.StartBadgeIdleCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Content="▷" + ToolTip="{x:Static res:Resources.Start}" + Style="{StaticResource CmdButton}" /> + + <Button Command="{Binding Path=DataContext.StopBadgeIdleCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Content="❚❚" + ToolTip="{x:Static res:Resources.Stop}" + Style="{StaticResource CmdButton}" Margin="10,0"/> + + <Button Command="{Binding Path=DataContext.RemoveGameCmd, ElementName=LayoutRoot}" + CommandParameter="{Binding Path=.}" + Content="⨉" + ToolTip="{x:Static res:Resources.RemoveGame}" + Style="{StaticResource CmdButton}"/> + </StackPanel> + </Grid> + </Border> + </DataTemplate> + + <DataTemplate x:Key="NewTile" DataType="{x:Type local:BadgeModel}"> + + <Border Style="{StaticResource TileBorder}"> + <Grid VerticalAlignment="Top" + ToolTip="{x:Static res:Resources.AddGame}" + Cursor="Hand" + Width="180"> + + <Grid.RowDefinitions> + <RowDefinition Height="85"/> + <RowDefinition Height="52"/> + </Grid.RowDefinitions> + + <Border Background="Gray"/> + + <TextBlock Text="+" FontSize="32" FontWeight="Bold" Foreground="White" + Grid.Row="0" Margin="0" + VerticalAlignment="Center" + HorizontalAlignment="Center"/> + + <Grid.InputBindings> + <MouseBinding Gesture="LeftClick" Command="{Binding Path=DataContext.AddGameCmd, ElementName=LayoutRoot}"/> + </Grid.InputBindings> + </Grid> + + </Border> + </DataTemplate> + </Grid.Resources> + + <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"> + <ItemsControl ItemsSource="{Binding Path=Games}" + VerticalAlignment="Top" HorizontalAlignment="Stretch"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="3"/> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type local:BadgeModel}"> + <ContentControl Content="{Binding}" Margin="5"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="ContentTemplate" Value="{StaticResource GameTile}"/> + <Style.Triggers> + <DataTrigger Binding="{Binding AppId}" Value="-1"> + <Setter Property="ContentTemplate" Value="{StaticResource NewTile}"/> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> + </Grid> +</UserControl> \ No newline at end of file diff --git a/SourceCode/CardIdleRemastered/Views/TimeIdlePage.xaml.cs b/SourceCode/CardIdleRemastered/Views/TimeIdlePage.xaml.cs new file mode 100644 index 0000000..32a7f29 --- /dev/null +++ b/SourceCode/CardIdleRemastered/Views/TimeIdlePage.xaml.cs @@ -0,0 +1,15 @@ +using System.Windows.Controls; + +namespace CardIdleRemastered.Views +{ + /// <summary> + /// Interaction logic for TimeIdlePage.xaml + /// </summary> + public partial class TimeIdlePage : UserControl + { + public TimeIdlePage() + { + InitializeComponent(); + } + } +} \ No newline at end of file