-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add for linked Key Store secret during publish if required
- Loading branch information
Showing
5 changed files
with
128 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<UserControl x:Class="Leosac.KeyManager.Library.UI.OpenFavoriteControl" | ||
x:Name="favControl" | ||
xmlns="http:https://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http:https://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http:https://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http:https://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:Leosac.KeyManager.Library.UI" | ||
xmlns:materialDesign="http:https://materialdesigninxaml.net/winfx/xaml/themes" | ||
xmlns:properties="clr-namespace:Leosac.KeyManager.Library.UI.Properties" | ||
mc:Ignorable="d" | ||
d:DesignHeight="150" d:DesignWidth="290"> | ||
<StackPanel Margin="16" Width="250"> | ||
<Label Content="{Binding Path=Title, ElementName=favControl}" Margin="5" /> | ||
<PasswordBox materialDesign:HintAssist.HelperText="{x:Static properties:Resources.SecretHelper}" | ||
materialDesign:HintAssist.Hint="{x:Static properties:Resources.Secret}" | ||
materialDesign:TextFieldAssist.HasClearButton="True" Margin="5" | ||
materialDesign:TextFieldAssist.CharacterCounterVisibility="Visible" | ||
Style="{StaticResource MaterialDesignFloatingHintRevealPasswordBox}" | ||
materialDesign:PasswordBoxAssist.Password="{Binding Properties.Secret, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ElementName=favControl}" | ||
MaxLength="{Binding Properties.SecretMaxLength, Mode=OneWay, ElementName=favControl}" | ||
Visibility="{Binding Properties.StoreSecret, Converter={StaticResource InverseBooleanToVisibilityConverter}, ElementName=favControl}"/> | ||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> | ||
<Button Margin="0,8,8,0" CommandParameter="{Binding}" Command="{Binding Command, ElementName=favControl}" Content="{x:Static properties:Resources.OK}" IsDefault="True" Style="{StaticResource MaterialDesignFlatButton}" /> | ||
<Button Margin="0,8,8,0" Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}" Content="{x:Static properties:Resources.Cancel}" IsCancel="True" Style="{StaticResource MaterialDesignFlatButton}" /> | ||
</StackPanel> | ||
</StackPanel> | ||
</UserControl> |
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,54 @@ | ||
using Leosac.KeyManager.Library.KeyStore; | ||
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; | ||
|
||
namespace Leosac.KeyManager.Library.UI | ||
{ | ||
/// <summary> | ||
/// Interaction logic for OpenFavoriteControl.xaml | ||
/// </summary> | ||
public partial class OpenFavoriteControl : UserControl | ||
{ | ||
public OpenFavoriteControl() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public string Title | ||
{ | ||
get { return (string)GetValue(TitleProperty); } | ||
set { SetValue(TitleProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(nameof(Title), typeof(string), typeof(OpenFavoriteControl), | ||
new FrameworkPropertyMetadata("")); | ||
|
||
public ICommand? Command | ||
{ | ||
get { return (ICommand?)GetValue(CommandProperty); } | ||
set { SetValue(CommandProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty CommandProperty = DependencyProperty.Register(nameof(Command), typeof(ICommand), typeof(OpenFavoriteControl)); | ||
|
||
public KeyStoreProperties? Properties | ||
{ | ||
get { return (KeyStoreProperties?)GetValue(PropertiesProperty); } | ||
set { SetValue(PropertiesProperty, value); } | ||
} | ||
|
||
public static readonly DependencyProperty PropertiesProperty = DependencyProperty.Register(nameof(Properties), typeof(KeyStoreProperties), typeof(OpenFavoriteControl)); | ||
} | ||
} |
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