public NoteView(string dir) { directory = dir; notes = new List<Note>(); ListBox = new Eto.Forms.ListBox() { Style = "ListNative" }; TextArea = new Eto.Forms.TextArea() { Style = "TextConsole" }; TextArea.TextChanged += delegate { if (ListBox.SelectedIndex < 0) return; bool changed = notes[ListBox.SelectedIndex].Changed; notes[ListBox.SelectedIndex].Content = TextArea.Text; if (changed != notes[ListBox.SelectedIndex].Changed) ListBox.Invalidate(); }; ListBox.SelectedIndexChanged += delegate { if (ListBox.SelectedIndex < 0) return; TextArea.Text = notes[ListBox.SelectedIndex].Content; }; }
public NoteView(string dir) { directory = dir; notes = new List <Note>(); ListBox = new Eto.Forms.ListBox() { Style = "ListNative" }; TextArea = new Eto.Forms.TextArea() { Style = "TextConsole" }; TextArea.TextChanged += delegate { if (ListBox.SelectedIndex < 0) { return; } bool changed = notes[ListBox.SelectedIndex].Changed; notes[ListBox.SelectedIndex].Content = TextArea.Text; if (changed != notes[ListBox.SelectedIndex].Changed) { ListBox.Invalidate(); } }; ListBox.SelectedIndexChanged += delegate { if (ListBox.SelectedIndex < 0) { return; } TextArea.Text = notes[ListBox.SelectedIndex].Content; }; }
public ListBox() { EtoListBox = new Eto.Forms.ListBox(); EtoControl = EtoListBox; Items = new ListItemCollection(EtoListBox); }