2008-12-10 17 views
11

मैं Grid रों के एक जोड़े को स्वरूपित करने के लिए कई GridViewColumn.CellTemplate रों उपयोग कर रहा हूँ के माध्यम से WPF के Grid.RowDefinitions कैसे निर्धारित करें:शैली

<ListView SharedSizeScope="true"> 
    <ListView.View> 
    <GridView> 
     <GridViewColumn> 
     <GridViewColumn.CellTemplate> 
      <DataTemplate> 
      <Grid> 
       <Grid.RowDefinitions> 
       <RowDefinition SharedSizeGroup="foo" /> 
       <!-- ... --> 

मैं RowDefinition रों (जो सभी स्तंभों के लिए ही कर रहे हैं) को निकालने की कोशिश की Style एक में:

<Style TargetType="{x:Type Grid}"> 
    <Setter Property="RowDefinitions"> 
    <Setter.Value> 
     <RowDefinition SharedSizeGroup="foo" /> 
     <!-- ... --> 

लेकिन संकलक शिकायत:

Error: The Property Setter 'RowDefinitions' cannot be set because it does not have an accessible set accessor.

जो कि स्पष्ट है, लेकिन बहुत उपयोगी नहीं है।

Grid के कस्टम व्युत्पन्न को कोड करने के लिए मैं पंक्ति परिभाषाओं को कई बार निर्दिष्ट करने से कैसे बच सकता हूं (Don't Repeat Yourself भी देखें)?

उत्तर

7

ग्रिड नियंत्रण टेम्पलेट्स का समर्थन नहीं करता है (here से लिया गया जानकारी और अप्रत्यक्ष रूप से, here से)।

संबंधित मुद्दे