Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to make an event with value in xaml.cs?

$
0
0

I have some RadioButton with Events, I make in the Code behind xaml.cs file. It works find, but I wish to add som value with the RadioButton Click Event. How can I do that?

Code that works

      foreach (ProductLog p in productLogCollection)
      {
       ...
        radioButton[0].Click += ProductBacklog_Click;  // Click Event without value
       ...
      }

Event code works

void ProductBacklog_Click(object sender, RoutedEventArgs e) { textBlockError.Text = "Value are: "; }

How can I do something like this?

      {
       ...
        radioButton[0].Click += ProductBacklog_Click(VALUE);
       ...
      }

    void ProductBacklog_Click(object sender, RoutedEventArgs e)
    {
      textBlockError.Text = "Value are: " + VALUE;
    }


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>