Click here to Skip to main content
12,396,461 members (68,851 online)

Silverlight / WPF

 
QuestionWPF performance on Windows XP Pin
Vasudevan Deepak Kumar2-Apr-13 10:46
memberVasudevan Deepak Kumar2-Apr-13 10:46 
AnswerRe: WPF performance on Windows XP Pin
SledgeHammer012-Apr-13 11:39
memberSledgeHammer012-Apr-13 11:39 
GeneralRe: WPF performance on Windows XP Pin
Gerry Schmitz2-Apr-13 12:05
memberGerry Schmitz2-Apr-13 12:05 
GeneralRe: WPF performance on Windows XP Pin
SledgeHammer012-Apr-13 12:12
memberSledgeHammer012-Apr-13 12:12 
GeneralRe: WPF performance on Windows XP Pin
Gerry Schmitz2-Apr-13 12:38
memberGerry Schmitz2-Apr-13 12:38 
GeneralRe: WPF performance on Windows XP Pin
SledgeHammer012-Apr-13 13:02
memberSledgeHammer012-Apr-13 13:02 
GeneralRe: WPF performance on Windows XP Pin
Gerry Schmitz2-Apr-13 13:45
memberGerry Schmitz2-Apr-13 13:45 
AnswerRe: WPF performance on Windows XP Pin
Pete O'Hanlon2-Apr-13 12:09
protectorPete O'Hanlon2-Apr-13 12:09 
QuestionComboBox in a DataGrid, Binding Problem Pin
shakilahmad1232-Apr-13 1:23
membershakilahmad1232-Apr-13 1:23 
QuestionHello All. Pin
caradri1-Apr-13 23:08
membercaradri1-Apr-13 23:08 
AnswerRe: Hello All. Pin
Kenneth Haugland2-Apr-13 9:21
memberKenneth Haugland2-Apr-13 9:21 
QuestionData display issue with combo box in wpf data grid Pin
ukraju1-Apr-13 7:31
memberukraju1-Apr-13 7:31 
AnswerRe: Data display issue with combo box in wpf data grid Pin
Richard MacCutchan1-Apr-13 21:48
mvpRichard MacCutchan1-Apr-13 21:48 
QuestionGet File Path from ListView Pin
MumbleB31-Mar-13 3:44
memberMumbleB31-Mar-13 3:44 
Hi Guys, I have a nice working app in Windows Forms. I am attempting to port it to WPF and I am stuck with selecting a row and getting a value from one of the columns.

Apologies for the long code:

In Windows Forms App I do the below:

private void lstFiles_DoubleClick(object sender, EventArgs e)
{
    if (lstFiles.SelectedItems.Count != 0)
    {
        string file = lstFiles.SelectedItems[0].Text;
        openFormGeneral(file);
    }
}

In WPF .xaml:

<ListView x:Name="lstFile" Height="357" HorizontalAlignment="Left" Margin="18,144,0,0" VerticalAlignment="Top" Width="550"
          ItemsSource="{Binding songDetails}"
          MouseDoubleClick="lstFile_MouseDoubleClick"
          IsSynchronizedWithCurrentItem="True"
          SelectedItem="{Binding Path=SelectedSong}">
    <ListView.View>
        <GridView>
            <GridViewColumn CellTemplate="{StaticResource FirstCell}" Width="30" />
            <GridViewColumn Header="File Name" DisplayMemberBinding="{Binding FileName}" />
            <GridViewColumn Header="Title" DisplayMemberBinding="{Binding Title}" />
            <GridViewColumn Header="Artist" DisplayMemberBinding="{Binding Artist}" />
            <GridViewColumn Header="Album" DisplayMemberBinding="{Binding Album}" />
            <GridViewColumn Header="Set" DisplayMemberBinding="{Binding Set}" />
            <GridViewColumn Header="Genre" DisplayMemberBinding="{Binding Genre}" />
            <GridViewColumn Header="Language" DisplayMemberBinding="{Binding Language}" />
            <GridViewColumn Header="File Path" DisplayMemberBinding="{Binding FilePath}" />
        </GridView>
    </ListView.View>
</ListView>

I Populate the ListView as follows:

public class songDetails
{
public string Title { get; set; }
public string Artist { get; set; }
public string Track { get; set; }
public string Set { get; set; }
public string Album { get; set; }
public string Genre { get; set; }
public string Language { get; set; }
public string FileName { get; set; }
public string FilePath { get; set; }
}
 
public IList<songDetails> songDetail { get; set; }
 

public void AddFile(ID3Info File)
{
    lstFile.Items.Add(new
    {
        FileName = File.FileName,
        Artist = File.ID3v2Info.GetTextFrame("TPE1"),
        Title = File.ID3v2Info.GetTextFrame("TIT2"),
        Track = File.ID3v2Info.GetTextFrame("TRCK"),
        Album = File.ID3v2Info.GetTextFrame("TALB"),
        Genre = File.ID3v2Info.GetTextFrame("TCON"),
        Language = File.ID3v2Info.GetTextFrame("TLAN"),
        FilePath = File.FilePath
    });
 
    artist = File.ID3v2Info.GetTextFrame("TPE1");
    track = File.ID3v2Info.GetTextFrame("TRCK");
    set = File.ID3v2Info.GetTextFrame("TPOS");
    title = File.ID3v2Info.GetTextFrame("TIT2");
    album = File.ID3v2Info.GetTextFrame("TALB");
    genre = File.ID3v2Info.GetTextFrame("TCON");
    language = File.ID3v2Info.GetTextFrame("TLAN");
 
    InitializeComponent();
    this.DataContext = this;
}
How do I access the FilePath from the ListView with MouseDoubleClick event? Thanks in advance
Excellence is doing ordinary things extraordinarily well.

AnswerRe: Get File Path from ListView Pin
Mycroft Holmes31-Mar-13 12:39
memberMycroft Holmes31-Mar-13 12:39 
GeneralRe: Get File Path from ListView Pin
MumbleB1-Apr-13 0:34
memberMumbleB1-Apr-13 0:34 
GeneralRe: Get File Path from ListView Pin
Mycroft Holmes1-Apr-13 1:23
memberMycroft Holmes1-Apr-13 1:23 
GeneralRe: Get File Path from ListView Pin
MumbleB2-Apr-13 9:10
memberMumbleB2-Apr-13 9:10 
GeneralRe: Get File Path from ListView Pin
Mycroft Holmes2-Apr-13 12:15
memberMycroft Holmes2-Apr-13 12:15 
GeneralRe: Get File Path from ListView Pin
MumbleB3-Apr-13 7:27
memberMumbleB3-Apr-13 7:27 
QuestionCollection of User Controls Pin
Mycroft Holmes30-Mar-13 22:44
memberMycroft Holmes30-Mar-13 22:44 
AnswerRe: Collection of User Controls Pin
SledgeHammer0131-Mar-13 14:48
memberSledgeHammer0131-Mar-13 14:48 
GeneralRe: Collection of User Controls Pin
Mycroft Holmes31-Mar-13 14:55
memberMycroft Holmes31-Mar-13 14:55 
GeneralRe: Collection of User Controls Pin
SledgeHammer0131-Mar-13 15:13
memberSledgeHammer0131-Mar-13 15:13 
GeneralRe: Collection of User Controls Pin
Mycroft Holmes31-Mar-13 15:30
memberMycroft Holmes31-Mar-13 15:30 
GeneralRe: Collection of User Controls Pin
SledgeHammer0131-Mar-13 15:43
memberSledgeHammer0131-Mar-13 15:43 
GeneralRe: Collection of User Controls Pin
Mycroft Holmes31-Mar-13 15:59
memberMycroft Holmes31-Mar-13 15:59 
GeneralRe: Collection of User Controls Pin
SledgeHammer0131-Mar-13 16:20
memberSledgeHammer0131-Mar-13 16:20 
GeneralRe: Collection of User Controls Pin
Mycroft Holmes31-Mar-13 18:02
memberMycroft Holmes31-Mar-13 18:02 
QuestionWPF ComboBox With User Control Pin
Kevin Marois30-Mar-13 10:24
memberKevin Marois30-Mar-13 10:24 
AnswerRe: WPF ComboBox With User Control(This may not work.) Pin
frazzle-me30-Mar-13 10:52
memberfrazzle-me30-Mar-13 10:52 
GeneralRe: WPF ComboBox With User Control(This may not work.) Pin
Kevin Marois30-Mar-13 11:09
memberKevin Marois30-Mar-13 11:09 
GeneralRe: WPF ComboBox With User Control(This may not work.) Pin
frazzle-me30-Mar-13 11:24
memberfrazzle-me30-Mar-13 11:24 
AnswerRe: WPF ComboBox With User Control Pin
SledgeHammer0130-Mar-13 13:19
memberSledgeHammer0130-Mar-13 13:19 
GeneralWindows 8 WPF Theme? Pin
avenger1928-Mar-13 17:20
memberavenger1928-Mar-13 17:20 
AnswerRe: Windows 8 WPF Theme? Pin
Collin Jasnoch3-Apr-13 8:59
memberCollin Jasnoch3-Apr-13 8:59 
GeneralRe: Windows 8 WPF Theme? Pin
Meshack Musundi4-Apr-13 7:48
mvpMeshack Musundi4-Apr-13 7:48 
QuestionC# WPF Accessing parameter of chosen data grid row Pin
johnyjj228-Mar-13 9:55
memberjohnyjj228-Mar-13 9:55 
QuestionExtending WPF WebBrowser Control Pin
Coxianuk28-Mar-13 6:48
memberCoxianuk28-Mar-13 6:48 
AnswerRe: Extending WPF WebBrowser Control Pin
Richard Deeming28-Mar-13 9:19
memberRichard Deeming28-Mar-13 9:19 
GeneralRe: Extending WPF WebBrowser Control Pin
Coxianuk28-Mar-13 10:26
memberCoxianuk28-Mar-13 10:26 
GeneralRe: Extending WPF WebBrowser Control Pin
frazzle-me28-Mar-13 10:52
memberfrazzle-me28-Mar-13 10:52 
QuestionWindows Phone App Development using C# 2010 Pin
TwiztedFreek26-Mar-13 18:16
memberTwiztedFreek26-Mar-13 18:16 
QuestionRe: Windows Phone App Development using C# 2010 Pin
Richard MacCutchan26-Mar-13 23:00
mvpRichard MacCutchan26-Mar-13 23:00 
AnswerRe: Windows Phone App Development using C# 2010 Pin
Abhinav S27-Mar-13 18:02
mvpAbhinav S27-Mar-13 18:02 
QuestionLooking for a windows phone 7.1 XNA programmer Pin
Member 955005525-Mar-13 23:09
memberMember 955005525-Mar-13 23:09 
AnswerRe: Looking for a windows phone 7.1 XNA programmer Pin
Richard MacCutchan26-Mar-13 0:09
mvpRichard MacCutchan26-Mar-13 0:09 
AnswerRe: Looking for a windows phone 7.1 XNA programmer Pin
Marco Bertschi26-Mar-13 1:15
memberMarco Bertschi26-Mar-13 1:15 
QuestionCode-generated buttons in Stackpanel: how to handle events? Pin
Dirk.Bock22-Mar-13 12:24
memberDirk.Bock22-Mar-13 12:24 
AnswerRe: Code-generated buttons in Stackpanel: how to handle events? Pin
Mycroft Holmes22-Mar-13 14:14
memberMycroft Holmes22-Mar-13 14:14 

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.


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 24 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid