Exemple #1
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            Properties.Add(new PropertyItem
            {
                Header     = "项目名称",
                Value      = _task.References.Project.Name,
                Glyph      = WtIconHelper.GetGlyph(_task.References.Project.Visibility),
                IsReadonly = true,
                Color      = new SolidColorBrush((Color)Resources["SystemAccentColor"])
            });

            string taskTypeId = _task.Value.TaskTypeId;
            var    taskType   = _task.References.TaskTypes.Single(t => t.Id == taskTypeId);

            Properties.Add(new PropertyItem
            {
                Header     = "任务类型",
                Value      = taskType.Name,
                Glyph      = WtIconHelper.GetGlyph("wtf-type-" + taskType.Icon),
                IsReadonly = true,
                Color      = WtColorHelper.GetSolidColorBrush(WtColorHelper.GetColorByClass(taskType.Icon))
            });

            var reader = new PropertiesReader();
            var props  = reader.Read(_task);

            foreach (var item in props)
            {
                Properties.Add(item);
            }

            reader.LoadOptions(_task.Value.Id, Properties, Dispatcher);
        }
Exemple #2
0
 protected void SetColor(KanbanItemProperty kbp, string color)
 {
     if (color == null)
     {
         kbp.Foreground = WtColorHelper.GetSolidColorBrush("#aaaaaa");
         kbp.Background = WtColorHelper.GetSolidColorBrush("#33aaaaaa");
     }
     else
     {
         string newColor = WtColorHelper.GetNewColor(color);
         kbp.Foreground = WtColorHelper.GetSolidColorBrush(newColor);
         kbp.Background = WtColorHelper.GetSolidColorBrush(newColor.Insert(1, "33"));
     }
 }