Click here to Skip to main content
       

Silverlight / WPF

 
QuestionWPF performance on Windows XP PinmemberVasudevan Deepak Kumar2-Apr-13 11:46 
AnswerRe: WPF performance on Windows XP PinmemberSledgeHammer012-Apr-13 12:39 
GeneralRe: WPF performance on Windows XP PinmemberGerry Schmitz2-Apr-13 13:05 
GeneralRe: WPF performance on Windows XP PinmemberSledgeHammer012-Apr-13 13:12 
GeneralRe: WPF performance on Windows XP PinmemberGerry Schmitz2-Apr-13 13:38 
GeneralRe: WPF performance on Windows XP PinmemberSledgeHammer012-Apr-13 14:02 
GeneralRe: WPF performance on Windows XP PinmemberGerry Schmitz2-Apr-13 14:45 
AnswerRe: WPF performance on Windows XP PinprotectorPete O'Hanlon2-Apr-13 13:09 
QuestionComboBox in a DataGrid, Binding Problem Pinmembershakilahmad1232-Apr-13 2:23 
QuestionHello All. Pinmembercaradri2-Apr-13 0:08 
AnswerRe: Hello All. PinmemberKenneth Haugland2-Apr-13 10:21 
QuestionData display issue with combo box in wpf data grid Pinmemberukraju1-Apr-13 8:31 
AnswerRe: Data display issue with combo box in wpf data grid PinmvpRichard MacCutchan1-Apr-13 22:48 
QuestionGet File Path from ListView PinmemberMumbleB31-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 PinmemberMycroft Holmes31-Mar-13 13:39 
GeneralRe: Get File Path from ListView PinmemberMumbleB1-Apr-13 1:34 
GeneralRe: Get File Path from ListView PinmemberMycroft Holmes1-Apr-13 2:23 
GeneralRe: Get File Path from ListView PinmemberMumbleB2-Apr-13 10:10 
GeneralRe: Get File Path from ListView PinmemberMycroft Holmes2-Apr-13 13:15 
GeneralRe: Get File Path from ListView [modified] PinmemberMumbleB3-Apr-13 8:27 
QuestionCollection of User Controls PinmemberMycroft Holmes30-Mar-13 23:44 
AnswerRe: Collection of User Controls PinmemberSledgeHammer0131-Mar-13 15:48 
GeneralRe: Collection of User Controls PinmemberMycroft Holmes31-Mar-13 15:55 
GeneralRe: Collection of User Controls PinmemberSledgeHammer0131-Mar-13 16:13 
GeneralRe: Collection of User Controls PinmemberMycroft Holmes31-Mar-13 16:30 
GeneralRe: Collection of User Controls PinmemberSledgeHammer0131-Mar-13 16:43 
GeneralRe: Collection of User Controls PinmemberMycroft Holmes31-Mar-13 16:59 
GeneralRe: Collection of User Controls PinmemberSledgeHammer0131-Mar-13 17:20 
GeneralRe: Collection of User Controls PinmemberMycroft Holmes31-Mar-13 19:02 
QuestionWPF ComboBox With User Control PinmemberKevin Marois30-Mar-13 11:24 
AnswerRe: WPF ComboBox With User Control(This may not work.) Pinmemberfrazzle-me30-Mar-13 11:52 
GeneralRe: WPF ComboBox With User Control(This may not work.) PinmemberKevin Marois30-Mar-13 12:09 
GeneralRe: WPF ComboBox With User Control(This may not work.) Pinmemberfrazzle-me30-Mar-13 12:24 
AnswerRe: WPF ComboBox With User Control PinmemberSledgeHammer0130-Mar-13 14:19 
GeneralWindows 8 WPF Theme? Pinmemberavenger1928-Mar-13 18:20 
AnswerRe: Windows 8 WPF Theme? PinmemberCollin Jasnoch3-Apr-13 9:59 
GeneralRe: Windows 8 WPF Theme? PinmvpMeshack Musundi4-Apr-13 8:48 
QuestionC# WPF Accessing parameter of chosen data grid row Pinmemberjohnyjj228-Mar-13 10:55 
QuestionExtending WPF WebBrowser Control [modified] PinmemberCoxianuk28-Mar-13 7:48 
AnswerRe: Extending WPF WebBrowser Control [modified] PinmemberRichard Deeming28-Mar-13 10:19 
GeneralRe: Extending WPF WebBrowser Control [modified] PinmemberCoxianuk28-Mar-13 11:26 
GeneralRe: Extending WPF WebBrowser Control Pinmemberfrazzle-me28-Mar-13 11:52 
QuestionWindows Phone App Development using C# 2010 PinmemberTwiztedFreek26-Mar-13 19:16 
QuestionRe: Windows Phone App Development using C# 2010 PinmvpRichard MacCutchan27-Mar-13 0:00 
AnswerRe: Windows Phone App Development using C# 2010 PinmvpAbhinav S27-Mar-13 19:02 
QuestionLooking for a windows phone 7.1 XNA programmer PinmemberMember 955005526-Mar-13 0:09 
AnswerRe: Looking for a windows phone 7.1 XNA programmer PinmvpRichard MacCutchan26-Mar-13 1:09 
AnswerRe: Looking for a windows phone 7.1 XNA programmer PinmemberMarco Bertschi26-Mar-13 2:15 
QuestionCode-generated buttons in Stackpanel: how to handle events? PinmemberDirk.Bock22-Mar-13 13:24 
AnswerRe: Code-generated buttons in Stackpanel: how to handle events? PinmemberMycroft 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
Web01 | 2.8.141220.1 | Last Updated 18 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid