public VehicleCountWithFlagUniform ( NationCountryPair nationCountryPair, int count, Thickness margin, MouseButtonEventHandler mouseDownHandler, double flagColumnWidth, double countColumnWidth, HorizontalAlignment textHorizontalAlignment = HorizontalAlignment.Left, bool useNationFlags = false ) : base(count, margin, textHorizontalAlignment) { InitializeComponent(); _flagStyle = this.GetStyle(EStyleKey.Image.FlagIcon16px); _flagColumnDefinition.Width = new GridLength(flagColumnWidth, GridUnitType.Pixel); _countColumnDefinition.Width = new GridLength(countColumnWidth, GridUnitType.Pixel); Tag = nationCountryPair; _grid.Add(nationCountryPair.CreateFlag(_flagStyle, new Thickness(EInteger.Number.Zero, EInteger.Number.Zero, EInteger.Number.Five, EInteger.Number.Zero), useNationFlags), EInteger.Number.Zero, EInteger.Number.Zero); _grid.Add(_label, EInteger.Number.One, EInteger.Number.Zero); MouseDown += mouseDownHandler; }
public static Image CreateFlag(this NationCountryPair nationCountryPair, Style flagStyle, Thickness margin, bool useNationFlags, bool createTooltip = true, HorizontalAlignment horizontalAlignment = HorizontalAlignment.Left) { var flag = new Image { Style = flagStyle, Source = ApplicationHelpers.Manager.GetFlagImageSource(useNationFlags ? nationCountryPair.Nation.GetBaseCountry() : nationCountryPair.Country), Margin = margin, HorizontalAlignment = horizontalAlignment, }; if (createTooltip) { flag.ToolTip = ApplicationHelpers.LocalisationManager.GetLocalisedString(useNationFlags ? nationCountryPair.Nation.ToString() : nationCountryPair.Country.ToString()); } return(flag); }
public VehicleCountWithFlag ( NationCountryPair nationCountryPair, int count, Thickness margin, MouseButtonEventHandler mouseDownHandler, HorizontalAlignment textHorizontalAlignment = HorizontalAlignment.Left, bool useNationFlags = false ) : base(count, margin, textHorizontalAlignment) { InitializeComponent(); _flagStyle = this.GetStyle(EStyleKey.Image.FlagIcon16px); Tag = nationCountryPair; _grid.Children.Add(nationCountryPair.CreateFlag(_flagStyle, new Thickness(EInteger.Number.Zero, EInteger.Number.Zero, EInteger.Number.Five, EInteger.Number.Zero), useNationFlags)); _grid.Children.Add(_label); MouseDown += mouseDownHandler; }
public TextLabelWithFlag ( NationCountryPair nationCountryPair, string text, Thickness margin, MouseButtonEventHandler mouseDownHandler, HorizontalAlignment textHorizontalAlignment = HorizontalAlignment.Left, bool isBold = false, bool useNationFlags = false, bool createTooltip = true ) : base(text, margin, textHorizontalAlignment, isBold) { InitializeComponent(); _flagStyle = this.GetStyle(EStyleKey.Image.FlagIcon16px); Tag = nationCountryPair; _panel.Children.Add(nationCountryPair.CreateFlag(_flagStyle, new Thickness(EInteger.Number.Zero, EInteger.Number.Zero, EInteger.Number.Five, EInteger.Number.Zero), useNationFlags, createTooltip)); _panel.Children.Add(_label); MouseDown += mouseDownHandler; }