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();
 }
Example #4
0
 /// <summary>
 /// Called when stream content is changed.
 /// </summary>
 protected virtual void OnStreamChanged()
 {
     StreamChanged.Raise(this);
 }
Example #5
0
 protected void ReportStreamChanged(WatcherChangeTypes changeType)
 {
     StreamChanged?.Invoke(this, changeType);
 }
Example #6
0
 protected virtual void OnStreamChanged(byte[] imageBuffer)
 {
     StreamChanged?.Invoke(this, imageBuffer);
 }