Пример #1
0
        private void SetInfoUiValues()
        {
            var color = (SolidColorBrush) new BrushConverter().ConvertFrom("#212121");

            foreach (var control in GridInfo.GetChildren <Label>().Where(c => c.Name.IsEmpty()))
            {
                control.Foreground = color;
            }

            var templateVersion = settings.DetectedTemplateVersion;

            if (templateVersion.IsEmpty())
            {
                LabelTemplateVersion.Content = "--";
                LabelCompatibility.Content   = "--";
            }

            LabelTemplateVersion.Content    = templateVersion;
            LabelTemplateVersion.Foreground = Brushes.Blue;

            var isTemplateLatest = new Version(templateVersion) >= new Version(Constants.LatestTemplateVersion);

            LabelTemplateLatest.Content    = isTemplateLatest ? "(latest)" : "(outdated)";
            LabelTemplateLatest.Foreground = isTemplateLatest ? Brushes.Green : Brushes.PaleVioletRed;

            var isTemplateCompatible = new Version(templateVersion) >= new Version(Constants.MinTemplateVersion);

            LabelCompatibility.Content    = isTemplateCompatible ? "YES" : "NO";
            LabelCompatibility.Foreground = isTemplateCompatible ? Brushes.Green : Brushes.Red;
        }