wpf - Style TreeviewItem with Powershell -


i'm learning powershell , doing small script, checks log file conditions. results displayed in gui. gui made xaml. possibile change color child items individually? can color part of string instance in red, other in green?

thank you...

the function use add items:

function addchild ($content, $color) {  if ($color) {     $ime.addchild($content)     #here change color } else {  $ime.items.add($content)  }     

}

my xaml looks this:

    <treeview name="tree" height="374" margin="5,109,0,0" verticalalignment="top" width="450">              <treeviewitem name="ime" header="joba">              </treeviewitem>     </treeview> 

assuming $content treeviewitem you're trying add $ime, set foreground , background properties set colors:

if ($color) {     $content.foreground = $color } $ime.items.add($content) 

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -