2013-05-14 213 views
1

我在WorkflowDesigner中使用PropertyInspectorView作爲我的WPF應用程序中的屬性網格。WPF屬性網格使用PropertyInspectorView

http://img89.imageshack.us/img89/2176/propertygrid.jpg

在這裏,我想,

  1. 刪除 「清除」 按鈕

  2. 變化 「進行分類」 和 「排序A-Z」 按鈕圖標/背景色。

  3. 將這兩個按鈕移動到搜索文本框的右側。

  4. 改變顏色(背景,字體,邊框)

請讓我知道,如果這事可能嗎?那怎麼樣?

回答

1

要改變顏色使用以下鍵,

PropertyInspectorBackgroundBrushKey

PropertyInspectorBorderBrushKey

PropertyInspectorCategoryCaptionTextBrushKey

PropertyInspectorPaneBrushKey

PropertyInspectorToolBarBackgroundBrushKey

PropertyInspectorSelectedBackgroundBrushKey

PropertyInspectorSelectedForegroundBrushKey

Dim Designer As New WorkflowDesigner() 
    Dim rd As String = "<ResourceDictionary 
          x:Uid='ResourceDictionary_1' xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
          xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' 
          xmlns:sap='clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation' 
          xmlns:sapv ='clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation'> 
          <SolidColorBrush x:Uid='SolidColorBrush_01' x:Key='{x:Static sap: WorkflowDesignerColors.PropertyInspectorBackgroundBrushKey}' Color='Red'/> 
          </ResourceDictionary>" 


    Dim reader As New StringReader(rd) 
    Dim xmlReader As XmlReader = XmlReader.Create(reader) 
    Dim fontAndColorDictionary As ResourceDictionary = DirectCast(System.Windows.Markup.XamlReader.Load(xmlReader), ResourceDictionary) 
    Dim hashTable As New Hashtable() 
    For Each key As String In fontAndColorDictionary.Keys 
     hashTable.Add(key, fontAndColorDictionary(key)) 
    Next 

    Designer.PropertyInspectorFontAndColorData = XamlServices.Save(hashTable)