private void ToggleButton_OnChecked(object sender, RoutedEventArgs e) { CheckBox chk = (CheckBox)sender; Stream str = (Stream)chk.DataContext; ObservableCollection <Stream> s = (ObservableCollection <Stream>)DataContext; if (!str.Selected) { if (_canbeunselected) { StreamChanged?.Invoke(null); return; } str.Selected = true; e.Handled = true; } else { Stream n = s.FirstOrDefault(a => a.Selected && a != str); if (n != null) { n.Selected = false; } StreamChanged?.Invoke(str); } }
private void Stream_LostFocus(object sender, RoutedEventArgs e) { StreamChanged.Invoke(); }
private void Button_Click(object sender, RoutedEventArgs e) { Stream.Text = Clipboard.GetText(); StreamChanged.Invoke(); }
/// <summary> /// Called when stream content is changed. /// </summary> protected virtual void OnStreamChanged() { StreamChanged.Raise(this); }
protected void ReportStreamChanged(WatcherChangeTypes changeType) { StreamChanged?.Invoke(this, changeType); }
protected virtual void OnStreamChanged(byte[] imageBuffer) { StreamChanged?.Invoke(this, imageBuffer); }