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

WPF

 
GeneralRe: How to trigger a method after some time span Pin
Aslesh10-Jul-08 4:53
Aslesh10-Jul-08 4:53 
QuestionError in capturing Images and Video in same form Pin
Manch Manj8-Jul-08 20:12
Manch Manj8-Jul-08 20:12 
AnswerRe: Error in capturing Images and Video in same form Pin
Pete O'Hanlon8-Jul-08 22:07
mvePete O'Hanlon8-Jul-08 22:07 
GeneralRe: Error in capturing Images and Video in same form Pin
Manch Manj9-Jul-08 20:31
Manch Manj9-Jul-08 20:31 
QuestionShow 3d-mediatype in wpf [modified] Pin
hmshmsm8-Jul-08 1:41
hmshmsm8-Jul-08 1:41 
Questionwpf command parameters Pin
cechode7-Jul-08 9:34
cechode7-Jul-08 9:34 
AnswerRe: wpf command parameters Pin
Gideon Engelberth9-Jul-08 5:06
Gideon Engelberth9-Jul-08 5:06 
QuestionBind Objects to ListView / Grid where Objects hold their Position in Grid [modified] Pin
ezazazel7-Jul-08 4:33
ezazazel7-Jul-08 4:33 
Greetings from my side!
First of all I have to make clear that I'm pretty new to WPF.
I wish to display a matrix of 64x64 items via a gridview/ listview or whatever seems to be appropriate.
I have a class which holds two properties which represent the position inside the grid,
eg.0/1 Row 0, Column 1

Up to64x64 of these items are held inside a Generic List.
Now I want to bind this List and would like to see the elements in their declared cell.

Here's the code so far:
public partial class Window1 : Window
{
    public Window1()
    {
        InitializeComponent();

        List<MatrixElements> elements = new List<MatrixElements>();
        for (int i = 0; i < 64; i++)
        {
            for (int j = 0; j < 64; j++)
            {
                elements.Add(new MatrixElements(i, j,
                    string.Format("Element: {0}/{1}", i.ToString(), j.ToString()),
                    string.Format("ToolTip: {0}/{1}", i.ToString(), j.ToString()),
                    Colors.Green));

            }
        }

        //TODO: Add to ListView or Grid where PositionX/PositionY marks the Position of the cell
    }
}

public class MatrixElements
{
    public int PositionX { get; set; }
    public int PositionY { get; set; }

    public string Text { get; set; }
    public string ToolTip { get; set; }

    public Color BackgroundColor { get; set; }

    public MatrixElements()
    {
    }

    public MatrixElements(int PositionX, int PositionY, string Text, string ToolTip, Color BackgroundColor)
    {
        this.PositionX = PositionX;
        this.PositionY = PositionY;
        this.Text = Text;
        this.ToolTip = ToolTip;
        this.BackgroundColor = BackgroundColor;
    }
}


After all, not all items are existant at the same time which means, that I can have 0/0 0/1 (no 0/2) and 0/3.
My first idea was to override the ListView's Method AddChild(object item), but I found no way how to tell the Grid where to insert the items.

Help would be appreciated, preferable explained with a few lines of code (I know you won't do my "homework" for me, but since I'm new to WPF this would really help a lot).

Thank you in advance,
eza

modified on Tuesday, July 8, 2008 5:01 AM

AnswerRe: Bind Objects to ListView / Grid where Objects hold their Position in Grid Pin
Gideon Engelberth9-Jul-08 5:14
Gideon Engelberth9-Jul-08 5:14 
GeneralRe: Bind Objects to ListView / Grid where Objects hold their Position in Grid Pin
ezazazel9-Jul-08 8:51
ezazazel9-Jul-08 8:51 
GeneralRe: Bind Objects to ListView / Grid where Objects hold their Position in Grid Pin
Gideon Engelberth9-Jul-08 12:51
Gideon Engelberth9-Jul-08 12:51 
GeneralRe: Bind Objects to ListView / Grid where Objects hold their Position in Grid Pin
ezazazel10-Jul-08 1:15
ezazazel10-Jul-08 1:15 
GeneralRe: Bind Objects to ListView / Grid where Objects hold their Position in Grid Pin
Gideon Engelberth10-Jul-08 3:25
Gideon Engelberth10-Jul-08 3:25 
QuestionrichTextbox to HTML ? [modified] Pin
Mohammad Dayyan5-Jul-08 14:27
Mohammad Dayyan5-Jul-08 14:27 
AnswerRe: richTextbox to HTML ? Pin
Pete O'Hanlon6-Jul-08 4:00
mvePete O'Hanlon6-Jul-08 4:00 
QuestionShow CHM Help File Pin
Jammer5-Jul-08 10:49
Jammer5-Jul-08 10:49 
AnswerRe: Show CHM Help File Pin
Pete O'Hanlon6-Jul-08 8:50
mvePete O'Hanlon6-Jul-08 8:50 
GeneralRe: Show CHM Help File Pin
Jammer6-Jul-08 13:14
Jammer6-Jul-08 13:14 
GeneralRe: Show CHM Help File Pin
Krishnraj31-Jul-08 19:38
Krishnraj31-Jul-08 19:38 
QuestionHandle return(ENTER) pressing on richTextBox in WPF ? [modified] Pin
Mohammad Dayyan4-Jul-08 3:50
Mohammad Dayyan4-Jul-08 3:50 
AnswerRe: Handle return(ENTER) pressing on richTextBox in WPF ? Pin
Pete O'Hanlon4-Jul-08 9:41
mvePete O'Hanlon4-Jul-08 9:41 
GeneralRe: Handle return(ENTER) pressing on richTextBox in WPF ? Pin
Mohammad Dayyan4-Jul-08 9:47
Mohammad Dayyan4-Jul-08 9:47 
GeneralRe: Handle return(ENTER) pressing on richTextBox in WPF ? Pin
Pete O'Hanlon4-Jul-08 10:05
mvePete O'Hanlon4-Jul-08 10:05 
GeneralRe: Handle return(ENTER) pressing on richTextBox in WPF ? Pin
Mohammad Dayyan4-Jul-08 10:19
Mohammad Dayyan4-Jul-08 10:19 
QuestionSilverLight beta 2 Pin
Member 39206674-Jul-08 1:17
Member 39206674-Jul-08 1:17 

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.