diff --git a/Flow.Launcher/Resources/Controls/Card.xaml.cs b/Flow.Launcher/Resources/Controls/Card.xaml.cs index 0ed3e1a48..0ea1133db 100644 --- a/Flow.Launcher/Resources/Controls/Card.xaml.cs +++ b/Flow.Launcher/Resources/Controls/Card.xaml.cs @@ -1,25 +1,16 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -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.Forms; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; +using System.Windows; using UserControl = System.Windows.Controls.UserControl; namespace Flow.Launcher.Resources.Controls { public partial class Card : UserControl { + public enum CardType + { + Inside, + InsideFit + } + public Card() { InitializeComponent(); @@ -30,7 +21,7 @@ namespace Flow.Launcher.Resources.Controls set { SetValue(TitleValueProperty, value); } } public static readonly DependencyProperty TitleValueProperty = - DependencyProperty.Register("Title", typeof(string), typeof(Card), new PropertyMetadata(string.Empty)); + DependencyProperty.Register(nameof(Title), typeof(string), typeof(Card), new PropertyMetadata(string.Empty)); public string Sub { @@ -38,7 +29,7 @@ namespace Flow.Launcher.Resources.Controls set { SetValue(SubValueProperty, value); } } public static readonly DependencyProperty SubValueProperty = - DependencyProperty.Register("Sub", typeof(string), typeof(Card), new PropertyMetadata(string.Empty)); + DependencyProperty.Register(nameof(Sub), typeof(string), typeof(Card), new PropertyMetadata(string.Empty)); public string Icon { @@ -46,7 +37,7 @@ namespace Flow.Launcher.Resources.Controls set { SetValue(IconValueProperty, value); } } public static readonly DependencyProperty IconValueProperty = - DependencyProperty.Register("Icon", typeof(string), typeof(Card), new PropertyMetadata(string.Empty)); + DependencyProperty.Register(nameof(Icon), typeof(string), typeof(Card), new PropertyMetadata(string.Empty)); /// /// Gets or sets additional content for the UserControl @@ -57,15 +48,15 @@ namespace Flow.Launcher.Resources.Controls set { SetValue(AdditionalContentProperty, value); } } public static readonly DependencyProperty AdditionalContentProperty = - DependencyProperty.Register("AdditionalContent", typeof(object), typeof(Card), + DependencyProperty.Register(nameof(AdditionalContent), typeof(object), typeof(Card), new PropertyMetadata(null)); - public object Type + public CardType Type { - get { return (object)GetValue(TypeProperty); } + get { return (CardType)GetValue(TypeProperty); } set { SetValue(TypeProperty, value); } } public static readonly DependencyProperty TypeProperty = - DependencyProperty.Register("Type", typeof(object), typeof(Card), + DependencyProperty.Register(nameof(Type), typeof(CardType), typeof(Card), new PropertyMetadata(null)); } } diff --git a/Flow.Launcher/Resources/Controls/ExCard.xaml.cs b/Flow.Launcher/Resources/Controls/ExCard.xaml.cs index a2c78d44f..ac9f63153 100644 --- a/Flow.Launcher/Resources/Controls/ExCard.xaml.cs +++ b/Flow.Launcher/Resources/Controls/ExCard.xaml.cs @@ -1,17 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; +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 Flow.Launcher.Resources.Controls { @@ -27,7 +15,7 @@ namespace Flow.Launcher.Resources.Controls set { SetValue(TitleValueProperty, value); } } public static readonly DependencyProperty TitleValueProperty = - DependencyProperty.Register("Title", typeof(string), typeof(ExCard), new PropertyMetadata(string.Empty)); + DependencyProperty.Register(nameof(Title), typeof(string), typeof(ExCard), new PropertyMetadata(string.Empty)); public string Sub { @@ -35,7 +23,7 @@ namespace Flow.Launcher.Resources.Controls set { SetValue(SubValueProperty, value); } } public static readonly DependencyProperty SubValueProperty = - DependencyProperty.Register("Sub", typeof(string), typeof(ExCard), new PropertyMetadata(string.Empty)); + DependencyProperty.Register(nameof(Sub), typeof(string), typeof(ExCard), new PropertyMetadata(string.Empty)); public string Icon { @@ -43,7 +31,7 @@ namespace Flow.Launcher.Resources.Controls set { SetValue(IconValueProperty, value); } } public static readonly DependencyProperty IconValueProperty = - DependencyProperty.Register("Icon", typeof(string), typeof(ExCard), new PropertyMetadata(string.Empty)); + DependencyProperty.Register(nameof(Icon), typeof(string), typeof(ExCard), new PropertyMetadata(string.Empty)); /// /// Gets or sets additional content for the UserControl @@ -54,7 +42,7 @@ namespace Flow.Launcher.Resources.Controls set { SetValue(AdditionalContentProperty, value); } } public static readonly DependencyProperty AdditionalContentProperty = - DependencyProperty.Register("AdditionalContent", typeof(object), typeof(ExCard), + DependencyProperty.Register(nameof(AdditionalContent), typeof(object), typeof(ExCard), new PropertyMetadata(null)); public object SideContent @@ -63,7 +51,7 @@ namespace Flow.Launcher.Resources.Controls set { SetValue(SideContentProperty, value); } } public static readonly DependencyProperty SideContentProperty = - DependencyProperty.Register("SideContent", typeof(object), typeof(ExCard), + DependencyProperty.Register(nameof(SideContent), typeof(object), typeof(ExCard), new PropertyMetadata(null)); } }