-
-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #879 from lepoco/development
Merge development and bump version to preview 13
- Loading branch information
Showing
40 changed files
with
1,184 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/Wpf.Ui.Gallery/ViewModels/Pages/Layout/CardActionViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This Source Code Form is subject to the terms of the MIT License. | ||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT. | ||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors. | ||
// All Rights Reserved. | ||
|
||
namespace Wpf.Ui.Gallery.ViewModels.Pages.Layout; | ||
|
||
public partial class CardActionViewModel : ObservableObject | ||
{ | ||
public CardActionViewModel() { } | ||
} |
38 changes: 38 additions & 0 deletions
38
src/Wpf.Ui.Gallery/ViewModels/Pages/StatusAndInfo/InfoBadgeViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// This Source Code Form is subject to the terms of the MIT License. | ||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT. | ||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors. | ||
// All Rights Reserved. | ||
|
||
using Wpf.Ui.Controls; | ||
|
||
namespace Wpf.Ui.Gallery.ViewModels.Pages.StatusAndInfo; | ||
|
||
public partial class InfoBadgeViewModel : ObservableObject | ||
{ | ||
[ObservableProperty] | ||
private InfoBadgeSeverity _infoBadgeSeverity = InfoBadgeSeverity.Attention; | ||
|
||
private int _infoBadgeSeverityComboBoxSelectedIndex = 0; | ||
|
||
public int InfoBadgeSeverityComboBoxSelectedIndex | ||
{ | ||
get => _infoBadgeSeverityComboBoxSelectedIndex; | ||
set | ||
{ | ||
_ = SetProperty(ref _infoBadgeSeverityComboBoxSelectedIndex, value); | ||
InfoBadgeSeverity = ConvertIndexToInfoBadgeSeverity(value); | ||
} | ||
} | ||
|
||
private InfoBadgeSeverity ConvertIndexToInfoBadgeSeverity(int value) | ||
{ | ||
return value switch | ||
{ | ||
1 => InfoBadgeSeverity.Informational, | ||
2 => InfoBadgeSeverity.Success, | ||
3 => InfoBadgeSeverity.Caution, | ||
4 => InfoBadgeSeverity.Critical, | ||
_ => InfoBadgeSeverity.Attention | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<Page | ||
x:Class="Wpf.Ui.Gallery.Views.Pages.Layout.CardActionPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:controls="clr-namespace:Wpf.Ui.Gallery.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:Wpf.Ui.Gallery.Views.Pages.Layout" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:system="clr-namespace:System;assembly=System.Runtime" | ||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" | ||
Title="CardActionPage" | ||
d:DesignHeight="450" | ||
d:DesignWidth="800" | ||
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}" | ||
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}" | ||
Foreground="{DynamicResource TextFillColorPrimaryBrush}" | ||
mc:Ignorable="d"> | ||
<StackPanel Margin="0,0,0,24"> | ||
<controls:ControlExample | ||
Margin="0" | ||
HeaderText="A CardAction with an ImageIcon and a header." | ||
XamlCode="<ui:CardAction Icon="{ui:ImageIcon 'pack://application:,,,/Assets/wpfui.png'}" />"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
<ui:CardAction Grid.Column="0" Icon="{ui:ImageIcon 'pack://application:,,,/Assets/wpfui.png'}"> | ||
<StackPanel> | ||
<ui:TextBlock | ||
Margin="0" | ||
FontTypography="Body" | ||
Foreground="{DynamicResource TextFillColorPrimaryBrush}" | ||
Text="This is the header text" | ||
TextWrapping="WrapWithOverflow" /> | ||
</StackPanel> | ||
</ui:CardAction> | ||
</Grid> | ||
</controls:ControlExample> | ||
<controls:ControlExample | ||
Margin="0,32,0,0" | ||
HeaderText="A CardAction with an icon, a header and a description." | ||
XamlCode="<ui:CardAction Icon="{ui:SymbolIcon Fluent24}" />"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
<ui:CardAction Grid.Column="0" Icon="{ui:SymbolIcon DocumentEdit20, FontSize=43, Filled=False}"> | ||
<StackPanel> | ||
<ui:TextBlock | ||
Margin="0" | ||
FontTypography="BodyStrong" | ||
Foreground="{DynamicResource TextFillColorPrimaryBrush}" | ||
Text="This is the header text" | ||
TextWrapping="WrapWithOverflow" /> | ||
<ui:TextBlock | ||
Appearance="Secondary" | ||
Foreground="{DynamicResource TextFillColorSecondaryBrush}" | ||
Text="This is a description text." | ||
TextWrapping="WrapWithOverflow" /> | ||
</StackPanel> | ||
</ui:CardAction> | ||
</Grid> | ||
</controls:ControlExample> | ||
|
||
</StackPanel> | ||
</Page> |
39 changes: 39 additions & 0 deletions
39
src/Wpf.Ui.Gallery/Views/Pages/Layout/CardActionPage.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// This Source Code Form is subject to the terms of the MIT License. | ||
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT. | ||
// Copyright (C) Leszek Pomianowski and WPF UI Contributors. | ||
// All Rights Reserved. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
using Wpf.Ui.Controls; | ||
using Wpf.Ui.Gallery.ControlsLookup; | ||
using Wpf.Ui.Gallery.ViewModels.Pages.Layout; | ||
|
||
namespace Wpf.Ui.Gallery.Views.Pages.Layout; | ||
|
||
/// <summary> | ||
/// Interaction logic for CardActionPage.xaml | ||
/// </summary> | ||
[GalleryPage("Card action control.", SymbolRegular.Code24)] | ||
public partial class CardActionPage : INavigableView<CardActionViewModel> | ||
{ | ||
public CardActionPage(CardActionViewModel viewModel) | ||
{ | ||
InitializeComponent(); | ||
ViewModel = viewModel; | ||
} | ||
|
||
public CardActionViewModel ViewModel { get; } | ||
} |
Oops, something went wrong.