Replace fonts for symbols in navigation

This commit is contained in:
Martin Vega 2017-03-14 08:58:39 +01:00
Родитель 05cbfc171e
Коммит 9e4e722d23
8 изменённых файлов: 18 добавлений и 14 удалений

Просмотреть файл

@ -6,7 +6,7 @@ namespace ItemNamespace.Shell
public ShellViewModel() public ShellViewModel()
{ {
//^^ //^^
_navigationItems.Add(ShellNavigationItem.FromType<uct.ItemNamePage>("Shell_uct.ItemName".GetLocalized(), Char.ConvertFromUtf32(0xE130))); _navigationItems.Add(ShellNavigationItem.FromType<uct.ItemNamePage>("Shell_uct.ItemName".GetLocalized(), Symbol.Document));
SelectedItem = NavigationItems.FirstOrDefault(); SelectedItem = NavigationItems.FirstOrDefault();
} }
} }

Просмотреть файл

@ -6,20 +6,21 @@ namespace uct.ItemName.Shell
{ {
public class ShellNavigationItem public class ShellNavigationItem
{ {
public string Glyph { get; set; } public string Name { get; set; }
public string Name { get; set; } public Symbol Symbol { get; set; }
public char SymbolAsChar { get { return (char)Symbol; } }
public Type PageType { get; set; } public Type PageType { get; set; }
private ShellNavigationItem(string name, string glyph, Type pageType) private ShellNavigationItem(string name, Symbol symbol, Type pageType)
{ {
this.Name = name; this.Name = name;
this.Glyph = glyph; this.Symbol = symbol;
this.PageType = pageType; this.PageType = pageType;
} }
public static ShellNavigationItem FromType<T>(string name, string glyph) where T : Page public static ShellNavigationItem FromType<T>(string name, Symbol symbol) where T : Page
{ {
return new ShellNavigationItem(name, glyph, typeof(T)); return new ShellNavigationItem(name, symbol, typeof(T));
} }
} }
} }

Просмотреть файл

@ -16,7 +16,7 @@
<FontIcon <FontIcon
Grid.Column="0" Grid.Column="0"
Margin="12" Margin="12"
Glyph="{x:Bind Glyph}" Glyph="{x:Bind SymbolAsChar}"
FontFamily="Segoe MDL2 Assets" FontFamily="Segoe MDL2 Assets"
Foreground="{ThemeResource SystemBaseHighColor}" /> Foreground="{ThemeResource SystemBaseHighColor}" />
<TextBlock <TextBlock

Просмотреть файл

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Input; using System.Windows.Input;
using System.Linq; using System.Linq;
using Windows.UI.Xaml.Controls;
using uct.ItemName.Mvvm; using uct.ItemName.Mvvm;
namespace uct.ItemName.Shell namespace uct.ItemName.Shell

Просмотреть файл

@ -6,7 +6,7 @@ namespace ItemNamespace.Shell
public ShellViewModel() public ShellViewModel()
{ {
//^^ //^^
_navigationItems.Add(new ShellNavigationItem("Shell_uct.ItemName".GetLocalized(), Char.ConvertFromUtf32(0xE130), typeof(uct.ItemNameViewModel).FullName)); _navigationItems.Add(new ShellNavigationItem("Shell_uct.ItemName".GetLocalized(), Symbol.Document, typeof(uct.ItemNameViewModel).FullName));
SelectedItem = NavigationItems.FirstOrDefault(); SelectedItem = NavigationItems.FirstOrDefault();
} }
} }

Просмотреть файл

@ -6,14 +6,15 @@ namespace uct.ItemName.Shell
{ {
public class ShellNavigationItem public class ShellNavigationItem
{ {
public string Glyph { get; set; } public string Name { get; set; }
public string Name { get; set; } public Symbol Symbol { get; set; }
public char SymbolAsChar { get { return (char)Symbol; } }
public string ViewModelName { get; set; } public string ViewModelName { get; set; }
public ShellNavigationItem(string name, string glyph, string viewModelName) public ShellNavigationItem(string name, Symbol symbol, string viewModelName)
{ {
this.Name = name; this.Name = name;
this.Glyph = glyph; this.Symbol = symbol;
this.ViewModelName = viewModelName; this.ViewModelName = viewModelName;
} }
} }

Просмотреть файл

@ -17,7 +17,7 @@
<FontIcon <FontIcon
Grid.Column="0" Grid.Column="0"
Margin="12" Margin="12"
Glyph="{x:Bind Glyph}" Glyph="{x:Bind SymbolAsChar}"
FontFamily="Segoe MDL2 Assets" FontFamily="Segoe MDL2 Assets"
Foreground="{ThemeResource SystemBaseHighColor}" /> Foreground="{ThemeResource SystemBaseHighColor}" />
<TextBlock <TextBlock

Просмотреть файл

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Input; using System.Windows.Input;
using System.Linq; using System.Linq;
using Windows.UI.Xaml.Controls;
using GalaSoft.MvvmLight; using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command; using GalaSoft.MvvmLight.Command;