-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an exception wehn SettingsCard is disabled
- Loading branch information
Showing
8 changed files
with
209 additions
and
30 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
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
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
73 changes: 73 additions & 0 deletions
73
source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Community/SettingsCardPage.xaml
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,73 @@ | ||
<ui:Page | ||
x:Class="iNKORE.UI.WPF.Modern.Gallery.Pages.Controls.Community.SettingsCardPage" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:iNKORE.UI.WPF.Modern.Gallery" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:sys="clr-namespace:System;assembly=mscorlib" | ||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern" xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf" | ||
Title="Border" d:DesignWidth="800" | ||
Loaded="Page_Loaded" mc:Ignorable="d"> | ||
<StackPanel> | ||
<local:ControlExample x:Name="Example1" HeaderText="A Series of SettingsCards"> | ||
<local:ControlExample.Example> | ||
<ikw:SimpleStackPanel Spacing="4"> | ||
<ui:SettingsCard x:Name="settingsCard" | ||
Description="This is a default card, with the Header, HeaderIcon, Description and Content set." | ||
Header="This is the Header" | ||
IsEnabled="{Binding ElementName=EnableToggle1, Path=IsOn}"> | ||
<ui:SettingsCard.HeaderIcon> | ||
<ui:FontIcon Glyph=""/> | ||
</ui:SettingsCard.HeaderIcon> | ||
<ComboBox SelectedIndex="0"> | ||
<ComboBoxItem>Option 1</ComboBoxItem> | ||
<ComboBoxItem>Option 2</ComboBoxItem> | ||
<ComboBoxItem>Option 3</ComboBoxItem> | ||
</ComboBox> | ||
</ui:SettingsCard> | ||
|
||
<ui:SettingsCard Description="You can use a FontIcon, SymbolIcon or BitmapIcon to set the cards HeaderIcon." | ||
Header="Icon options" | ||
IsEnabled="{Binding ElementName=EnableToggle1, Path=IsOn}"> | ||
<ui:SettingsCard.HeaderIcon> | ||
<Image Width="20" Height="20" Source="/Assets/WpfLibrary_256w.png" | ||
RenderOptions.BitmapScalingMode="HighQuality"/> | ||
</ui:SettingsCard.HeaderIcon> | ||
<ui:ToggleSwitch /> | ||
</ui:SettingsCard> | ||
|
||
<ui:SettingsCard Header="A card with custom objects as its Description" | ||
IsEnabled="{Binding ElementName=EnableToggle1, Path=IsOn}"> | ||
<ui:SettingsCard.Description> | ||
<ui:HyperlinkButton Content="Learn more about Inkways" /> | ||
</ui:SettingsCard.Description> | ||
<Button Content="Open Inkways Editor" | ||
Style="{StaticResource AccentButtonStyle}" /> | ||
</ui:SettingsCard> | ||
|
||
<ui:SettingsCard Description="When resizing a SettingsCard, the Content will wrap vertically. You can override this breakpoint by setting the SettingsCardWrapThreshold resource. For edge cases, you can also hide the icon by setting SettingsCardWrapNoIconThreshold." | ||
Header="Adaptive layouts" | ||
IsEnabled="{Binding ElementName=EnableToggle1, Path=IsOn}"> | ||
<ui:SettingsCard.HeaderIcon> | ||
<ui:FontIcon Glyph=""/> | ||
</ui:SettingsCard.HeaderIcon> | ||
|
||
<Button Content="This control will wrap vertically!" | ||
Style="{StaticResource AccentButtonStyle}" /> | ||
</ui:SettingsCard> | ||
|
||
<ui:SettingsCard Header="This is a card with a Header only" | ||
IsEnabled="{Binding ElementName=EnableToggle1, Path=IsOn}"/> | ||
|
||
</ikw:SimpleStackPanel> | ||
</local:ControlExample.Example> | ||
|
||
<local:ControlExample.Options> | ||
<StackPanel> | ||
<ui:ToggleSwitch x:Name="EnableToggle1" Header="Is Enabled" IsOn="False"/> | ||
</StackPanel> | ||
</local:ControlExample.Options> | ||
</local:ControlExample> | ||
</StackPanel> | ||
</ui:Page> |
46 changes: 46 additions & 0 deletions
46
source/iNKORE.UI.WPF.Modern.Gallery/Pages/Controls/Community/SettingsCardPage.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,46 @@ | ||
using iNKORE.UI.WPF.Modern.Controls; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
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 Page = iNKORE.UI.WPF.Modern.Controls.Page; | ||
|
||
namespace iNKORE.UI.WPF.Modern.Gallery.Pages.Controls.Community | ||
{ | ||
/// <summary> | ||
/// BorderPage.xaml 的交互逻辑 | ||
/// </summary> | ||
public partial class SettingsCardPage : Page | ||
{ | ||
public SettingsCardPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
#region Example Code | ||
|
||
public void UpdateExampleCode() | ||
{ | ||
} | ||
|
||
|
||
|
||
#endregion | ||
|
||
private void Page_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
|
||
} | ||
} | ||
} |
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