Skip to content

Commit

Permalink
feat(Symbol): Add missing symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Sep 9, 2020
1 parent 27494ee commit ce04184
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<Grid>
<ListView ItemsSource="{x:Bind Symbols}">
<ListView.ItemTemplate>
<DataTemplate>
<DataTemplate x:DataType="local:SymbolListItem">
<StackPanel Orientation="Horizontal" Spacing="8">
<SymbolIcon Symbol="{Binding Symbol}" />
<TextBlock Text="{Binding Name}" />
<SymbolIcon Symbol="{x:Bind Symbol}" />
<TextBlock Text="{x:Bind Name}" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ public SymbolIcon_Generic()
this.InitializeComponent();
}

public List<SymbolItem> Symbols { get; } =
public List<SymbolListItem> Symbols { get; } =
Enum.GetValues(typeof(Symbol))
.Cast<Symbol>()
.Select(symbol => new SymbolItem(symbol))
.ToList();
.Select(symbol => new SymbolListItem(symbol))
.ToList();
}

public class SymbolItem
public class SymbolListItem
{
public SymbolListItem(Symbol symbol)
{
public SymbolItem(Symbol symbol)
{
Symbol = symbol;
Name = Enum.GetName(typeof(Symbol), symbol);
}
Symbol = symbol;
Name = Enum.GetName(typeof(Symbol), symbol);
}

public Symbol Symbol { get; }
public Symbol Symbol { get; }

public string Name { get; }
}
}
public string Name { get; }
}
}
24 changes: 8 additions & 16 deletions src/Uno.UI/Generated/3.0.0.0/Windows.UI.Xaml.Controls/Symbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#pragma warning disable 114 // new keyword hiding
namespace Windows.UI.Xaml.Controls
{
#if false || false || false || false || false || false || false
#if false || false || false || false || false || false || false
#if false || false || false || false || false || false || false
#if false || false || false || false || false || false || false
[global::Uno.NotImplemented]
#endif
#endif
public enum Symbol
{
// Skipping already declared field Windows.UI.Xaml.Controls.Symbol.Previous
Expand Down Expand Up @@ -201,18 +201,10 @@ public enum Symbol
// Skipping already declared field Windows.UI.Xaml.Controls.Symbol.FourBars
// Skipping already declared field Windows.UI.Xaml.Controls.Symbol.Scan
// Skipping already declared field Windows.UI.Xaml.Controls.Symbol.Preview
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
GlobalNavigationButton,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
Share,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
Print,
#endif
#if __ANDROID__ || __IOS__ || NET461 || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
XboxOneConsole,
#endif
// Skipping already declared field Windows.UI.Xaml.Controls.Symbol.GlobalNavigationButton
// Skipping already declared field Windows.UI.Xaml.Controls.Symbol.Share
// Skipping already declared field Windows.UI.Xaml.Controls.Symbol.Print
// Skipping already declared field Windows.UI.Xaml.Controls.Symbol.XboxOneConsole
}
#endif
#endif
}
13 changes: 7 additions & 6 deletions src/Uno.UI/UI/Xaml/Controls/Symbol.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Windows.Foundation;
using Windows.Foundation.Metadata;

namespace Windows.UI.Xaml.Controls
namespace Windows.UI.Xaml.Controls
{
public enum Symbol
{
Expand Down Expand Up @@ -197,6 +194,10 @@ public enum Symbol
ThreeBars = 57832,
FourBars = 57833,
Scan = 58004,
Preview = 58005
Preview = 58005,
GlobalNavigationButton = 59136,
Share = 59181,
Print = 59209,
XboxOneConsole = 59792
}
}
}
2 changes: 1 addition & 1 deletion src/Uno.UI/UI/Xaml/Controls/SymbolIcon/SymbolIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public Symbol Symbol
}

public static DependencyProperty SymbolProperty { get; } =
DependencyProperty.Register("Symbol", typeof(Symbol), typeof(SymbolIcon), new FrameworkPropertyMetadata(Symbol.Emoji, OnSymbolChanged));
DependencyProperty.Register(nameof(Symbol), typeof(Symbol), typeof(SymbolIcon), new FrameworkPropertyMetadata(Symbol.Emoji, OnSymbolChanged));

private static void OnSymbolChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
{
Expand Down

0 comments on commit ce04184

Please sign in to comment.