Skip to content

Commit

Permalink
Merge pull request #543 from IvanDmitriev1/IconElement-implementation
Browse files Browse the repository at this point in the history
`IconElement` implementation
  • Loading branch information
pomianowski authored Mar 17, 2023
2 parents 8b47ac5 + 2b54a5b commit 91a7089
Show file tree
Hide file tree
Showing 94 changed files with 1,618 additions and 1,675 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
using CommunityToolkit.Mvvm.Input;
using Wpf.Ui.Contracts;
using Wpf.Ui.Controls;
using Wpf.Ui.Controls.IconElements;
using SymbolIcon = Wpf.Ui.Controls.IconElements.SymbolIcon;

namespace Wpf.Ui.Gallery.ViewModels.Pages.DialogsAndFlyouts;

Expand Down Expand Up @@ -40,7 +42,7 @@ public SnackbarViewModel(ISnackbarService snackbarService)
private void OnOpenSnackbar(object sender)
{
_snackbarService.Timeout = SnackbarTimeout;
_snackbarService.Show("Don't Blame Yourself.", "No Witcher's Ever Died In His Bed.", SymbolRegular.Fluent24, _snackbarAppearance);
_snackbarService.Show("Don't Blame Yourself.", "No Witcher's Ever Died In His Bed.", new SymbolIcon(SymbolRegular.Fluent24), _snackbarAppearance);
}

private void UpdateSnackbarAppearance(int appearanceIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

using System.Collections.ObjectModel;
using System.Windows;
using Wpf.Ui.Controls;
using Wpf.Ui.Controls.IconElements;
using Wpf.Ui.Controls.Navigation;
using Wpf.Ui.Gallery.Views.Pages;
using Wpf.Ui.Gallery.Views.Pages.BasicInput;
Expand Down
1 change: 1 addition & 0 deletions src/Wpf.Ui.Gallery/Views/Pages/BasicInput/AnchorPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<ui:Anchor
Grid.Column="0"
Content="WPF UI anchor"
Icon="{ui:SymbolIcon Link24}"
IsEnabled="{Binding ViewModel.IsAnchorEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:AnchorPage}, Mode=OneWay}"
NavigateUri="https://dev.lepo.co/" />
<CheckBox
Expand Down
4 changes: 2 additions & 2 deletions src/Wpf.Ui.Gallery/Views/Pages/BasicInput/ButtonPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<ui:Button
Grid.Column="0"
Content="WPF UI button"
Icon="Fluent24"
Icon="{ui:SymbolIcon Fluent24}"
IsEnabled="{Binding ViewModel.IsUiButtonEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ButtonPage}, Mode=OneWay}" />
<CheckBox
Grid.Column="1"
Expand All @@ -93,7 +93,7 @@
Grid.Column="0"
Appearance="Primary"
Content="WPF UI button"
Icon="Fluent24" />
Icon="{ui:SymbolIcon Fluent24}" />
</controls:GalleryControlPresenter>
</Grid>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<ui:Hyperlink
Grid.Column="0"
Content="WPF UI hyperlink"
Icon="{ui:SymbolIcon Link24}"
IsEnabled="{Binding ViewModel.IsHyperlinkEnabled, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:HyperlinkPage}, Mode=OneWay}"
NavigateUri="https://dev.lepo.co/" />
<CheckBox
Expand Down
5 changes: 0 additions & 5 deletions src/Wpf.Ui.Gallery/Views/Pages/DashboardPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,35 +214,30 @@
Margin="8,8,0,0"
Padding="4"
Content="Documentation"
Icon="Empty"
NavigateUri="https://wpfui.lepo.co/"
ToolTip="https://wpfui.lepo.co/" />
<ui:Hyperlink
Margin="8,0,0,0"
Padding="4"
Content="Microsoft Store"
Icon="Empty"
NavigateUri="https://apps.microsoft.com/store/detail/wpf-ui/9N9LKV8R9VGM"
ToolTip="https://apps.microsoft.com/store/detail/wpf-ui/9N9LKV8R9VGM" />
<ui:Hyperlink
Margin="8,0,0,0"
Padding="4"
Content="GitHub"
Icon="Empty"
NavigateUri="https://github.com/lepoco/wpfui"
ToolTip="https://github.com/lepoco/wpfui" />
<ui:Hyperlink
Margin="8,0,0,0"
Padding="4"
Content="NuGet"
Icon="Empty"
NavigateUri="https://www.nuget.org/packages/wpf-ui/"
ToolTip="https://www.nuget.org/packages/wpf-ui/" />
<ui:Hyperlink
Margin="8,0,0,0"
Padding="4"
Content="Visual Studio Marketplace"
Icon="Empty"
NavigateUri="https://marketplace.visualstudio.com/items?itemName=lepo.wpf-ui"
ToolTip="https://marketplace.visualstudio.com/items?itemName=lepo.wpf-ui" />
</StackPanel>
Expand Down
1 change: 1 addition & 0 deletions src/Wpf.Ui.Gallery/Views/Pages/Icons/FontIconPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<controls:GalleryControlPresenter.Content>
<ui:FontIcon
HorizontalAlignment="Left"
FontFamily="{DynamicResource SegoeFluentIcons}"
FontSize="24"
Glyph="&#xe00b;" />
</controls:GalleryControlPresenter.Content>
Expand Down
14 changes: 12 additions & 2 deletions src/Wpf.Ui.Gallery/Views/Pages/Navigation/BreadcrumbBarPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,20 @@
<system:String x:Key="PageCsharpUrl">https://github.com/lepoco/wpfui/blob/development/src/Wpf.Ui/Controls/BreadcrumbBar.cs</system:String>

<Style BasedOn="{StaticResource {x:Type ui:BreadcrumbBarItem}}" TargetType="{x:Type ui:BreadcrumbBarItem}">
<Setter Property="Icon">
<Setter.Value>
<ui:IconSourceElement>
<ui:IconSourceElement.IconSource>
<ui:SymbolIconSource
FontSize="16"
FontWeight="Regular"
Symbol="ChevronRight24" />
</ui:IconSourceElement.IconSource>
</ui:IconSourceElement>
</Setter.Value>
</Setter>
<Setter Property="FontSize" Value="16" />
<Setter Property="FontWeight" Value="Regular" />
<Setter Property="SymbolIconFontSize" Value="10" />
<Setter Property="SymbolIconFontWeight" Value="Regular" />
</Style>
</ResourceDictionary>
</Page.Resources>
Expand Down
10 changes: 5 additions & 5 deletions src/Wpf.Ui.Gallery/Views/Pages/Navigation/MenuPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
Grid.Row="1"
Background="Transparent"
FontSize="14">
<ui:MenuItem Header="File" SymbolIcon="DocumentSplitHint20">
<ui:MenuItem Header="File" Icon="{ui:SymbolIcon DocumentSplitHint20}">
<MenuItem Header="New" />
<MenuItem Header="New window" />
<MenuItem Header="Open..." />
Expand All @@ -51,7 +51,7 @@
<Separator />
<MenuItem Header="Exit" />
</ui:MenuItem>
<ui:MenuItem Header="Edit" SymbolIcon="DocumentEdit20">
<ui:MenuItem Header="Edit" Icon="{ui:SymbolIcon DocumentEdit20}">
<MenuItem Header="Undo" />
<Separator />
<MenuItem Header="Cut" />
Expand All @@ -66,9 +66,9 @@
<MenuItem Header="Select All" />
</ui:MenuItem>
<Separator />
<ui:MenuItem SymbolIcon="TextBold20" />
<ui:MenuItem SymbolIcon="TextItalic20" />
<ui:MenuItem SymbolIcon="TextUnderline20" />
<ui:MenuItem Icon="{ui:SymbolIcon TextBold20}" />
<ui:MenuItem Icon="{ui:SymbolIcon TextItalic20}" />
<ui:MenuItem Icon="{ui:SymbolIcon TextUnderline20}" />
</Menu>
</controls:GalleryControlPresenter.Content>
<controls:GalleryControlPresenter.CodeText>
Expand Down
96 changes: 41 additions & 55 deletions src/Wpf.Ui.Gallery/Views/Pages/Navigation/NavigationViewPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,20 @@
<ui:AutoSuggestBox Margin="8,0,8,8" PlaceholderText="Search" />
</ui:NavigationView.AutoSuggestBox>
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem Content="Dashboard" TargetPageType="{x:Type samples:SamplePage1}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Home24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="Items" TargetPageType="{x:Type samples:SamplePage2}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Library24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
Content="Dashboard"
Icon="{ui:SymbolIcon Home24}"
TargetPageType="{x:Type samples:SamplePage1}" />
<ui:NavigationViewItem
Content="Items"
Icon="{ui:SymbolIcon Library24}"
TargetPageType="{x:Type samples:SamplePage2}" />
</ui:NavigationView.MenuItems>
<ui:NavigationView.FooterMenuItems>
<ui:NavigationViewItem Content="Settings" TargetPageType="{x:Type samples:SamplePage3}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Settings24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
Content="Settings"
Icon="{ui:SymbolIcon Settings24}"
TargetPageType="{x:Type samples:SamplePage3}" />
</ui:NavigationView.FooterMenuItems>
<ui:NavigationView.Header>
<Border
Expand Down Expand Up @@ -132,23 +129,20 @@
IsPaneToggleVisible="False"
PaneDisplayMode="LeftFluent">
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem Content="Dashboard" TargetPageType="{x:Type samples:SamplePage1}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Home24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="Items" TargetPageType="{x:Type samples:SamplePage2}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Library24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
Content="Dashboard"
Icon="{ui:SymbolIcon Home24}"
TargetPageType="{x:Type samples:SamplePage1}" />
<ui:NavigationViewItem
Content="Items"
Icon="{ui:SymbolIcon Library24}"
TargetPageType="{x:Type samples:SamplePage2}" />
</ui:NavigationView.MenuItems>
<ui:NavigationView.FooterMenuItems>
<ui:NavigationViewItem Content="Settings" TargetPageType="{x:Type samples:SamplePage3}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Settings24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
Content="Settings"
Icon="{ui:SymbolIcon Settings24}"
TargetPageType="{x:Type samples:SamplePage3}" />
</ui:NavigationView.FooterMenuItems>
<ui:NavigationView.Header>
<Border
Expand Down Expand Up @@ -220,33 +214,25 @@
IsPaneToggleVisible="False"
PaneDisplayMode="Top">
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem Content="Menu Item 1" TargetPageType="{x:Type samples:SamplePage1}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Home24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="Menu Item 2" TargetPageType="{x:Type samples:SamplePage2}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="AppFolder24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="Menu Item 3" TargetPageType="{x:Type samples:SamplePage3}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="BezierCurveSquare20" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Content="Menu Item 4" TargetPageType="{x:Type samples:SamplePage1}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Library24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem
Content="Menu Item 1"
Icon="{ui:SymbolIcon Home24}"
TargetPageType="{x:Type samples:SamplePage1}" />
<ui:NavigationViewItem
Content="Menu Item 2"
Icon="{ui:SymbolIcon AppFolder24}"
TargetPageType="{x:Type samples:SamplePage2}" />
<ui:NavigationViewItem
Content="Menu Item 3"
Icon="{ui:SymbolIcon BezierCurveSquare20}"
TargetPageType="{x:Type samples:SamplePage3}" />
<ui:NavigationViewItem
Content="Menu Item 4"
Icon="{ui:SymbolIcon Library24}"
TargetPageType="{x:Type samples:SamplePage1}" />
</ui:NavigationView.MenuItems>
<ui:NavigationView.FooterMenuItems>
<ui:NavigationViewItem TargetPageType="{x:Type samples:SamplePage3}">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Settings24" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Icon="{ui:SymbolIcon Settings24}" TargetPageType="{x:Type samples:SamplePage3}" />
</ui:NavigationView.FooterMenuItems>
<ui:NavigationView.AutoSuggestBox>
<ui:AutoSuggestBox
Expand Down
5 changes: 4 additions & 1 deletion src/Wpf.Ui.Gallery/Views/Pages/Text/AutoSuggestBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@
CodeText="&lt;ui:AutoSuggestBox PlaceholderText=&quot;Search...&quot; /&gt;"
HeaderText="WPF UI AutoSuggestBox.">
<controls:GalleryControlPresenter.Content>
<ui:AutoSuggestBox OriginalItemsSource="{Binding ViewModel.AutoSuggestBoxSuggestions, Mode=OneWay}" PlaceholderText="Search..." />
<ui:AutoSuggestBox
Icon="{ui:SymbolIcon Search24}"
OriginalItemsSource="{Binding ViewModel.AutoSuggestBoxSuggestions, Mode=OneWay}"
PlaceholderText="Search..." />
</controls:GalleryControlPresenter.Content>
</controls:GalleryControlPresenter>
</Grid>
Expand Down
4 changes: 2 additions & 2 deletions src/Wpf.Ui.Gallery/Views/Pages/Text/NumberBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
HeaderText="WPF UI NumberBox with icon.">
<controls:GalleryControlPresenter.Content>
<ui:NumberBox
Icon="NumberSymbolSquare24"
Icon="{ui:SymbolIcon NumberSymbolSquare24}"
LargeChange="2.25"
Maximum="10"
Minimum="-10"
Expand All @@ -74,7 +74,7 @@
HeaderText="WPF UI NumberBox without decimal places.">
<controls:GalleryControlPresenter.Content>
<ui:NumberBox
Icon="NumberSymbolSquare24"
Icon="{ui:SymbolIcon NumberSymbolSquare24}"
MaxDecimalPlaces="0"
Maximum="100"
Minimum="0"
Expand Down
2 changes: 1 addition & 1 deletion src/Wpf.Ui.Gallery/Views/Pages/Text/PasswordBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
HeaderText="WPF UI PasswordBox.">
<controls:GalleryControlPresenter.Content>
<ui:PasswordBox
Icon="Password24"
Icon="{ui:SymbolIcon Password24}"
PlaceholderEnabled="True"
PlaceholderText="Password..." />
</controls:GalleryControlPresenter.Content>
Expand Down
Loading

0 comments on commit 91a7089

Please sign in to comment.