Skip to content

Commit

Permalink
Merge pull request #222 from lepoco/development
Browse files Browse the repository at this point in the history
Merge development
  • Loading branch information
pomianowski authored Jun 16, 2022
2 parents fdf9fac + f4b49ce commit 2c6fbc2
Show file tree
Hide file tree
Showing 504 changed files with 53,974 additions and 22,574 deletions.
32 changes: 32 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--- Please provide a general summary of your changes in the title above -->

## Pull request type

<!-- Please try to limit your pull request to one type, submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

- [ ] Update
- [ ] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or link to a relevant issue. -->

Issue Number: N/A

## What is the new behavior?

<!-- Please describe the behavior or changes that are being added by this PR. -->

-
-

## Other information

<!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Publish
uses: alirezanet/publish-nuget@v3.0.4
with:
PROJECT_FILE_PATH: src/WPFUI/WPFUI.csproj
PROJECT_FILE_PATH: src/Wpf.Ui/Wpf.Ui.csproj
VERSION_FILE_PATH: src/Directory.Build.props
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
TAG_COMMIT: false
6 changes: 3 additions & 3 deletions .github/workflows/DV.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
nuget-version: 'latest'

- name: NuGet restore
run: nuget restore src/WPFUI.sln
run: nuget restore src/Wpf.Ui.sln

- name: Build
run: msbuild src/WPFUI.sln -p:Configuration=Release -m
run: msbuild src/Wpf.Ui.sln -p:Configuration=Release -m

- name: Publish net60
uses: actions/upload-artifact@v3
id: publish_net6
with:
name: WPFUI_DEMO-NET6
path: |
src/WPFUI.Demo/bin/Release/net6.0-windows10.0.22000.0
src/Wpf.Ui.Demo/bin/Release/net6.0-windows10.0.22000.0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021-2022 Leszek Pomianowski and WPF UI Contributors.
Copyright (c) 2021-2022 Leszek Pomianowski and WPF UI Contributors. https://dev.lepo.co/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
83 changes: 46 additions & 37 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion branding/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"name": "wpf-ui",
"version": "1.1.0",
"dependencies": {
"@fluentui/react-icons": "1.1.163"
"@fluentui/react-icons": "1.1.172"
}
}
36 changes: 33 additions & 3 deletions docs/CONTROLS.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
# Controls
WPF UI has two kinds of controls. Default WPF ones, which styles have been overridden, and custom proprietary controls like `ProgressRing`.
**WPF UI** has two kinds of controls. Default WPF ones, which styles have been overridden, and custom proprietary controls like `ProgressRing`.

### Access to custom controls
In order for your `Window`, `Page`, or `UserControl` to use custom WPF UI controls, you need to add `wpfui` namespace.
In order for your `Window`, `Page`, or `UserControl` to use custom **WPF UI** controls, you need to add `wpfui` namespace.
```xml
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:wpfui="clr-namespace:WPFUI.Controls;assembly=WPFUI"
xmlns:wpfui="http://schemas.lepo.co/wpfui/2022/xaml"
mc:Ignorable="d">
<wpfui:ProgressRing IsIndeterminate="True" />
</Window>
```

## 🛠️ Custom controls
| Control | Namespace | Description |
| --- | --- | --- |
| **Anchor** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Anchor.cs) | Creates a hyperlink to web pages, files or anything else a URL can address. |
| **Arc** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Arc.cs) | Draws a symmetrical arc with rounded edges. |
| **Badge** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Badge.cs) | Used to highlight an item, attract attention or flag status. |
| **Breadcrumb** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Breadcrumb.cs) | Automatic display of the page title from the navigation in the application. |
| **Button** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Button.cs) | Custom button with additional parameters like an icon. |
| **Card** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Card.cs) | Simple card compatible with the theme for displaying other elements. |
| **CardAction** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/CardAction.cs) | Inherited from the Button interactive card styled according to Fluent Design. |
| **CardControl** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/CardControl.cs) | Inherited from the Button control which displays an additional control on the right side of the card. |
| **CardExpander** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/CardExpander.cs) | Inherited from the ContentControl control which can hide the collapsable content. |
| **CodeBlock** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/CodeBlock.cs) | Formats syntax and display a fragment of the source code. |
| **Dialog** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Dialog.cs) | Displays a large card with a slightly transparent background and two action buttons. |
| **FontIcon** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/FontIcon.cs) | Represents a text element containing an icon glyph with selectable font family. |
| **Hyperlink** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Hyperlink.cs) | Button that opens a URL in a web browser. |
| **SymbolIcon** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/SymbolIcon.cs) | Represents a text element containing an icon glyph. |
| **MessageBox** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/MessageBox.cs) | Custom window to display notifications outside the application. |
| **Navigation** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Navigation.cs) | Navigation styled as UWP apps. |
| **NavigationItem** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/NavigationItem.cs) | Element of the navigation. |
| **NavigationStore** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/NavigationStore.cs) | Navigation styled as Windows 11 Store app |
| **NavigationFluent** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/NavigationFluent.cs) | Navigation styled as Windows 11 Settings app. |
| **NumberBox** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/NumberBox.cs) | Text field for entering numbers with the possibility of setting a mask. |
| **ProgressRing** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/ProgressRing.cs) | Rotating loading ring like in Windows 11. |
| **Rating** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Rating.cs) | Stars to display the rating. |
| **SearchBox** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/SearchBox.cs) | Lets look for things and other stuff. |
| **Snackbar** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/Snackbar.cs) | Animated card with a notification displayed at the bottom of the application. |
| **TextBox** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/TextBox.cs) | Text field for with placeholders and icons. |
| **TitleBar** | [WPFUI.Controls](https://github.com/lepoco/wpfui/blob/main/WPFUI/Controls/TitleBar.cs) | A set of buttons that can replace the default window navigation, giving it a new, modern look with implemented [NotifyIcon](https://github.com/lepoco/wpfui/blob/main/WPFUI/Tray/NotifyIcon.cs). |
117 changes: 116 additions & 1 deletion docs/DATA.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,117 @@
# Data
TODO...
There is often a need to display datasets. We can use default controls like `ListView` or `ItemsControl`, but **WPF UI** also provides controls like `VirtualizingItemsControl` or `VirtualizingWrapPanel` which allow you to display thousands of controls without slowing down your application.

## ListView
```xml
<ListView
Margin="0,8,0,0"
ItemsSource="{Binding ListBoxItemCollection}"
SelectedIndex="0" />
```

## ListBox
```xml
<ListBox
Margin="0,8,0,0"
ItemsSource="{Binding ListBoxItemCollection}"
SelectedIndex="0" />
```

## TreeView
```xml
<TreeView ScrollViewer.CanContentScroll="False">
<TreeViewItem Header="Employee1" IsExpanded="True">
<TreeViewItem Header="Jesper Aaberg" />
<TreeViewItem Header="Employee Number" IsExpanded="True">
<TreeViewItem Header="12345" IsSelected="True" />
</TreeViewItem>
<TreeViewItem Header="Work Days">
<TreeViewItem Header="Monday" />
<TreeViewItem Header="Tuesday" />
<TreeViewItem Header="Thursday" />
</TreeViewItem>
</TreeViewItem>
<TreeViewItem Header="Employee2">
<TreeViewItem Header="Dominik Paiha" />
<TreeViewItem Header="Employee Number">
<TreeViewItem Header="98765" />
</TreeViewItem>
<TreeViewItem Header="Work Days">
<TreeViewItem Header="Tuesday" />
<TreeViewItem Header="Wednesday" />
<TreeViewItem Header="Friday" />
</TreeViewItem>
</TreeViewItem>
</TreeView>
```

## DataGrid
```xml
<DataGrid
Margin="0,8,0,0"
AutoGenerateColumns="False"
ItemsSource="{Binding DataGridItemCollection}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding FirstName}" Header="First Name" />
<DataGridTextColumn Binding="{Binding LastName}" Header="Last Name" />
<!-- The Email property contains a URI. For example "mailto:lucy0@adventure-works.com" -->
<DataGridHyperlinkColumn
Binding="{Binding Email}"
ContentBinding="{Binding Email}"
Header="Email" />
<DataGridCheckBoxColumn Binding="{Binding IsMember}" Header="Member?" />
<DataGridComboBoxColumn Header="Order Status" SelectedItemBinding="{Binding Status}" />
</DataGrid.Columns>
</DataGrid>
```

## VirtualizingWrapPanel
```xml
<ListView
Height="300"
ItemsSource="{Binding BrushCollection, Mode=OneWay}"
SelectedIndex="0">
<ListView.ItemTemplate>
<DataTemplate DataType="Brush">
<Border
Width="80"
Height="80"
Background="{Binding}"
CornerRadius="4">
<wpfui:SymbolIcon FontSize="25" Symbol="Fluent24" />
</Border>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<wpfui:VirtualizingWrapPanel
Orientation="Horizontal"
SpacingMode="Uniform"
StretchItems="False" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
```

## VirtualizingItemsControl
```xml
<wpfui:VirtualizingItemsControl
Height="300"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
ItemsSource="{Binding BrushCollection, Mode=OneWay}"
VirtualizingPanel.CacheLengthUnit="Pixel">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="Brush">
<wpfui:Button
Width="80"
Height="80"
Margin="2"
Padding="0"
Appearance="Secondary"
Background="{Binding}"
FontSize="25"
Icon="Fluent24" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</wpfui:VirtualizingItemsControl>
```
40 changes: 39 additions & 1 deletion docs/ICONS.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# Icons
TODO...
**WPF UI** uses [Fluent UI System Icons](https://github.com/microsoft/fluentui-system-icons), a collection of familiar, friendly and modern icons from Microsoft.

### Source
Icons are displayed by using the font that comes with the library. All glyphs are mapped to the [Icon](https://github.com/lepoco/wpfui/blob/main/WPFUI/Common/Icon.cs) and [IconFilled](https://github.com/lepoco/wpfui/blob/main/WPFUI/Common/IconFilled.cs) enums.

### Usage
Many interface elements use icons via simple parameters, for example you can add an icon to a button with the Icon parameter.
```xml
<wpfui:Button
Icon="FoodCake24"
Content="The cake is a lie!"/>
```

### SymbolIcon Control
You can simply display the icon with `SymbolIcon` control:
```xml
<wpfui:SymbolIcon
Symbol="FoodCake24"
Filled="True"/>
```

### FontIcon Control
If you add a custom font like **Segoe Fluent Icons** to your application, you can use it with `FontIcon`:
```xml
<wpfui:FontIcon
Glyph="&#xE700;"
FontFamily="{DynamicResource SegoeFluentIcons}"/>
```

### Segoe Fluent Icons
Not all icons available in WinUi 3 are in **Fluent UI System Icons**. Some of them require the **Segoe Fluent Icons** font.
According to the EULA of Segoe Fluent Icons we cannot ship a copy of it with this dll. Segoe Fluent Icons is installed by default on Windows 11, but if you want these icons in an application for Windows 10 and below, you must manually add the font to your application's resources.
[https://docs.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font](https://docs.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font)
[https://docs.microsoft.com/en-us/windows/apps/design/downloads/#fonts](https://docs.microsoft.com/en-us/windows/apps/design/downloads/#fonts)

In the `App.xaml` dictionaries, you can add an alternate path to the font
```XML
<FontFamily x:Key="SegoeFluentIcons">pack://application:,,,/;component/Fonts/#Segoe Fluent Icons</FontFamily>
```
44 changes: 12 additions & 32 deletions docs/INPUT.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,18 @@
# Icons
WPF UI uses [Fluent UI System Icons](https://github.com/microsoft/fluentui-system-icons), a collection of familiar, friendly and modern icons from Microsoft.
# Input
You can handle input from your users in a variety of ways. **WPF UI** modifies the default controls, but also adds its own, like `NumberBox`.

### Source
Icons are displayed by using the font that comes with the library. All glyphs are mapped to the [Icon](https://github.com/lepoco/wpfui/blob/main/WPFUI/Common/Icon.cs) and [IconFilled](https://github.com/lepoco/wpfui/blob/main/WPFUI/Common/IconFilled.cs) enums.

### Usage
Many interface elements use icons via simple parameters, for example you can add an icon to a button with the Icon parameter.
```xml
<wpfui:Button
Icon="FoodCake24"
Content="The cake is a lie!"/>
```

### Icon Control
You can simply display the icon with `Icon` control:
## TextBox
The default TextBox only allows you to define the `Text` parameter.
```xml
<wpfui:Icon
Glyph="FoodCake24"
Filled="True"/>
<TextBox
Margin="0,8,0,0"
Text="Hello World" />
```

### FontIcon Control
If you add a custom font like **Segoe Fluent Icons** to your application, you can use it with `FontIcon`:
**WPF UI** extends it and allows you to set `Placeholder` or `Icon`.
```xml
<wpfui:FontIcon Glyph="&#xE700;" FontFamily="{DynamicResource SegoeFluentIcons}"/>
<wpfui:TextBox
Margin="0,8,0,0"
Icon="Fluent24"
Placeholder="Hello World" />
```

### Segoe Fluent Icons
Not all icons available in WinUi 3 are in **Fluent UI System Icons**. Some of them require the **Segoe Fluent Icons** font.
According to the EULA of Segoe Fluent Icons we cannot ship a copy of it with this dll. Segoe Fluent Icons is installed by default on Windows 11, but if you want these icons in an application for Windows 10 and below, you must manually add the font to your application's resources.
[https://docs.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font](https://docs.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font)
[https://docs.microsoft.com/en-us/windows/apps/design/downloads/#fonts](https://docs.microsoft.com/en-us/windows/apps/design/downloads/#fonts)

In the `App.xaml` dictionaries, you can add an alternate path to the font
```XML
<FontFamily x:Key="SegoeFluentIcons">pack://application:,,,/;component/Fonts/#Segoe Fluent Icons</FontFamily>
```
Loading

0 comments on commit 2c6fbc2

Please sign in to comment.