From 6bd36a292f9611455ba8c968683c6ca8923976f4 Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Wed, 10 Nov 2021 21:21:25 -0600 Subject: [PATCH] Updated packages --- .../Controls/AbstractBooleanPresenter.cs | 2 +- .../AbstractUIGroupItemTemplateSelector.cs | 12 ++-- .../Controls/AbstractUIGroupPresenter.cs | 12 ++-- .../Themes/AbstractBooleanStyle.xaml | 2 +- ...AbstractMultiChoiceTypeTemplateSelector.cs | 2 +- .../AbstractProgressUIElementStyle.xaml | 4 +- .../Themes/AbstractUIGroupPresenterStyle.xaml | 10 +-- OwlCore.Wpf/OwlCore.Wpf.csproj | 4 +- ZuneModCore/Mod.cs | 6 +- ZuneModCore/Mods/BackgroundImageMod.cs | 4 +- ZuneModCore/Mods/FeaturesOverrideMod.cs | 62 +++++++++---------- ZuneModCore/Mods/MbidLocatorMod.cs | 10 +-- ZuneModCore/Mods/WebservicesMod.cs | 4 +- ZuneModCore/ZuneModCore.csproj | 2 +- .../AbstractUIGroupDialog.xaml.cs | 10 +-- ZuneModdingHelper/MainWindow.xaml.cs | 4 +- ZuneModdingHelper/ZuneModdingHelper.csproj | 10 +-- 17 files changed, 80 insertions(+), 80 deletions(-) diff --git a/OwlCore.Wpf/AbstractUI/Controls/AbstractBooleanPresenter.cs b/OwlCore.Wpf/AbstractUI/Controls/AbstractBooleanPresenter.cs index 3fb0798..1197892 100644 --- a/OwlCore.Wpf/AbstractUI/Controls/AbstractBooleanPresenter.cs +++ b/OwlCore.Wpf/AbstractUI/Controls/AbstractBooleanPresenter.cs @@ -4,7 +4,7 @@ using OwlCore.AbstractUI.Models; namespace OwlCore.Wpf.AbstractUI.Controls { /// - /// A control that displays an . + /// A control that displays an . /// public partial class AbstractBooleanPresenter : Control { diff --git a/OwlCore.Wpf/AbstractUI/Controls/AbstractUIGroupItemTemplateSelector.cs b/OwlCore.Wpf/AbstractUI/Controls/AbstractUIGroupItemTemplateSelector.cs index 8a9b7c2..68b8759 100644 --- a/OwlCore.Wpf/AbstractUI/Controls/AbstractUIGroupItemTemplateSelector.cs +++ b/OwlCore.Wpf/AbstractUI/Controls/AbstractUIGroupItemTemplateSelector.cs @@ -56,7 +56,7 @@ namespace OwlCore.Wpf.AbstractUI.Controls } /// - /// The data template used to display an . + /// The data template used to display an . /// public DataTemplate? ElementGroupTemplate { get; set; } @@ -76,7 +76,7 @@ namespace OwlCore.Wpf.AbstractUI.Controls public DataTemplate ButtonTemplate { get; set; } /// - /// The data template used to display an . + /// The data template used to display an . /// public DataTemplate BooleanTemplate { get; set; } @@ -93,7 +93,7 @@ namespace OwlCore.Wpf.AbstractUI.Controls /// public override DataTemplate SelectTemplate(object item, DependencyObject container) { - if (!new Themes.AbstractUIGroupPresenterStyle().TryGetValue("DefaultAbstractUIElementGroupTemplate", out var elementGroupTemplate)) + if (!new Themes.AbstractUIGroupPresenterStyle().TryGetValue("DefaultAbstractUICollectionTemplate", out var elementGroupTemplate)) ElementGroupTemplate = ThrowHelper.ThrowArgumentNullException(nameof(elementGroupTemplate)); ElementGroupTemplate = (DataTemplate)elementGroupTemplate; @@ -103,10 +103,10 @@ namespace OwlCore.Wpf.AbstractUI.Controls AbstractTextBoxViewModel => TextBoxTemplate, AbstractDataListViewModel => DataListTemplate, AbstractButtonViewModel => ButtonTemplate, - AbstractMultiChoiceUIElementViewModel => MultiChoiceTemplate, + AbstractMultiChoiceViewModel => MultiChoiceTemplate, AbstractBooleanViewModel => BooleanTemplate, - AbstractProgressUIElementViewModel => ProgressTemplate, - AbstractUIElementGroupViewModel => ElementGroupTemplate, + AbstractProgressIndicatorViewModel => ProgressTemplate, + AbstractUICollectionViewModel => ElementGroupTemplate, _ => null! }; } diff --git a/OwlCore.Wpf/AbstractUI/Controls/AbstractUIGroupPresenter.cs b/OwlCore.Wpf/AbstractUI/Controls/AbstractUIGroupPresenter.cs index 046e219..aee2838 100644 --- a/OwlCore.Wpf/AbstractUI/Controls/AbstractUIGroupPresenter.cs +++ b/OwlCore.Wpf/AbstractUI/Controls/AbstractUIGroupPresenter.cs @@ -16,7 +16,7 @@ namespace OwlCore.Wpf.AbstractUI.Controls /// Backing property for . /// public static readonly DependencyProperty ViewModelProperty = - DependencyProperty.Register(nameof(ViewModel), typeof(AbstractUIElementGroupViewModel), typeof(AbstractUIGroupPresenter), new PropertyMetadata(null, (d, e) => ((AbstractUIGroupPresenter)d).OnViewModelChanged())); + DependencyProperty.Register(nameof(ViewModel), typeof(AbstractUICollectionViewModel), typeof(AbstractUIGroupPresenter), new PropertyMetadata(null, (d, e) => ((AbstractUIGroupPresenter)d).OnViewModelChanged())); /// /// Backing property for . @@ -27,9 +27,9 @@ namespace OwlCore.Wpf.AbstractUI.Controls /// /// The ViewModel for this UserControl. /// - public AbstractUIElementGroupViewModel? ViewModel + public AbstractUICollectionViewModel? ViewModel { - get => (AbstractUIElementGroupViewModel)GetValue(ViewModelProperty); + get => (AbstractUICollectionViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } @@ -71,10 +71,10 @@ namespace OwlCore.Wpf.AbstractUI.Controls _dataContextBeingSet = true; - if (DataContext is AbstractUIElementGroup elementGroup) - ViewModel = new AbstractUIElementGroupViewModel(elementGroup); + if (DataContext is AbstractUICollection elementGroup) + ViewModel = new AbstractUICollectionViewModel(elementGroup); - if (DataContext is AbstractUIElementGroupViewModel elementGroupViewModel) + if (DataContext is AbstractUICollectionViewModel elementGroupViewModel) ViewModel = elementGroupViewModel; _dataContextBeingSet = false; diff --git a/OwlCore.Wpf/AbstractUI/Themes/AbstractBooleanStyle.xaml b/OwlCore.Wpf/AbstractUI/Themes/AbstractBooleanStyle.xaml index 8abc67f..52b8052 100644 --- a/OwlCore.Wpf/AbstractUI/Themes/AbstractBooleanStyle.xaml +++ b/OwlCore.Wpf/AbstractUI/Themes/AbstractBooleanStyle.xaml @@ -26,7 +26,7 @@ + IsChecked="{Binding IsToggled, Mode=OneWay}"> diff --git a/OwlCore.Wpf/AbstractUI/Themes/AbstractMultiChoiceTypeTemplateSelector.cs b/OwlCore.Wpf/AbstractUI/Themes/AbstractMultiChoiceTypeTemplateSelector.cs index 1a7b0bd..776b747 100644 --- a/OwlCore.Wpf/AbstractUI/Themes/AbstractMultiChoiceTypeTemplateSelector.cs +++ b/OwlCore.Wpf/AbstractUI/Themes/AbstractMultiChoiceTypeTemplateSelector.cs @@ -25,7 +25,7 @@ namespace OwlCore.Wpf.AbstractUI.Themes /// public override DataTemplate SelectTemplate(object item, DependencyObject container) { - if (item is AbstractMultiChoiceUIElementViewModel viewModel) + if (item is AbstractMultiChoiceViewModel viewModel) { return viewModel.PreferredDisplayMode switch { diff --git a/OwlCore.Wpf/AbstractUI/Themes/AbstractProgressUIElementStyle.xaml b/OwlCore.Wpf/AbstractUI/Themes/AbstractProgressUIElementStyle.xaml index 091dd46..fbecf02 100644 --- a/OwlCore.Wpf/AbstractUI/Themes/AbstractProgressUIElementStyle.xaml +++ b/OwlCore.Wpf/AbstractUI/Themes/AbstractProgressUIElementStyle.xaml @@ -11,7 +11,7 @@ - + @@ -29,7 +29,7 @@ - diff --git a/OwlCore.Wpf/AbstractUI/Themes/AbstractUIGroupPresenterStyle.xaml b/OwlCore.Wpf/AbstractUI/Themes/AbstractUIGroupPresenterStyle.xaml index 80ea498..dcb65fa 100644 --- a/OwlCore.Wpf/AbstractUI/Themes/AbstractUIGroupPresenterStyle.xaml +++ b/OwlCore.Wpf/AbstractUI/Themes/AbstractUIGroupPresenterStyle.xaml @@ -40,13 +40,13 @@ - + - + @@ -58,13 +58,13 @@ - + - + - diff --git a/OwlCore.Wpf/OwlCore.Wpf.csproj b/OwlCore.Wpf/OwlCore.Wpf.csproj index e75d644..79c6fc6 100644 --- a/OwlCore.Wpf/OwlCore.Wpf.csproj +++ b/OwlCore.Wpf/OwlCore.Wpf.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/ZuneModCore/Mod.cs b/ZuneModCore/Mod.cs index 3cd97e7..f7692b4 100644 --- a/ZuneModCore/Mod.cs +++ b/ZuneModCore/Mod.cs @@ -31,7 +31,7 @@ namespace ZuneModCore public abstract string Author { get; } - public virtual AbstractUIElementGroup? GetDefaultOptionsUI() => null; + public virtual AbstractUICollection? GetDefaultOptionsUI() => null; public virtual Task Init() => Task.CompletedTask; @@ -39,8 +39,8 @@ namespace ZuneModCore public abstract Task Reset(); - private AbstractUIElementGroup? _OptionsUI; - public AbstractUIElementGroup? OptionsUI + private AbstractUICollection? _OptionsUI; + public AbstractUICollection? OptionsUI { get { diff --git a/ZuneModCore/Mods/BackgroundImageMod.cs b/ZuneModCore/Mods/BackgroundImageMod.cs index 217c49e..e8df83d 100644 --- a/ZuneModCore/Mods/BackgroundImageMod.cs +++ b/ZuneModCore/Mods/BackgroundImageMod.cs @@ -20,12 +20,12 @@ namespace ZuneModCore.Mods public override string Author => "Joshua \"Yoshi\" Askharoun"; - public override AbstractUIElementGroup? GetDefaultOptionsUI() + public override AbstractUICollection? GetDefaultOptionsUI() { return new(nameof(BackgroundImageMod)) { Title = "Select background image:", - Items = + Items = new List { new AbstractTextBox("fileBox", Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)), } diff --git a/ZuneModCore/Mods/FeaturesOverrideMod.cs b/ZuneModCore/Mods/FeaturesOverrideMod.cs index bbedf53..e60801e 100644 --- a/ZuneModCore/Mods/FeaturesOverrideMod.cs +++ b/ZuneModCore/Mods/FeaturesOverrideMod.cs @@ -19,39 +19,39 @@ namespace ZuneModCore.Mods public override string Author => "Rafael Rivera"; - public override AbstractUIElementGroup? GetDefaultOptionsUI() + public override AbstractUICollection? GetDefaultOptionsUI() { return new(nameof(FeaturesOverrideMod)) { Title = "Select features:", - Items = + Items = new List { // We don't know what some of these overrides do exactly, so hide them from the user. // The ID is the name of the registry key, the label is the display name - new AbstractBooleanUIElement("Apps", "Apps"), - new AbstractBooleanUIElement("Art", "Art"), - new AbstractBooleanUIElement("Channels", "Channels"), - new AbstractBooleanUIElement("FirstLaunchIntroVideo", "First Launch Intro Video"), - new AbstractBooleanUIElement("Games", "Games"), - new AbstractBooleanUIElement("Marketplace", "Marketplace"), - new AbstractBooleanUIElement("MBRPreview", "[Marketplace] Media Preview"), - new AbstractBooleanUIElement("MBRPurchase", "[Marketplace] Media Purchase"), - new AbstractBooleanUIElement("MBRRental", "[Marketplace] Media Rental"), - new AbstractBooleanUIElement("Music", "Music"), - new AbstractBooleanUIElement("MusicVideos", "Music Videos"), - new AbstractBooleanUIElement("Nowplaying", "Now Playing"), - new AbstractBooleanUIElement("NowplayingArt", "Now Playing Art"), - new AbstractBooleanUIElement("Picks", "Picks"), - new AbstractBooleanUIElement("Podcasts", "Podcasts"), - new AbstractBooleanUIElement("QuickMixLocal", "Quick Mix (Local)"), - new AbstractBooleanUIElement("QuickMixZMP", "Quick Mix (ZMP)"), - new AbstractBooleanUIElement("Quickplay", "Quickplay"), - new AbstractBooleanUIElement("Sign In Available", "Sign In"), - new AbstractBooleanUIElement("Social", "Social"), - new AbstractBooleanUIElement("SocialMarketplace", "Social Marketplace"), - new AbstractBooleanUIElement("SubscriptionFreeTracks", "Subscription Free Tracks"), - new AbstractBooleanUIElement("Videos", "Videos"), + new AbstractBoolean("Apps", "Apps"), + new AbstractBoolean("Art", "Art"), + new AbstractBoolean("Channels", "Channels"), + new AbstractBoolean("FirstLaunchIntroVideo", "First Launch Intro Video"), + new AbstractBoolean("Games", "Games"), + new AbstractBoolean("Marketplace", "Marketplace"), + new AbstractBoolean("MBRPreview", "[Marketplace] Media Preview"), + new AbstractBoolean("MBRPurchase", "[Marketplace] Media Purchase"), + new AbstractBoolean("MBRRental", "[Marketplace] Media Rental"), + new AbstractBoolean("Music", "Music"), + new AbstractBoolean("MusicVideos", "Music Videos"), + new AbstractBoolean("Nowplaying", "Now Playing"), + new AbstractBoolean("NowplayingArt", "Now Playing Art"), + new AbstractBoolean("Picks", "Picks"), + new AbstractBoolean("Podcasts", "Podcasts"), + new AbstractBoolean("QuickMixLocal", "Quick Mix (Local)"), + new AbstractBoolean("QuickMixZMP", "Quick Mix (ZMP)"), + new AbstractBoolean("Quickplay", "Quickplay"), + new AbstractBoolean("Sign In Available", "Sign In"), + new AbstractBoolean("Social", "Social"), + new AbstractBoolean("SocialMarketplace", "Social Marketplace"), + new AbstractBoolean("SubscriptionFreeTracks", "Subscription Free Tracks"), + new AbstractBoolean("Videos", "Videos"), } }; } @@ -62,10 +62,10 @@ namespace ZuneModCore.Mods { foreach (AbstractUIElement uiElem in OptionsUI.Items) { - if (uiElem is AbstractBooleanUIElement boolElem) + if (uiElem is AbstractBoolean boolElem) { bool? featureOverride = GetFeatureOverride(boolElem.Id); - boolElem.ChangeState(featureOverride ?? false); + boolElem.State = featureOverride ?? false; } } @@ -77,9 +77,9 @@ namespace ZuneModCore.Mods public async Task Apply(bool applyAll = false) { // Use user choices from AbstractUI - foreach (AbstractUIElement uiElem in OptionsUI.Items) + foreach (AbstractUIElement uiElem in OptionsUI!.Items) { - if (uiElem is AbstractBooleanUIElement boolElem && (boolElem.State || applyAll)) + if (uiElem is AbstractBoolean boolElem && (boolElem.State || applyAll)) { bool isSuccess = SetFeatureOverride(boolElem.Id, true); if (!isSuccess) @@ -103,8 +103,8 @@ namespace ZuneModCore.Mods public override async Task Reset() { - foreach (AbstractUIElement uiElem in OptionsUI.Items) - if (uiElem is AbstractBooleanUIElement boolElem) + foreach (AbstractUIElement uiElem in OptionsUI!.Items) + if (uiElem is AbstractBoolean boolElem) ResetFeatureOverride(boolElem.Id); return null; diff --git a/ZuneModCore/Mods/MbidLocatorMod.cs b/ZuneModCore/Mods/MbidLocatorMod.cs index b211b71..8aada30 100644 --- a/ZuneModCore/Mods/MbidLocatorMod.cs +++ b/ZuneModCore/Mods/MbidLocatorMod.cs @@ -24,15 +24,15 @@ namespace ZuneModCore.Mods public override string Author => "Joshua \"Yoshi\" Askharoun"; - public override AbstractUIElementGroup? GetDefaultOptionsUI() + public override AbstractUICollection? GetDefaultOptionsUI() { return new(nameof(MbidLocatorMod)) { Title = "Select music folder:", - Items = + Items = new List { new AbstractTextBox("folderBox", Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)), - new AbstractBooleanUIElement("recursiveBox", "Search recursively") + new AbstractBoolean("recursiveBox", "Search recursively") } }; } @@ -42,8 +42,8 @@ namespace ZuneModCore.Mods public override async Task Apply() { // Use user choices from AbstractUI - string folderPath = ((AbstractTextBox)OptionsUI.Items[0]).Value; - bool recursive = ((AbstractBooleanUIElement)OptionsUI.Items[1]).State; + string folderPath = ((AbstractTextBox)OptionsUI!.Items[0]).Value; + bool recursive = ((AbstractBoolean)OptionsUI.Items[1]).State; string errorString = string.Empty; // Verify that the folder exists diff --git a/ZuneModCore/Mods/WebservicesMod.cs b/ZuneModCore/Mods/WebservicesMod.cs index 9160070..1be753e 100644 --- a/ZuneModCore/Mods/WebservicesMod.cs +++ b/ZuneModCore/Mods/WebservicesMod.cs @@ -21,12 +21,12 @@ namespace ZuneModCore.Mods public override string Author => "Joshua \"Yoshi\" Askharoun"; - public override AbstractUIElementGroup? GetDefaultOptionsUI() + public override AbstractUICollection? GetDefaultOptionsUI() { return new(nameof(FeaturesOverrideMod)) { Title = string.Empty, - Items = + Items = new List { new AbstractTextBox("hostBox", "zunes.me", "zune.net") { diff --git a/ZuneModCore/ZuneModCore.csproj b/ZuneModCore/ZuneModCore.csproj index 9a709d5..51cca04 100644 --- a/ZuneModCore/ZuneModCore.csproj +++ b/ZuneModCore/ZuneModCore.csproj @@ -9,7 +9,7 @@ - + diff --git a/ZuneModdingHelper/AbstractUIGroupDialog.xaml.cs b/ZuneModdingHelper/AbstractUIGroupDialog.xaml.cs index 80a0084..b2aa71a 100644 --- a/ZuneModdingHelper/AbstractUIGroupDialog.xaml.cs +++ b/ZuneModdingHelper/AbstractUIGroupDialog.xaml.cs @@ -11,13 +11,13 @@ namespace ZuneModdingHelper /// public partial class AbstractUIGroupDialog : MetroWindow { - public AbstractUIGroupDialog(AbstractUIElementGroupViewModel viewModel) + public AbstractUIGroupDialog(AbstractUICollectionViewModel viewModel) { ViewModel = viewModel; DataContext = ViewModel; InitializeComponent(); } - public AbstractUIGroupDialog(AbstractUIElementGroup group) : this(new AbstractUIElementGroupViewModel(group)) + public AbstractUIGroupDialog(AbstractUICollection group) : this(new AbstractUICollectionViewModel(group)) { } @@ -32,12 +32,12 @@ namespace ZuneModdingHelper Close(); } - public AbstractUIElementGroupViewModel ViewModel + public AbstractUICollectionViewModel ViewModel { - get => (AbstractUIElementGroupViewModel)GetValue(ViewModelProperty); + get => (AbstractUICollectionViewModel)GetValue(ViewModelProperty); set => SetValue(ViewModelProperty, value); } public static readonly DependencyProperty ViewModelProperty = DependencyProperty.Register( - nameof(ViewModel), typeof(AbstractUIElementGroupViewModel), typeof(AbstractUIGroupDialog)); + nameof(ViewModel), typeof(AbstractUICollectionViewModel), typeof(AbstractUIGroupDialog)); } } diff --git a/ZuneModdingHelper/MainWindow.xaml.cs b/ZuneModdingHelper/MainWindow.xaml.cs index ac306a0..406671a 100644 --- a/ZuneModdingHelper/MainWindow.xaml.cs +++ b/ZuneModdingHelper/MainWindow.xaml.cs @@ -68,7 +68,7 @@ namespace ZuneModdingHelper await progDialog.CloseAsync(); return; } - mod.OptionsUI = (AbstractUIElementGroup)optionsDialog.ViewModel.Model; + mod.OptionsUI = (AbstractUICollection)optionsDialog.ViewModel.Model; } progDialog.SetProgress(++numCompleted); @@ -116,7 +116,7 @@ namespace ZuneModdingHelper //if (mod.OptionsUI != null) //{ // var optionsDialog = new AbstractUIGroupDialog(); - // optionsDialog.OptionsUIPresenter.ViewModel = new AbstractUIElementGroupViewModel(mod.OptionsUI); + // optionsDialog.OptionsUIPresenter.ViewModel = new AbstractUICollectionViewModel(mod.OptionsUI); // optionsDialog.ShowDialog(); //} diff --git a/ZuneModdingHelper/ZuneModdingHelper.csproj b/ZuneModdingHelper/ZuneModdingHelper.csproj index 2e2122a..82b1615 100644 --- a/ZuneModdingHelper/ZuneModdingHelper.csproj +++ b/ZuneModdingHelper/ZuneModdingHelper.csproj @@ -20,11 +20,11 @@ - - - - - + + + + +