Click here to Skip to main content
15,895,799 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to communication between buisness layer and UI layer in a three-tier project Pin
Ben Fair12-Dec-08 9:48
Ben Fair12-Dec-08 9:48 
GeneralRe: How to communication between buisness layer and UI layer in a three-tier project Pin
Uwe Keim12-Dec-08 9:51
sitebuilderUwe Keim12-Dec-08 9:51 
QuestionNewbie :- How to pass which UIElement name on? Pin
me0812-Dec-08 3:56
me0812-Dec-08 3:56 
AnswerRe: Newbie :- How to pass which UIElement name on? Pin
dan!sh 12-Dec-08 4:32
professional dan!sh 12-Dec-08 4:32 
AnswerRe: Newbie :- How to pass which UIElement name on? Pin
DaveyM6912-Dec-08 4:40
professionalDaveyM6912-Dec-08 4:40 
AnswerRe: Newbie :- How to pass which UIElement name on? [modified] Pin
ARon_12-Dec-08 5:40
ARon_12-Dec-08 5:40 
GeneralRe: Newbie :- How to pass which UIElement name on? Pin
me0812-Dec-08 9:03
me0812-Dec-08 9:03 
GeneralRe: Newbie :- How to pass which UIElement name on? Pin
ARon_12-Dec-08 10:03
ARon_12-Dec-08 10:03 
I hoped I helpled.

Comments.

This is out side the foeach loop so you only adding once.
ImageMN1.Click += delegate { front_Click(ImageX[I].Tag); };


You need a common method that each Image can call. Check out the ContextMenuOpeningEvent. Subscribe to each Images’ ContextMenuOpeningEvent and then if one of your Image Controls raises the event the function could assign sender to the ImageMN1.tag.

I do WinForm not WPF so I not sure how you subscribe to events. If it was WinForms I could do this.

foreach (string f in Directory.GetFiles(@MyDir, "*.jpg"))
{
     ...
     ImageX[i].OnContextMenuOpening += new EventHandlee(MyOnContextMenuOpening);
     ...
}
...

void MyOnContextMenuOpening(ContextMenuEventArgs e) 
{
     this.ImageMN1.Tag = e.sender;
}


ARon

QuestionCan I create a public object? Pin
Steve Harp12-Dec-08 3:12
Steve Harp12-Dec-08 3:12 
AnswerRe: Can I create a public object? Pin
Tom Deketelaere12-Dec-08 3:16
professionalTom Deketelaere12-Dec-08 3:16 
GeneralRe: Can I create a public object? Pin
DaveyM6912-Dec-08 3:23
professionalDaveyM6912-Dec-08 3:23 
GeneralRe: Can I create a public object? Pin
Tom Deketelaere12-Dec-08 3:45
professionalTom Deketelaere12-Dec-08 3:45 
AnswerRe: Can I create a public object? Pin
Colin Angus Mackay12-Dec-08 3:25
Colin Angus Mackay12-Dec-08 3:25 
GeneralRe: Can I create a public object? Pin
Steve Harp12-Dec-08 3:45
Steve Harp12-Dec-08 3:45 
GeneralRe: Can I create a public object? Pin
N a v a n e e t h12-Dec-08 6:48
N a v a n e e t h12-Dec-08 6:48 
AnswerRe: Can I create a public object? Pin
CodingYoshi12-Dec-08 3:28
CodingYoshi12-Dec-08 3:28 
AnswerRe: Can I create a public object? Pin
Gideon Engelberth12-Dec-08 3:47
Gideon Engelberth12-Dec-08 3:47 
GeneralRe: Can I create a public object? Pin
Steve Harp12-Dec-08 5:22
Steve Harp12-Dec-08 5:22 
AnswerRe: Can I create a public object? Pin
PIEBALDconsult12-Dec-08 6:49
mvePIEBALDconsult12-Dec-08 6:49 
Questionmath namespace Pin
MS Lee12-Dec-08 2:55
MS Lee12-Dec-08 2:55 
AnswerRe: math namespace Pin
dan!sh 12-Dec-08 3:00
professional dan!sh 12-Dec-08 3:00 
AnswerRe: math namespace Pin
Lev Danielyan12-Dec-08 3:00
Lev Danielyan12-Dec-08 3:00 
GeneralRe: math namespace Pin
MS Lee12-Dec-08 3:12
MS Lee12-Dec-08 3:12 
GeneralRe: math namespace Pin
Lev Danielyan12-Dec-08 3:20
Lev Danielyan12-Dec-08 3:20 
GeneralRe: math namespace Pin
MS Lee12-Dec-08 3:43
MS Lee12-Dec-08 3:43 

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.