diff --git a/Uno.Gallery/Uno.Gallery.Shared/Converters/SecretConverter.cs b/Uno.Gallery/Uno.Gallery.Shared/Converters/SecretConverter.cs deleted file mode 100644 index 361deb663..000000000 --- a/Uno.Gallery/Uno.Gallery.Shared/Converters/SecretConverter.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Data; -using Uno.Toolkit.UI; -using Windows.UI; - -namespace Uno.Gallery.Converters -{ - public class SecretConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, string language) - { - var shadowContainerSource = value as ShadowCollection; - var thirdShadow = shadowContainerSource?.ElementAtOrDefault(2); - - if (shadowContainerSource != null && thirdShadow != null) - { - var isThirdShadowSuccess = thirdShadow.Color.Equals(Color.FromArgb(255, 34, 157, 252)) && thirdShadow.IsInner == true; - - if (isThirdShadowSuccess && (string)parameter == "HiddenSecret") - { - return GetAnswer(); - } - else if (isThirdShadowSuccess && (string)parameter == "SecretShadowCombination") - { - return Visibility.Visible; - } - else - { - return Visibility.Collapsed; - } - } - else - { - return Visibility.Collapsed; - } - } - - private string GetAnswer() - { - var keys = Application.Current.Resources.MergedDictionaries - .SelectMany(x => x.Keys) - .OfType() - .ToArray(); - - var a = keys - .GroupBy(x => Regex.Replace(x, "([A-Z][a-z]+)([A-Z][a-z]+){2}", "$2")) - .OrderBy(x => x.Count()) - .Select(x => x.Key) - .LastOrDefault(); - - var answer = a[0].ToString().ToLower(); - - return answer; - } - - public object ConvertBack(object value, Type targetType, object parameter, string language) => throw new NotSupportedException("Only one-way conversion is supported."); - } -} diff --git a/Uno.Gallery/Uno.Gallery.Shared/Uno.Gallery.Shared.projitems b/Uno.Gallery/Uno.Gallery.Shared/Uno.Gallery.Shared.projitems index e0c6712c9..dbc7c6d0e 100644 --- a/Uno.Gallery/Uno.Gallery.Shared/Uno.Gallery.Shared.projitems +++ b/Uno.Gallery/Uno.Gallery.Shared/Uno.Gallery.Shared.projitems @@ -157,7 +157,6 @@ - diff --git a/Uno.Gallery/Uno.Gallery.Shared/Views/Converters.xaml b/Uno.Gallery/Uno.Gallery.Shared/Views/Converters.xaml index 12447952c..7b83b24f7 100644 --- a/Uno.Gallery/Uno.Gallery.Shared/Views/Converters.xaml +++ b/Uno.Gallery/Uno.Gallery.Shared/Views/Converters.xaml @@ -41,6 +41,4 @@ Provider="HashCode" /> - - diff --git a/Uno.Gallery/Uno.Gallery.Shared/Views/SamplePages/ShadowContainerSamplePage.xaml b/Uno.Gallery/Uno.Gallery.Shared/Views/SamplePages/ShadowContainerSamplePage.xaml index 986694786..ed91d022f 100644 --- a/Uno.Gallery/Uno.Gallery.Shared/Views/SamplePages/ShadowContainerSamplePage.xaml +++ b/Uno.Gallery/Uno.Gallery.Shared/Views/SamplePages/ShadowContainerSamplePage.xaml @@ -1076,44 +1076,6 @@ - - - - - - - - - - - - - - - - - - - 1; - _shadows.Cast().ToList().ForEach(shadow => shadow.PropertyChanged += (s, e) => OnShadowChanged()); - } - - private void OnShadowChanged() - { - //Put it back to null to force the DataContext to be picked up again by the converter. - TreasureHuntSection.DataContext = null; - TreasureHuntSection.DataContext = ShadowsItemsRepeater.ItemsSource; } private void AddShadow(object sender, RoutedEventArgs e)