Click here to Skip to main content
15,891,946 members
Home / Discussions / WPF
   

WPF

 
QuestionProblem w/ ClickOnce deployment and EventLogs Pin
vsaratkar8-Feb-10 9:46
vsaratkar8-Feb-10 9:46 
QuestionDragging outlook attached documents into a WPF app Pin
RugbyLeague8-Feb-10 3:59
RugbyLeague8-Feb-10 3:59 
AnswerRe: Dragging outlook attached documents into a WPF app Pin
Pete O'Hanlon8-Feb-10 4:24
mvePete O'Hanlon8-Feb-10 4:24 
GeneralRe: Dragging outlook attached documents into a WPF app Pin
RugbyLeague8-Feb-10 5:34
RugbyLeague8-Feb-10 5:34 
QuestionMVVM standardization [modified] Pin
Michael Sync7-Feb-10 5:46
Michael Sync7-Feb-10 5:46 
AnswerRe: MVVM standardization Pin
Wes Aday8-Feb-10 12:35
professionalWes Aday8-Feb-10 12:35 
QuestionDataTemplate with List binding Pin
pbalaga6-Feb-10 9:20
pbalaga6-Feb-10 9:20 
AnswerRe: DataTemplate with List binding Pin
Pete O'Hanlon6-Feb-10 9:58
mvePete O'Hanlon6-Feb-10 9:58 
One way to do this would be to use a ViewModel approach, and bind to a string property that aggregates this data. Consider the following sample:
public class MyClass
{
  private List<int> _myList = new List<int>();
  public string AggregateList
  {
    get
    {
      if (_myList != null && _myList.Count > 0)
      {
        StringBuilder myString = new StringBuilder();
        foreach (int value in _myList)
        {
          sb.AppendFormat("{0},", value);
        }
        return sb.ToString().Substring(0, sb.ToString().Length - 2);
      }
      return string.Empty;
    }
    set
    {
      string[] values = value.Split(",");
      _myList.Clear();
      foreach (string item in values)
      {
        int output;
        if (int.TryParse(item, out output))
        {
          _myList.Add(output);
        }
      }
    }
  }
}
You could do something like this using converters, but this is a simple method - and you just need to bind to this property. I've just knocked this up in the HTML editor here, so there may be a mistake or two, so I apologise in advance for them.

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



GeneralRe: DataTemplate with List binding Pin
pbalaga6-Feb-10 21:35
pbalaga6-Feb-10 21:35 
GeneralRe: DataTemplate with List binding Pin
Pete O'Hanlon6-Feb-10 22:01
mvePete O'Hanlon6-Feb-10 22:01 
AnswerRe: DataTemplate with List binding Pin
Abhinav S6-Feb-10 10:06
Abhinav S6-Feb-10 10:06 
GeneralRe: DataTemplate with List binding Pin
pbalaga6-Feb-10 21:37
pbalaga6-Feb-10 21:37 
GeneralRe: DataTemplate with List binding [modified] Pin
Abhinav S6-Feb-10 21:45
Abhinav S6-Feb-10 21:45 
GeneralRe: DataTemplate with List binding Pin
Pete O'Hanlon6-Feb-10 23:46
mvePete O'Hanlon6-Feb-10 23:46 
QuestionQuick Question About Application Launch Pin
BlitzPackage6-Feb-10 2:48
BlitzPackage6-Feb-10 2:48 
QuestionHow to get Event for the Windows.shapes.path Pin
Joe Rozario5-Feb-10 17:14
Joe Rozario5-Feb-10 17:14 
QuestionReporting with silverlight Pin
jonatan_5565-Feb-10 3:43
jonatan_5565-Feb-10 3:43 
AnswerRe: Reporting with silverlight Pin
Pete O'Hanlon5-Feb-10 11:11
mvePete O'Hanlon5-Feb-10 11:11 
GeneralRe: Reporting with silverlight Pin
jonatan_55611-Feb-10 1:46
jonatan_55611-Feb-10 1:46 
AnswerMessage Removed Pin
8-Feb-10 23:10
Perpetuum Software8-Feb-10 23:10 
GeneralRe: Reporting with silverlight Pin
jonatan_55611-Feb-10 1:50
jonatan_55611-Feb-10 1:50 
QuestionHow to show tooltip over a TreeViewItem if it is not fully Visible? Pin
Venkatesh Mookkan4-Feb-10 16:32
Venkatesh Mookkan4-Feb-10 16:32 
QuestionOverride OnRender - (class inherits frameworkelement) Pin
DTh19784-Feb-10 13:21
DTh19784-Feb-10 13:21 
AnswerRe: Override OnRender - (class inherits frameworkelement) Pin
Super Lloyd4-Feb-10 16:52
Super Lloyd4-Feb-10 16:52 
QuestionBinding an Image in WPF ? Pin
Mohammad Dayyan4-Feb-10 0:52
Mohammad Dayyan4-Feb-10 0:52 

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.