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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        /// <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();
        }
Ejemplo n.º 4
0
 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());
         }
     }
 }
Ejemplo n.º 5
0
 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());
         }
     }
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
        /// <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();
        }
Ejemplo n.º 8
0
        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")
            };
        }
Ejemplo n.º 9
0
 public void Setup()
 {
     converter = new HexToColorConverter();
 }