Skip to content

Commit

Permalink
#28 solved - TitleFontSize added to dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
enisn committed Feb 5, 2019
1 parent b7fb9dc commit 4d32d63
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions InputKit/Shared/Controls/Dropdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Dropdown : StackLayout, IValidatable
TextColor = Color.Black,
};

IconView imgIcon = new IconView { InputTransparent = true, FillColor = GlobalSetting.Color, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.CenterAndExpand, Margin = new Thickness(10,5,5,5) };
IconView imgIcon = new IconView { InputTransparent = true, FillColor = GlobalSetting.Color, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.CenterAndExpand, Margin = new Thickness(10, 5, 5, 5) };
IconView imgArrow = new IconView { InputTransparent = true, FillColor = GlobalSetting.Color, Source = "arrow_down.png", HorizontalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.CenterAndExpand, Margin = 5 };
Label lblTitle = new Label { Margin = new Thickness(6, 0, 0, 0), IsVisible = false, TextColor = GlobalSetting.TextColor, LineBreakMode = LineBreakMode.TailTruncation, FontFamily = GlobalSetting.FontFamily };
Label lblAnnotation = new Label { Margin = new Thickness(6, 0, 0, 0), IsVisible = false, FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)), Opacity = 0.8, TextColor = GlobalSetting.TextColor, FontFamily = GlobalSetting.FontFamily };
Expand All @@ -37,7 +37,6 @@ public class Dropdown : StackLayout, IValidatable
private string _placeholder;
private string _validationMessage;
private bool _isRequired;

public Dropdown()
{
this.Children.Add(lblTitle);
Expand Down Expand Up @@ -110,11 +109,13 @@ void UpdateSelected()
UpdateMainText();
DisplayValidation();
ValidationChanged?.Invoke(this, new EventArgs());
SelectedItemChanged?.Invoke(this, new SelectedItemChangedArgs(this.SelectedItem, this.ItemsSource?.IndexOf(this.SelectedItem) ?? -1) );
SelectedItemChanged?.Invoke(this, new SelectedItemChangedArgs(this.SelectedItem, this.ItemsSource?.IndexOf(this.SelectedItem) ?? -1));
}
#endregion
//public Label TitleLabel { get => lblTitle; }
public string Title { get => lblTitle.Text; set { lblTitle.Text = value; lblTitle.IsVisible = !String.IsNullOrEmpty(value); } }
[TypeConverter(typeof(FontSizeConverter))]
public double TitleFontSize { get => lblTitle.FontSize; set => lblTitle.FontSize = value; }
public string IconImage { get => imgIcon.Source; set => imgIcon.Source = value; }
public string FontFamily { get => txtInput.FontFamily; set { txtInput.FontFamily = value; lblTitle.FontFamily = value; lblAnnotation.FontFamily = value; } }
public new Color BackgroundColor { get => frmBackground.BackgroundColor; set => frmBackground.BackgroundColor = value; }
Expand Down

0 comments on commit 4d32d63

Please sign in to comment.