Skip to content

Commit

Permalink
Fix some damn warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
NotYoojun committed May 27, 2024
1 parent ecdf3ea commit b22cc1b
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,17 @@ private void OnQueryIconChanged(IconElement oldQueryIcon, IconElement newQueryIc
{
oldQueryIcon.ClearValue(IconElement.ForegroundProperty);

if (newQueryIcon is SymbolIcon)
if (newQueryIcon is FontIcon)
{
oldQueryIcon.ClearValue(SymbolIcon.FontSizeProperty);
oldQueryIcon.ClearValue(FontIcon.FontSizeProperty);
}
}

if (newQueryIcon != null && m_queryButton != null)
{
if (newQueryIcon is SymbolIcon)
if (newQueryIcon is FontIcon)
{
newQueryIcon.SetBinding(SymbolIcon.FontSizeProperty,
newQueryIcon.SetBinding(FontIcon.FontSizeProperty,
new Binding
{
Path = new PropertyPath(TextElement.FontSizeProperty),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using iNKORE.UI.WPF.Helpers;
using iNKORE.UI.WPF.Modern.Automation.Peers;
using iNKORE.UI.WPF.Modern.Common;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using iNKORE.UI.WPF.Modern.Helpers;
using iNKORE.UI.WPF.Modern.Input;
Expand Down Expand Up @@ -1384,7 +1385,7 @@ void CreateAndHookEventsToSettings()
}

var settingsItem = m_settingsItem;
var settingsIcon = new SymbolIcon(Symbol.Setting);
var settingsIcon = new FontIcon(SegoeFluentIcons.Settings); //SymbolIcon(Symbol.Setting);
settingsItem.Icon = settingsIcon;

// Do localization for settings item label and Automation Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public override void OnApplyTemplate()
m_isTemplateApplied = true;
}

private void OnPropertyChanged(DependencyPropertyChangedEventArgs args)
private new void OnPropertyChanged(DependencyPropertyChangedEventArgs args)
{
DependencyProperty property = args.Property;

Expand Down
Original file line number Diff line number Diff line change
@@ -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.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
Expand Down Expand Up @@ -38,7 +39,7 @@ void AppBarButtonPage_Loaded(object sender, RoutedEventArgs e)

compactButton = new AppBarToggleButton
{
Icon = new SymbolIcon(Symbol.FontSize),
Icon = new FontIcon(SegoeFluentIcons.FontSize),
Label = "IsCompact"
};
compactButton.Click += CompactButton_Click;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
Expand Down Expand Up @@ -37,7 +38,7 @@ void AppBarButtonPage_Loaded(object sender, RoutedEventArgs e)

compactButton = new AppBarToggleButton
{
Icon = new SymbolIcon(Symbol.FontSize),
Icon = new FontIcon(SegoeFluentIcons.FontSize),
Label = "IsCompact"
};
compactButton.Click += CompactButton_Click;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
Expand Down Expand Up @@ -37,7 +38,7 @@ void AppBarButtonPage_Loaded(object sender, RoutedEventArgs e)

compactButton = new AppBarToggleButton
{
Icon = new SymbolIcon(Symbol.FontSize),
Icon = new FontIcon(SegoeFluentIcons.FontSize),
Label = "IsCompact"
};
compactButton.Click += CompactButton_Click;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using SamplesCommon;
using System.Collections.Generic;
using System.Collections.ObjectModel;
Expand Down Expand Up @@ -62,15 +63,15 @@ private void AddSecondaryCommands_Click(object sender, RoutedEventArgs e)
{
var newButton = new AppBarButton
{
Icon = new SymbolIcon(Symbol.Add),
Icon = new FontIcon(SegoeFluentIcons.Add),
Label = "Button 1"
};
newButton.AddKeyboardAccelerator(Key.N, ModifierKeys.Control);
PrimaryCommandBar.SecondaryCommands.Add(newButton);

newButton = new AppBarButton
{
Icon = new SymbolIcon(Symbol.Delete),
Icon = new FontIcon(SegoeFluentIcons.Delete),
Label = "Button 2"
};
PrimaryCommandBar.SecondaryCommands.Add(newButton);
Expand All @@ -79,15 +80,15 @@ private void AddSecondaryCommands_Click(object sender, RoutedEventArgs e)

newButton = new AppBarButton
{
Icon = new SymbolIcon(Symbol.FontDecrease),
Icon = new FontIcon(SegoeFluentIcons.FontDecrease),
Label = "Button 3"
};
newButton.AddKeyboardAccelerator(Key.Subtract, ModifierKeys.Control);
PrimaryCommandBar.SecondaryCommands.Add(newButton);

newButton = new AppBarButton
{
Icon = new SymbolIcon(Symbol.FontIncrease),
Icon = new FontIcon(SegoeFluentIcons.FontIncrease),
Label = "Button 4"
};
newButton.AddKeyboardAccelerator(Key.Add, ModifierKeys.Control);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using SamplesCommon;
using Separator = iNKORE.UI.WPF.Modern.Gallery.Common.Separator;
using VirtualKey = System.Windows.Input.Key;
using iNKORE.UI.WPF.Modern.Common.IconKeys;

namespace iNKORE.UI.WPF.Modern.Gallery.ControlPages
{
Expand Down Expand Up @@ -261,7 +262,7 @@ private void autoSuggestCheck_Click(object sender, RoutedEventArgs e)
{
if ((sender as CheckBox).IsChecked == true)
{
AutoSuggestBox asb = new AutoSuggestBox() { QueryIcon = new SymbolIcon(Symbol.Find) };
AutoSuggestBox asb = new AutoSuggestBox() { QueryIcon = new FontIcon(SegoeFluentIcons.Search) };
asb.SetValue(AutomationProperties.NameProperty, "search");
nvSample.AutoSuggestBox = asb;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using SamplesCommon.SamplePages;
Expand Down Expand Up @@ -36,7 +37,7 @@ private TabItem CreateNewTab(int index)
TabItem newItem = new TabItem();

newItem.Header = $"Document {index}";
TabItemHelper.SetIcon(newItem, new SymbolIcon(Symbol.Document));
TabItemHelper.SetIcon(newItem, new FontIcon(SegoeFluentIcons.Document));

// The content of the tab is often a frame that contains a page, though it could be any UIElement.
Frame frame = new Frame();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
VerticalAlignment="Top"
AutomationProperties.Name="Bullets"
IsCheckedChanged="MyListButton_IsCheckedChanged">
<ui:SymbolIcon x:Name="mySymbolIcon" Symbol="List" />
<ui:FontIcon x:Name="mySymbolIcon" Icon="{x:Static ui:SegoeFluentIcons.List}"/>
<ui:ToggleSplitButton.Flyout>
<ui:Flyout Placement="Bottom">
<StackPanel Orientation="Horizontal">
Expand All @@ -35,10 +35,10 @@
</Style>
</StackPanel.Resources>
<Button AutomationProperties.Name="Bulleted list" Click="BulletButton_Click">
<ui:SymbolIcon Symbol="List" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.List}" />
</Button>
<Button AutomationProperties.Name="Roman numerals list" Click="BulletButton_Click">
<ui:SymbolIcon Symbol="Bullets" />
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.BulletedList}" />
</Button>
</StackPanel>
</ui:Flyout>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -32,18 +33,18 @@ public ToggleSplitButtonPage()
private void BulletButton_Click(object sender, RoutedEventArgs e)
{
Button clickedBullet = (Button)sender;
SymbolIcon symbol = (SymbolIcon)clickedBullet.Content;
var symbol = (FontIcon)clickedBullet.Content;

if (symbol.Symbol == Symbol.List)
if (symbol.Glyph == SegoeFluentIcons.List.Glyph)
{
_type = "";
mySymbolIcon.Symbol = Symbol.List;
mySymbolIcon.Icon = SegoeFluentIcons.List;
myListButton.SetValue(AutomationProperties.NameProperty, "Bullets");
}
else if (symbol.Symbol == Symbol.Bullets)
else if (symbol.Glyph == SegoeFluentIcons.BulletedList.Glyph)
{
_type = "I)";
mySymbolIcon.Symbol = Symbol.Bullets;
mySymbolIcon.Icon = SegoeFluentIcons.BulletedList;
myListButton.SetValue(AutomationProperties.NameProperty, "Roman Numerals");
}
myRichEditBox.Selection.Text = _type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using Windows.Foundation.Metadata;
using System.Windows.Markup;
using iNKORE.UI.WPF.Modern.Gallery.Controls;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
Expand Down
4 changes: 2 additions & 2 deletions source/iNKORE.UI.WPF.Modern.Gallery/PageHeader.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
Visibility="Collapsed">
<ui:AppBarButton x:Name="CopyLinkButton" Click="OnCopyLinkButtonClick">
<ui:AppBarButton.Icon>
<ui:SymbolIcon
<ui:FontIcon
x:Name="CopyLinkButtonIcon"
Margin="0,-2,0,0"
Symbol="Link" />
Icon="{x:Static ui:SegoeFluentIcons.Link}" />
</ui:AppBarButton.Icon>
</ui:AppBarButton>
<ui:AppBarButton
Expand Down
4 changes: 2 additions & 2 deletions source/iNKORE.UI.WPF.Modern.Gallery/PageHeader.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void OnCopyLinkButtonClick(object sender, RoutedEventArgs e)
this.CopyLinkAction?.Invoke();

this.CopyLinkButton.Label = "Copied to Clipboard";
this.CopyLinkButtonIcon.Symbol = Symbol.Accept;
this.CopyLinkButtonIcon.Icon = SegoeFluentIcons.Accept;
}

public void OnThemeButtonClick(object sender, RoutedEventArgs e)
Expand All @@ -114,7 +114,7 @@ public void OnThemeButtonClick(object sender, RoutedEventArgs e)
public void ResetCopyLinkButton()
{
this.CopyLinkButton.Label = "Generate Link to Page";
this.CopyLinkButtonIcon.Symbol = Symbol.Link;
this.CopyLinkButtonIcon.Icon = SegoeFluentIcons.Link;
}

private void OnCopyDontShowAgainButtonClick(TeachingTip sender, object args)
Expand Down
4 changes: 2 additions & 2 deletions source/iNKORE.UI.WPF.Modern/Properties/AssemblyInfoCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
[assembly: AssemblyTrademark("iNKORE!")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("0.9.28.0")]
[assembly: AssemblyFileVersion("0.9.28.0")]
[assembly: AssemblyVersion("0.9.29.0")]
[assembly: AssemblyFileVersion("0.9.29.0")]

0 comments on commit b22cc1b

Please sign in to comment.