diff --git a/source/iNKORE.UI.WPF.Modern.Controls/Controls/AutoSuggestBox/AutoSuggestBox.cs b/source/iNKORE.UI.WPF.Modern.Controls/Controls/AutoSuggestBox/AutoSuggestBox.cs index ca67208..e293630 100644 --- a/source/iNKORE.UI.WPF.Modern.Controls/Controls/AutoSuggestBox/AutoSuggestBox.cs +++ b/source/iNKORE.UI.WPF.Modern.Controls/Controls/AutoSuggestBox/AutoSuggestBox.cs @@ -179,26 +179,29 @@ private void OnIsSuggestionListOpenChanged(DependencyPropertyChangedEventArgs ar private void OnQueryIconChanged(DependencyPropertyChangedEventArgs args) { - OnQueryIconChanged(args.OldValue as IconElement, args.NewValue as IconElement); + OnQueryIconChanged(args.OldValue, args.NewValue); } - private void OnQueryIconChanged(IconElement oldQueryIcon, IconElement newQueryIcon) + private void OnQueryIconChanged(object oldQueryIcon, object newQueryIcon) { if (oldQueryIcon != null) { - oldQueryIcon.ClearValue(IconElement.ForegroundProperty); - - if (newQueryIcon is FontIcon) + if (oldQueryIcon is IconElement oldQueryIconElement) { - oldQueryIcon.ClearValue(FontIcon.FontSizeProperty); + oldQueryIconElement.ClearValue(IconElement.ForegroundProperty); + + if (oldQueryIconElement is FontIcon) + { + oldQueryIconElement.ClearValue(FontIcon.FontSizeProperty); + } } } if (newQueryIcon != null && m_queryButton != null) { - if (newQueryIcon is FontIcon) + if (newQueryIcon is FontIcon newQueryIconFontIcon) { - newQueryIcon.SetBinding(FontIcon.FontSizeProperty, + newQueryIconFontIcon.SetBinding(FontIcon.FontSizeProperty, new Binding { Path = new PropertyPath(TextElement.FontSizeProperty), diff --git a/source/iNKORE.UI.WPF.Modern.Controls/Controls/AutoSuggestBox/AutoSuggestBox.properties.cs b/source/iNKORE.UI.WPF.Modern.Controls/Controls/AutoSuggestBox/AutoSuggestBox.properties.cs index f963fce..df2484a 100644 --- a/source/iNKORE.UI.WPF.Modern.Controls/Controls/AutoSuggestBox/AutoSuggestBox.properties.cs +++ b/source/iNKORE.UI.WPF.Modern.Controls/Controls/AutoSuggestBox/AutoSuggestBox.properties.cs @@ -155,13 +155,13 @@ public object Header public static readonly DependencyProperty QueryIconProperty = DependencyProperty.Register( nameof(QueryIcon), - typeof(IconElement), + typeof(object), typeof(AutoSuggestBox), new PropertyMetadata(null, OnQueryIconPropertyChanged)); - public IconElement QueryIcon + public object QueryIcon { - get => (IconElement)GetValue(QueryIconProperty); + get => (object)GetValue(QueryIconProperty); set => SetValue(QueryIconProperty, value); } diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/Common/Category.cs b/source/iNKORE.UI.WPF.Modern.Gallery/Common/Category.cs index 860ac6c..960cd13 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/Common/Category.cs +++ b/source/iNKORE.UI.WPF.Modern.Gallery/Common/Category.cs @@ -1,4 +1,5 @@ -using iNKORE.UI.WPF.Modern.Controls; +using iNKORE.UI.WPF.Modern.Common.IconKeys; +using iNKORE.UI.WPF.Modern.Controls; using System; namespace iNKORE.UI.WPF.Modern.Gallery.Common @@ -10,7 +11,7 @@ public class Category : CategoryBase { public string Name { get; set; } public string Tooltip { get; set; } - public Symbol Glyph { get; set; } + public FontIconData Icon { get; set; } //public Type TargetType { get; set; } } diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/AutoSuggestBoxPage.xaml b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/AutoSuggestBoxPage.xaml index 0140021..95d19ab 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/AutoSuggestBoxPage.xaml +++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/AutoSuggestBoxPage.xaml @@ -93,10 +93,13 @@ private void AutoSuggestBox_SuggestionChosen(AutoSuggestBox sender, AutoSuggestB Width="300" HorizontalAlignment="Left" PlaceholderText="Type a control name" - QueryIcon="Find" QuerySubmitted="Control2_QuerySubmitted" SuggestionChosen="Control2_SuggestionChosen" - TextChanged="Control2_TextChanged" /> + TextChanged="Control2_TextChanged"> + + + + - + @@ -97,20 +97,32 @@ + Tag="SamplePage1"> + + + + + Tag="SamplePage2"> + + + + + Tag="SamplePage3"> + + + + + Tag="SamplePage4"> + + + + @@ -253,6 +265,7 @@ Grid.Row="2" Height="460" IsTabStop="False" + IsPaneOpen="False" MenuItemTemplateSelector="{StaticResource selector}" MenuItemsSource="{Binding Categories, Mode=OneWay}" SelectionChanged="NavigationView_SelectionChanged4"> @@ -325,43 +338,62 @@ + ToolTipService.ToolTip="Home"> + + + + + + + + ToolTipService.ToolTip="Mail"> + + + + + ToolTipService.ToolTip="Calendar"> + + + + + + + + ToolTipService.ToolTip="Create new"> + + + + + ToolTipService.ToolTip="Upload file"> + + + + @@ -498,7 +530,11 @@ - + + + + + @@ -506,8 +542,16 @@ x:Name="FooterStackPanel" Orientation="Vertical" Visibility="Collapsed"> - - + + + + + + + + + + diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/NavigationViewPage.xaml.cs b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/NavigationViewPage.xaml.cs index d922f29..27c669d 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/NavigationViewPage.xaml.cs +++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/NavigationViewPage.xaml.cs @@ -38,11 +38,11 @@ public NavigationViewPage() nvSample8.SelectedItem = nvSample8.MenuItems.OfType().First(); Categories = new ObservableCollection(); - Category firstCategory = new Category { Name = "Category 1", Glyph = Symbol.Home, Tooltip = "This is category 1" }; + Category firstCategory = new Category { Name = "Category 1", Icon = SegoeFluentIcons.Home, Tooltip = "This is category 1" }; Categories.Add(firstCategory); - Categories.Add(new Category { Name = "Category 2", Glyph = Symbol.Keyboard, Tooltip = "This is category 2" }); - Categories.Add(new Category { Name = "Category 3", Glyph = Symbol.Library, Tooltip = "This is category 3" }); - Categories.Add(new Category { Name = "Category 4", Glyph = Symbol.Mail, Tooltip = "This is category 4" }); + Categories.Add(new Category { Name = "Category 2", Icon = SegoeFluentIcons.KeyboardFull, Tooltip = "This is category 2" }); + Categories.Add(new Category { Name = "Category 3", Icon = SegoeFluentIcons.Library, Tooltip = "This is category 3" }); + Categories.Add(new Category { Name = "Category 4", Icon = SegoeFluentIcons.Mail, Tooltip = "This is category 4" }); Loaded += delegate { nvSample4.SelectedItem ??= firstCategory; @@ -203,12 +203,12 @@ private void databindHeader_Checked(object sender, RoutedEventArgs e) Categories = new ObservableCollection() { new Header { Name = "Header1 "}, - new Category { Name = "Category 1", Glyph = Symbol.Home, Tooltip = "This is category 1" }, - new Category { Name = "Category 2", Glyph = Symbol.Keyboard, Tooltip = "This is category 2" }, + new Category { Name = "Category 1", Icon = SegoeFluentIcons.Home, Tooltip = "This is category 1" }, + new Category { Name = "Category 2", Icon = SegoeFluentIcons.KeyboardFull, Tooltip = "This is category 2" }, new Separator(), new Header { Name = "Header2 "}, - new Category {Name = "Category 3", Glyph = Symbol.Library, Tooltip = "This is category 3" }, - new Category {Name = "Category 4", Glyph = Symbol.Mail, Tooltip = "This is category 3" } + new Category {Name = "Category 3", Icon = SegoeFluentIcons.Library, Tooltip = "This is category 3" }, + new Category {Name = "Category 4", Icon = SegoeFluentIcons.Mail, Tooltip = "This is category 3" } }; } @@ -216,10 +216,10 @@ private void databindHeader_Checked_Unchecked(object sender, RoutedEventArgs e) { Categories = new ObservableCollection() { - new Category { Name = "Category 1", Glyph = Symbol.Home, Tooltip = "This is category 1" }, - new Category { Name = "Category 2", Glyph = Symbol.Keyboard, Tooltip = "This is category 2" }, - new Category {Name = "Category 3", Glyph = Symbol.Library, Tooltip = "This is category 3" }, - new Category {Name = "Category 4", Glyph = Symbol.Mail, Tooltip = "This is category 3" } + new Category { Name = "Category 1", Icon = SegoeFluentIcons.Home, Tooltip = "This is category 1" }, + new Category { Name = "Category 2", Icon = SegoeFluentIcons.KeyboardFull, Tooltip = "This is category 2" }, + new Category {Name = "Category 3", Icon = SegoeFluentIcons.Library, Tooltip = "This is category 3" }, + new Category {Name = "Category 4", Icon = SegoeFluentIcons.Mail, Tooltip = "This is category 3" } }; } diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPagesSampleCode/NavigationView/NavigationViewSample5.txt b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPagesSampleCode/NavigationView/NavigationViewSample5.txt index 5874f7e..5e20f91 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPagesSampleCode/NavigationView/NavigationViewSample5.txt +++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPagesSampleCode/NavigationView/NavigationViewSample5.txt @@ -18,10 +18,10 @@ //C# code behind Categories = new ObservableCollection(); -Categories.Add(new Category { Name = "Category 1", Glyph = Symbol.Home, Tooltip = "This is category 1" }); -Categories.Add(new Category { Name = "Category 2", Glyph = Symbol.Keyboard, Tooltip = "This is category 2" }); -Categories.Add(new Category { Name = "Category 3", Glyph = Symbol.Library, Tooltip = "This is category 3" }); -Categories.Add(new Category { Name = "Category 4", Glyph = Symbol.Mail, Tooltip = "This is category 4" }); +Categories.Add(new Category { Name = "Category 1", Icon = SegoeFluentIcons.Home, Tooltip = "This is category 1" }); +Categories.Add(new Category { Name = "Category 2", Icon = SegoeFluentIcons.KeyboardFull, Tooltip = "This is category 2" }); +Categories.Add(new Category { Name = "Category 3", Icon = SegoeFluentIcons.Library, Tooltip = "This is category 3" }); +Categories.Add(new Category { Name = "Category 4", Icon = SegoeFluentIcons.Mail, Tooltip = "This is category 4" }); public class CategoryBase { } diff --git a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPagesSampleCode/NavigationView/NavigationViewSample5_cs.txt b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPagesSampleCode/NavigationView/NavigationViewSample5_cs.txt index 3f55cb2..879f0d2 100644 --- a/source/iNKORE.UI.WPF.Modern.Gallery/ControlPagesSampleCode/NavigationView/NavigationViewSample5_cs.txt +++ b/source/iNKORE.UI.WPF.Modern.Gallery/ControlPagesSampleCode/NavigationView/NavigationViewSample5_cs.txt @@ -1,9 +1,9 @@ //C# code behind Categories = new ObservableCollection(); -Categories.Add(new Category { Name = "Category 1", Glyph = Symbol.Home, Tooltip = "This is category 1" }); -Categories.Add(new Category { Name = "Category 2", Glyph = Symbol.Keyboard, Tooltip = "This is category 2" }); -Categories.Add(new Category { Name = "Category 3", Glyph = Symbol.Library, Tooltip = "This is category 3" }); -Categories.Add(new Category { Name = "Category 4", Glyph = Symbol.Mail, Tooltip = "This is category 4" }); +Categories.Add(new Category { Name = "Category 1", Icon = SegoeFluentIcons.Home, Tooltip = "This is category 1" }); +Categories.Add(new Category { Name = "Category 2", Icon = SegoeFluentIcons.KeyboardFull, Tooltip = "This is category 2" }); +Categories.Add(new Category { Name = "Category 3", Icon = SegoeFluentIcons.Library, Tooltip = "This is category 3" }); +Categories.Add(new Category { Name = "Category 4", Icon = SegoeFluentIcons.Mail, Tooltip = "This is category 4" }); public class CategoryBase { }