Click here to Skip to main content
15,885,876 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Scaling Polyline w/o scaling thickness Pin
Niklas L29-Oct-09 12:22
Niklas L29-Oct-09 12:22 
QuestionHow to create video chat application in wpf????? Pin
harjindersingh28-Oct-09 0:48
harjindersingh28-Oct-09 0:48 
AnswerRe: How to create video chat application in wpf????? Pin
Christian Graus28-Oct-09 13:33
protectorChristian Graus28-Oct-09 13:33 
GeneralRe: How to create video chat application in wpf????? Pin
harjindersingh28-Oct-09 19:28
harjindersingh28-Oct-09 19:28 
QuestionHow to check all rows in DataGrid by clicking Check all Button in WPF in C# Pin
ChandrakanthGaddam27-Oct-09 0:48
ChandrakanthGaddam27-Oct-09 0:48 
AnswerRe: How to check all rows in DataGrid by clicking Check all Button in WPF in C# Pin
Pete O'Hanlon27-Oct-09 0:56
mvePete O'Hanlon27-Oct-09 0:56 
GeneralRe: How to check all rows in DataGrid by clicking Check all Button in WPF in C# Pin
ChandrakanthGaddam27-Oct-09 1:08
ChandrakanthGaddam27-Oct-09 1:08 
GeneralRe: How to check all rows in DataGrid by clicking Check all Button in WPF in C# Pin
Pete O'Hanlon27-Oct-09 1:36
mvePete O'Hanlon27-Oct-09 1:36 
I've already told you how to do it. Don't try to programatically check items in the grid, use the model to do this. Suppose you have a model that looks like this:
public class MyItem : INotifyPropertyChanged
{
  private bool _selected;
  private string _name;
  private event PropertyChangedEventHandler _changed;
  public event PropertyChangedEventHandler Changed
  {
    add { _changed += value; }
    remove { _changed -= value; }
  }

  public bool Selected
  {
    get { return _selected; }
    set
    {
      if (_selected != value)
      {
        _selected = value;
        OnChanged("Selected");
      }
    }
  }
  // Name code ommitted for brevity...
}
public class MyViewModel
{
  private ObservableCollection<MyItem> _items = new ObservableCollection<MyItem>();

  public void HandleCheckAll
  {
    foreach (MyItem item in _items)
    {
      item.Selected = true;
    }
  }

  public ObservableCollection<MyItem> Items
  {
    get { return _items; }
  }

  // Some code to populate the items would need to go here....
}

All you need then is a command that calls HandleCheckAll and the grid binding to the MyViewModel.Items. The checkbox is bound (two-way) to Selected, and job's done.

"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



QuestionReference to parent collection Pin
ausadmin26-Oct-09 19:38
ausadmin26-Oct-09 19:38 
AnswerRe: Reference to parent collection Pin
Pete O'Hanlon26-Oct-09 22:44
mvePete O'Hanlon26-Oct-09 22:44 
GeneralRe: Reference to parent collection Pin
ausadmin27-Oct-09 9:54
ausadmin27-Oct-09 9:54 
GeneralRe: Reference to parent collection Pin
Pete O'Hanlon27-Oct-09 10:12
mvePete O'Hanlon27-Oct-09 10:12 
GeneralRe: Reference to parent collection Pin
ausadmin27-Oct-09 19:16
ausadmin27-Oct-09 19:16 
GeneralRe: Reference to parent collection Pin
ausadmin29-Oct-09 1:33
ausadmin29-Oct-09 1:33 
QuestionUserControl - visualbrush not rendered Pin
DeepakMega26-Oct-09 3:04
DeepakMega26-Oct-09 3:04 
AnswerRe: UserControl - visualbrush not rendered Pin
DeepakMega26-Oct-09 4:16
DeepakMega26-Oct-09 4:16 
Question3D Graphics C# and WPF Browser Application Pin
427748025-Oct-09 9:04
427748025-Oct-09 9:04 
GeneralRe: 3D Graphics C# and WPF Browser Application Book recommendation Pin
Richard MacCutchan25-Oct-09 13:31
mveRichard MacCutchan25-Oct-09 13:31 
AnswerRe: 3D Graphics C# and WPF Browser Application Pin
Death8U29-Oct-09 7:31
Death8U29-Oct-09 7:31 
QuestionMVVM Pattern Pin
NETLearning24-Oct-09 18:21
NETLearning24-Oct-09 18:21 
AnswerRe: MVVM Pattern Pin
Richard MacCutchan24-Oct-09 23:07
mveRichard MacCutchan24-Oct-09 23:07 
AnswerRe: MVVM Pattern Pin
Steve Westbrook26-Oct-09 7:00
Steve Westbrook26-Oct-09 7:00 
QuestionWPF MVVM Pin
NETLearning24-Oct-09 15:02
NETLearning24-Oct-09 15:02 
AnswerRe: WPF MVVM Pin
Richard MacCutchan24-Oct-09 23:08
mveRichard MacCutchan24-Oct-09 23:08 
QuestionMVVM newbie question - showing OpenFileDialog? Pin
Judah Gabriel Himango24-Oct-09 14:33
sponsorJudah Gabriel Himango24-Oct-09 14:33 

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.