public void ConvertsHexToColor(string hexString, Color expectedColor) { var converter = new HexToColorConverter(); var convertedValue = converter.Convert(hexString, typeof(Color), null, CurrentCulture); Assert.IsType <Color>(convertedValue); Assert.Equal(expectedColor, convertedValue); }
public void Convert_does_return_Color_correctly( string hex, Type targetType, object parameter, CultureInfo culture) { //Arrange var sut = new HexToColorConverter(); //Act var convertedValue = (Color)sut.Convert(hex, targetType, parameter, culture); //Assert convertedValue.ToHex().Should().Be(hex); }
/// <summary> /// Init so nothing gets linked out /// </summary> public static void Init() { EmailValidatorBehavior.Init(); EmptyValidatorBehavior.Init(); BooleanToObjectConverter <string> .Init(); HexToColorConverter.Init(); InvertedBooleanConverter.Init(); UpperTextConverter.Init(); LowerTextConverter.Init(); HasDataConverter.Init(); MessagingService.Init(); MessagingServiceAlert.Init(); MessagingServiceQuestion.Init(); MessagingServiceChoice.Init(); }
public NewsViewPage() { this.InitializeComponent(); if (!String.IsNullOrEmpty(ApplicationService.Instance.Settings.BackGroundColor)) { try { var brush = HexToColorConverter.GetColorFromHex(ApplicationService.Instance.Settings.BackGroundColor); PageGrid.Background = brush; } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } } }
public OptionViewPage() { this.InitializeComponent(); WhiteFontRButton.IsChecked = true; base.DataContext = new OptionViewModel(); if (!String.IsNullOrEmpty(ApplicationService.Instance.Settings.BackGroundColor)) { try { var brush = HexToColorConverter.GetColorFromHex(ApplicationService.Instance.Settings.BackGroundColor); PageGrid.Background = brush; } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } } }
public AudioViewPage() { this.InitializeComponent(); DataContext = new AudioViewModel(); if (!String.IsNullOrEmpty(ApplicationService.Instance.Settings.BackGroundColor)) { try { var brush = HexToColorConverter.GetColorFromHex(ApplicationService.Instance.Settings.BackGroundColor); PageGrid.Background = brush; } catch (Exception ex) { Debug.WriteLine(ex.ToString()); } } //UserId = Frame.GetNavigationState(); //((AudioViewModel) DataContext).User.Uid = UserId; //((AudioViewModel)DataContext).AddAudiosCommand.Execute(null); }
/// <summary> /// Init this instance. /// </summary> public static void Init() { StandardImageCellRenderer.Init(); StandardTextCellRenderer.Init(); StandardViewCellRenderer.Init(); EntryLineRenderer.Init(); ListViewGroupedRenderer.Init(); EmailValidatorBehavior.Init(); EmptyValidatorBehavior.Init(); NavigationPageNoLineRenderer.Init(); BooleanToObjectConverter <string> .Init(); HexToColorConverter.Init(); InvertedBooleanConverter.Init(); UpperTextConverter.Init(); LowerTextConverter.Init(); HasDataConverter.Init(); MessagingService.Init(); MessagingServiceAlert.Init(); MessagingServiceQuestion.Init(); MessagingServiceChoice.Init(); }
public ResearchStudiesViewModel(CoreDispatcher viewUI, GridView resultsGridView, ProgressBar progressStatus) { _viewUI = viewUI; _resultsGridView = resultsGridView; _progressStatus = progressStatus; CurrentUser = SuspensionManager.SessionState["CurrentUser"] as User; SelectedConditions = TypeAheadHelper.GetConditionString(CurrentUser); DataService.CollectionChanged += StudyCollectionChanged; StudyTiles = new ObservableCollection <StudyTile>(); StudyTileBg = new Gradient { Start = HexToColorConverter.ConvertFromHex("#FF7FA3CF"), End = HexToColorConverter.ConvertFromHex("#FF3E80CF") }; NewTileBg = new Gradient { Start = HexToColorConverter.ConvertFromHex("#FF57d763"), End = HexToColorConverter.ConvertFromHex("#FF3ea747") }; }
public void Setup() { converter = new HexToColorConverter(); }