2018-06-26 18:14:01 +02:00
|
|
|
|
using System;
|
2018-09-06 18:30:30 +02:00
|
|
|
|
using System.Collections.Generic;
|
2018-06-26 18:14:01 +02:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using Windows.UI.Xaml;
|
|
|
|
|
using Windows.UI.Xaml.Controls;
|
|
|
|
|
|
|
|
|
|
// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236
|
|
|
|
|
|
|
|
|
|
namespace ModernKeePass.Views.UserControls
|
|
|
|
|
{
|
|
|
|
|
public sealed partial class SymbolPickerUserControl
|
|
|
|
|
{
|
2018-09-06 18:30:30 +02:00
|
|
|
|
public IEnumerable<Symbol> Symbols { get; }
|
2018-06-26 18:14:01 +02:00
|
|
|
|
|
|
|
|
|
public Symbol SelectedSymbol
|
|
|
|
|
{
|
|
|
|
|
get { return (Symbol)GetValue(SelectedSymbolProperty); }
|
|
|
|
|
set { SetValue(SelectedSymbolProperty, value); }
|
|
|
|
|
}
|
|
|
|
|
public static readonly DependencyProperty SelectedSymbolProperty =
|
|
|
|
|
DependencyProperty.Register(
|
|
|
|
|
"SelectedSymbol",
|
|
|
|
|
typeof(Symbol),
|
|
|
|
|
typeof(SymbolPickerUserControl),
|
|
|
|
|
new PropertyMetadata(Symbol.Stop, (o, args) => { }));
|
|
|
|
|
|
|
|
|
|
public SymbolPickerUserControl()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2020-03-30 19:43:04 +02:00
|
|
|
|
Symbols = Enum.GetValues(typeof(Symbol)).Cast<Symbol>();
|
2018-06-26 18:14:01 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ComboBox_OnLoaded(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
ComboBox.SelectedItem = Symbols.FirstOrDefault(s => s == SelectedSymbol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|