Click here to Skip to main content
11,493,046 members (66,770 online)

Silverlight / WPF

 
QuestionWPF performance on Windows XP Pin
Vasudevan Deepak Kumar2-Apr-13 11:46
memberVasudevan Deepak Kumar2-Apr-13 11:46 
AnswerRe: WPF performance on Windows XP Pin
SledgeHammer012-Apr-13 12:39
memberSledgeHammer012-Apr-13 12:39 
GeneralRe: WPF performance on Windows XP Pin
Gerry Schmitz2-Apr-13 13:05
memberGerry Schmitz2-Apr-13 13:05 
GeneralRe: WPF performance on Windows XP Pin
SledgeHammer012-Apr-13 13:12
memberSledgeHammer012-Apr-13 13:12 
GeneralRe: WPF performance on Windows XP Pin
Gerry Schmitz2-Apr-13 13:38
memberGerry Schmitz2-Apr-13 13:38 
GeneralRe: WPF performance on Windows XP Pin
SledgeHammer012-Apr-13 14:02
memberSledgeHammer012-Apr-13 14:02 
GeneralRe: WPF performance on Windows XP Pin
Gerry Schmitz2-Apr-13 14:45
memberGerry Schmitz2-Apr-13 14:45 
AnswerRe: WPF performance on Windows XP Pin
Pete O'Hanlon2-Apr-13 13:09
protectorPete O'Hanlon2-Apr-13 13:09 
QuestionComboBox in a DataGrid, Binding Problem Pin
shakilahmad1232-Apr-13 2:23
membershakilahmad1232-Apr-13 2:23 
QuestionHello All. Pin
caradri2-Apr-13 0:08
membercaradri2-Apr-13 0:08 
AnswerRe: Hello All. Pin
Kenneth Haugland2-Apr-13 10:21
memberKenneth Haugland2-Apr-13 10:21 
QuestionData display issue with combo box in wpf data grid Pin
ukraju1-Apr-13 8:31
memberukraju1-Apr-13 8:31 
AnswerRe: Data display issue with combo box in wpf data grid Pin
Richard MacCutchan1-Apr-13 22:48
mvpRichard MacCutchan1-Apr-13 22:48 
QuestionGet File Path from ListView Pin
MumbleB31-Mar-13 4:44
memberMumbleB31-Mar-13 4: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 13:39
memberMycroft Holmes31-Mar-13 13:39 
GeneralRe: Get File Path from ListView Pin
MumbleB1-Apr-13 1:34
memberMumbleB1-Apr-13 1:34 
GeneralRe: Get File Path from ListView Pin
Mycroft Holmes1-Apr-13 2:23
memberMycroft Holmes1-Apr-13 2:23 
GeneralRe: Get File Path from ListView Pin
MumbleB2-Apr-13 10:10
memberMumbleB2-Apr-13 10:10 
GeneralRe: Get File Path from ListView Pin
Mycroft Holmes2-Apr-13 13:15
memberMycroft Holmes2-Apr-13 13:15 
GeneralRe: Get File Path from ListView [modified] Pin
MumbleB3-Apr-13 8:27
memberMumbleB3-Apr-13 8:27 
QuestionCollection of User Controls Pin
Mycroft Holmes30-Mar-13 23:44
memberMycroft Holmes30-Mar-13 23:44 
AnswerRe: Collection of User Controls Pin
SledgeHammer0131-Mar-13 15:48
memberSledgeHammer0131-Mar-13 15:48 
GeneralRe: Collection of User Controls Pin
Mycroft Holmes31-Mar-13 15:55
memberMycroft Holmes31-Mar-13 15:55 
GeneralRe: Collection of User Controls Pin
SledgeHammer0131-Mar-13 16:13
memberSledgeHammer0131-Mar-13 16:13 
GeneralRe: Collection of User Controls Pin
Mycroft Holmes31-Mar-13 16:30
memberMycroft Holmes31-Mar-13 16:30 
GeneralRe: Collection of User Controls Pin
SledgeHammer0131-Mar-13 16:43
memberSledgeHammer0131-Mar-13 16:43 
GeneralRe: Collection of User Controls Pin
Mycroft Holmes31-Mar-13 16:59
memberMycroft Holmes31-Mar-13 16:59 
GeneralRe: Collection of User Controls Pin
SledgeHammer0131-Mar-13 17:20
memberSledgeHammer0131-Mar-13 17:20 
GeneralRe: Collection of User Controls Pin
Mycroft Holmes31-Mar-13 19:02
memberMycroft Holmes31-Mar-13 19:02 
QuestionWPF ComboBox With User Control Pin
Kevin Marois30-Mar-13 11:24
memberKevin Marois30-Mar-13 11:24 
AnswerRe: WPF ComboBox With User Control(This may not work.) Pin
frazzle-me30-Mar-13 11:52
memberfrazzle-me30-Mar-13 11:52 
GeneralRe: WPF ComboBox With User Control(This may not work.) Pin
Kevin Marois30-Mar-13 12:09
memberKevin Marois30-Mar-13 12:09 
GeneralRe: WPF ComboBox With User Control(This may not work.) Pin
frazzle-me30-Mar-13 12:24
memberfrazzle-me30-Mar-13 12:24 
AnswerRe: WPF ComboBox With User Control Pin
SledgeHammer0130-Mar-13 14:19
memberSledgeHammer0130-Mar-13 14:19 
GeneralWindows 8 WPF Theme? Pin
avenger1928-Mar-13 18:20
memberavenger1928-Mar-13 18:20 
AnswerRe: Windows 8 WPF Theme? Pin
Collin Jasnoch3-Apr-13 9:59
memberCollin Jasnoch3-Apr-13 9:59 
GeneralRe: Windows 8 WPF Theme? Pin
Meshack Musundi4-Apr-13 8:48
mvpMeshack Musundi4-Apr-13 8:48 
QuestionC# WPF Accessing parameter of chosen data grid row Pin
johnyjj228-Mar-13 10:55
memberjohnyjj228-Mar-13 10:55 
QuestionExtending WPF WebBrowser Control [modified] Pin
Coxianuk28-Mar-13 7:48
memberCoxianuk28-Mar-13 7:48 
AnswerRe: Extending WPF WebBrowser Control [modified] Pin
Richard Deeming28-Mar-13 10:19
memberRichard Deeming28-Mar-13 10:19 
GeneralRe: Extending WPF WebBrowser Control [modified] Pin
Coxianuk28-Mar-13 11:26
memberCoxianuk28-Mar-13 11:26 
GeneralRe: Extending WPF WebBrowser Control Pin
frazzle-me28-Mar-13 11:52
memberfrazzle-me28-Mar-13 11:52 
QuestionWindows Phone App Development using C# 2010 Pin
TwiztedFreek26-Mar-13 19:16
memberTwiztedFreek26-Mar-13 19:16 
QuestionRe: Windows Phone App Development using C# 2010 Pin
Richard MacCutchan27-Mar-13 0:00
mvpRichard MacCutchan27-Mar-13 0:00 
AnswerRe: Windows Phone App Development using C# 2010 Pin
Abhinav S27-Mar-13 19:02
mvpAbhinav S27-Mar-13 19:02 
QuestionLooking for a windows phone 7.1 XNA programmer Pin
Member 955005526-Mar-13 0:09
memberMember 955005526-Mar-13 0:09 
AnswerRe: Looking for a windows phone 7.1 XNA programmer Pin
Richard MacCutchan26-Mar-13 1:09
mvpRichard MacCutchan26-Mar-13 1:09 
AnswerRe: Looking for a windows phone 7.1 XNA programmer Pin
Marco Bertschi26-Mar-13 2:15
memberMarco Bertschi26-Mar-13 2:15 
QuestionCode-generated buttons in Stackpanel: how to handle events? Pin
Dirk.Bock22-Mar-13 13:24
memberDirk.Bock22-Mar-13 13:24 
AnswerRe: Code-generated buttons in Stackpanel: how to handle events? Pin
Mycroft Holmes22-Mar-13 15:14
memberMycroft Holmes22-Mar-13 15:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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
Web04 | 2.8.150520.1 | Last Updated 28 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid