//--------------------------------------------------------Attributes:-----------------------------------------------------------------\\
        #region --Attributes--


        #endregion
        //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
        #region --Constructors--


        #endregion
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--


        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is string s)
            {
                if (double.TryParse(s, out double grade))
                {
                    if (grade < 2)
                    {
                        return(new SolidColorBrush(Colors.DarkGreen));
                    }
                    if (grade < 3)
                    {
                        return(new SolidColorBrush(Colors.YellowGreen));
                    }
                    if (grade <= 4)
                    {
                        return(new SolidColorBrush(Colors.DarkOrange));
                    }
                    return(new SolidColorBrush(Colors.DarkRed));
                }
                if (s == "B")
                {
                    return(new SolidColorBrush(Colors.DarkGreen));
                }
            }
            return(ThemeUtils.GetThemeResource <SolidColorBrush>("TumBlueBrush"));
        }
Beispiel #2
0
        //--------------------------------------------------------Attributes:-----------------------------------------------------------------\\
        #region --Attributes--


        #endregion
        //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
        #region --Constructors--


        #endregion
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--


        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (value is ChatType chatType && chatType == ChatType.CHAT)
            {
                return(ThemeUtils.GetThemeResource <FontFamily>("ContentControlThemeFontFamily"));
            }
            return(ThemeUtils.GetThemeResource <FontFamily>("SymbolThemeFontFamily"));
        }
Beispiel #3
0
        //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
        #region --Constructors--


        #endregion
        //--------------------------------------------------------Set-, Get- Methods:---------------------------------------------------------\\
        #region --Set-, Get- Methods--


        #endregion
        //--------------------------------------------------------Misc Methods:---------------------------------------------------------------\\
        #region --Misc Methods (Public)--
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            if (Resources is null)
            {
                return(new SolidColorBrush(Colors.Red));
            }

            if (value is MessageState state && state == MessageState.UNREAD)
            {
                return(new SolidColorBrush(ThemeUtils.GetThemeResource <Color>("SystemAccentColor")));
            }

            return(ThemeUtils.GetThemeResource <SolidColorBrush>("CaptionTextBrush", Resources));
        }
Beispiel #4
0
 private static SolidColorBrush GetHyperlinkLinkForeground(FrameworkElement element)
 {
     return(ThemeUtils.GetThemeResource <SolidColorBrush>("LinkAccentColorBrush"));
 }
Beispiel #5
0
 private static SolidColorBrush GetQuoteForeground()
 {
     return(ThemeUtils.GetThemeResource <SolidColorBrush>("CaptionTextBrush"));
 }