Click here to Skip to main content
15,889,992 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Binding database values to a ComboBox more difficult in WPF Pin
Pete O'Hanlon8-Jun-09 5:02
mvePete O'Hanlon8-Jun-09 5:02 
GeneralRe: Binding database values to a ComboBox more difficult in WPF Pin
Etienne_1238-Jun-09 6:11
Etienne_1238-Jun-09 6:11 
QuestionHow to bind data to a listview in WPF Pin
Nekkantidivya7-Jun-09 18:32
Nekkantidivya7-Jun-09 18:32 
AnswerRe: How to bind data to a listview in WPF Pin
Mark Salsbery7-Jun-09 20:47
Mark Salsbery7-Jun-09 20:47 
QuestionMedia Elements usage based on some index value that matches with media element name Pin
pavanip5-Jun-09 21:45
pavanip5-Jun-09 21:45 
AnswerRe: Media Elements usage based on some index value that matches with media element name Pin
Mark Salsbery6-Jun-09 8:33
Mark Salsbery6-Jun-09 8:33 
GeneralRe: Media Elements usage based on some index value that matches with media element name Pin
pavanip6-Jun-09 19:33
pavanip6-Jun-09 19:33 
GeneralRe: Media Elements usage based on some index value that matches with media element name Pin
Mark Salsbery7-Jun-09 6:29
Mark Salsbery7-Jun-09 6:29 
Here's two examples, using two different types of collections...

Using a Dictionary<>
using System;
using System.Collections.Generic;
using System.Windows.Controls;

    // Make a dictionary of MediaElements
    Dictionary<int, MediaElement> mediaElementDictionary = new Dictionary<int, MediaElement>();

    // Add MediaElements to the dictionary
    mediaElementDictionary.Add(1, mp1);
    mediaElementDictionary.Add(2, mp2);
    ...

    // Access MediaElements in the dictionary
    int i = 1;
    MediaElement mediaelement;
    if (mediaElementDictionary.TryGetValue(i, out mediaelement))
    {
        // use mediaelement
    }

Using a List<>
using System;
using System.Collections.Generic;
using System.Windows.Controls;

    // Make a list of MediaElements
    List<MediaElement> mediaElementList = new List<MediaElement>();

    // Add MediaElements to the list
    mediaElementList.Add(mp1);
    mediaElementList.Add(mp2);
    ...

    // Access MediaElements in the list
    int i = 1;
    // Note: i is 1 to 20, indexes are zero-based so we have to subtract 1
    MediaElement mediaelement = mediaElementList[i - 1];
    // use mediaelement


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Media Elements usage based on some index value that matches with media element name Pin
pavanip8-Jun-09 18:29
pavanip8-Jun-09 18:29 
QuestionMedia Element source property in code behind Pin
pavanip5-Jun-09 21:15
pavanip5-Jun-09 21:15 
AnswerRe: Media Element source property in code behind Pin
Mark Salsbery6-Jun-09 8:31
Mark Salsbery6-Jun-09 8:31 
GeneralRe: Media Element source property in code behind Pin
pavanip6-Jun-09 19:31
pavanip6-Jun-09 19:31 
Questionhi peoples Pin
Hema Bairavan5-Jun-09 20:07
Hema Bairavan5-Jun-09 20:07 
AnswerRe: hi peoples Pin
Christian Graus5-Jun-09 23:21
protectorChristian Graus5-Jun-09 23:21 
GeneralRe: hi peoples Pin
#realJSOP5-Jun-09 23:36
mve#realJSOP5-Jun-09 23:36 
GeneralRe: hi peoples Pin
Christian Graus5-Jun-09 23:40
protectorChristian Graus5-Jun-09 23:40 
GeneralRe: hi peoples Pin
#realJSOP6-Jun-09 1:00
mve#realJSOP6-Jun-09 1:00 
GeneralRe: hi peoples Pin
Mark Salsbery6-Jun-09 8:22
Mark Salsbery6-Jun-09 8:22 
GeneralRe: hi peoples Pin
Christian Graus6-Jun-09 12:28
protectorChristian Graus6-Jun-09 12:28 
GeneralRe: hi peoples Pin
Mark Salsbery6-Jun-09 8:10
Mark Salsbery6-Jun-09 8:10 
GeneralRe: hi peoples Pin
Christian Graus6-Jun-09 12:30
protectorChristian Graus6-Jun-09 12:30 
AnswerRe: hi peoples Pin
Mark Salsbery6-Jun-09 8:10
Mark Salsbery6-Jun-09 8:10 
QuestionWPF - Move Image With Mouse Pin
Tee1235-Jun-09 15:02
Tee1235-Jun-09 15:02 
AnswerRe: WPF - Move Image With Mouse Pin
Christian Graus5-Jun-09 23:24
protectorChristian Graus5-Jun-09 23:24 
GeneralRe: WPF - Move Image With Mouse Pin
Tee1236-Jun-09 1:30
Tee1236-Jun-09 1:30 

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.