Click here to Skip to main content
15,891,905 members
Home / Discussions / WPF
   

WPF

 
QuestionBinding an Image in WPF ? Pin
Mohammad Dayyan4-Feb-10 0:52
Mohammad Dayyan4-Feb-10 0:52 
AnswerRe: Binding an Image in WPF ? Pin
Pete O'Hanlon4-Feb-10 2:16
mvePete O'Hanlon4-Feb-10 2:16 
GeneralRe: Binding an Image in WPF ? Pin
Mohammad Dayyan4-Feb-10 2:55
Mohammad Dayyan4-Feb-10 2:55 
GeneralRe: Binding an Image in WPF ? Pin
Pete O'Hanlon4-Feb-10 3:32
mvePete O'Hanlon4-Feb-10 3:32 
GeneralRe: Binding an Image in WPF ? Pin
Mohammad Dayyan4-Feb-10 3:35
Mohammad Dayyan4-Feb-10 3:35 
QuestionDeveloping Application for WPF on MAc Pin
wasimsharp3-Feb-10 17:47
wasimsharp3-Feb-10 17:47 
AnswerRe: Developing Application for WPF on MAc Pin
SeMartens3-Feb-10 21:32
SeMartens3-Feb-10 21:32 
QuestionDisplaying a Matrix: ListView/GridView CellTemplates for rows and columns. Pin
Bartosz Bien3-Feb-10 11:45
Bartosz Bien3-Feb-10 11:45 
Hello,

For my scientific application, I need a WPF control to display matrices of floating-point numbers. The sizes of matrices differ from 1*1 to approx. 100k*64. Rows may differ by foreground color (2 types), and columns may differ by background color (also 2 types).

An example is here: http://bartoszbien.com/public/MatrixCtrl.png.

Using a ListView, I've been able to display values in cells, and to color the text as needed. However, I'm not able to set background color for the columns, because setting a CellTemplate for a column does not work (by design) when the DisplayMemberBinding is set.

Do I need to write my own control from scratch, or is it possible to reach my goal using the ListView?

My style for the rows:
<Style x:Key="MatrixRowStyle" TargetType="{x:Type ListViewItem}">
  <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  <Style.Triggers>
    <DataTrigger Binding="{Binding Type}" Value="Type1">
      <Setter Property="Foreground" Value="Lime" />
    </DataTrigger>
    <DataTrigger Binding="{Binding Type}" Value="Type2">
      <Setter Property="Foreground" Value="RoyalBlue" />
    </DataTrigger>
  </Style.Triggers>
</Style>

My DisplayMemberBinding for the columns:
column.DisplayMemberBinding = new Binding(string.Format("Values[{0}]", count));

The Values member comes from:
public class MatrixRow
{
    public EType Type { get; set; }
    public double[] Values { get; set; }
}

The ListView's ItemsSource is assigned with an IEnumerator of MatrixRow objects.

Best regards,
BB
http://bartoszbien.com

AnswerRe: Displaying a Matrix: ListView/GridView CellTemplates for rows and columns. Pin
Super Lloyd3-Feb-10 12:30
Super Lloyd3-Feb-10 12:30 
QuestionHow to get Active Directory attribute(s) Pin
rgouette3-Feb-10 4:17
rgouette3-Feb-10 4:17 
AnswerRe: How to get Active Directory attribute(s) Pin
Abhinav S3-Feb-10 5:49
Abhinav S3-Feb-10 5:49 
GeneralRe: How to get Active Directory attribute(s) Pin
rgouette3-Feb-10 6:33
rgouette3-Feb-10 6:33 
Question[Solved] Combobox of line dash styles Pin
Richard Dutton3-Feb-10 3:07
Richard Dutton3-Feb-10 3:07 
AnswerRe: Combobox of line dash styles Pin
Pete O'Hanlon3-Feb-10 3:48
mvePete O'Hanlon3-Feb-10 3:48 
GeneralRe: Combobox of line dash styles Pin
Richard Dutton4-Feb-10 0:06
Richard Dutton4-Feb-10 0:06 
GeneralRe: Combobox of line dash styles Pin
Pete O'Hanlon4-Feb-10 1:17
mvePete O'Hanlon4-Feb-10 1:17 
QuestionDeployment Error Pin
vsaratkar2-Feb-10 10:38
vsaratkar2-Feb-10 10:38 
AnswerRe: Deployment Error Pin
Super Lloyd2-Feb-10 11:24
Super Lloyd2-Feb-10 11:24 
GeneralRe: Deployment Error Pin
vsaratkar3-Feb-10 5:14
vsaratkar3-Feb-10 5:14 
GeneralRe: Deployment Error Pin
Super Lloyd3-Feb-10 10:16
Super Lloyd3-Feb-10 10:16 
GeneralRe: Deployment Error Pin
Super Lloyd3-Feb-10 10:21
Super Lloyd3-Feb-10 10:21 
GeneralRe: Deployment Error Pin
vsaratkar3-Feb-10 10:50
vsaratkar3-Feb-10 10:50 
QuestionCapture images via webcam Pin
Yosh_2-Feb-10 2:15
professionalYosh_2-Feb-10 2:15 
AnswerRe: Capture images via webcam Pin
Abhinav S2-Feb-10 3:53
Abhinav S2-Feb-10 3:53 
AnswerRe: Capture images via webcam Pin
Kunal Chowdhury «IN»8-Feb-10 7:08
professionalKunal Chowdhury «IN»8-Feb-10 7:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.