Thursday, October 6, 2016

Lambda Expressions / statement

            this.MyAC.PreviewKeyDown += new KeyEventHandler(async (a, b) =>
                 this.MyAC.ItemsSource = await ViewModels.MainViewModel.GetItems(((RadAutoCompleteBox)a).SearchText, b.Key)
            );

            this.MyAC.PreviewKeyDown += new KeyEventHandler(async (a, b) =>
            {
                 this.MyAC.ItemsSource = await ViewModels.MainViewModel.GetItems(((RadAutoCompleteBox)a).SearchText, b.Key);
                 this.MyAC.ItemsSource.IsDropDownOpen = true;
            }
            );

            this.GridSearchBox.PreviewKeyDown += new KeyEventHandler(async (object a, KeyEventArgs b) =>
            {
                this.GridSearchBox.ItemsSource = await ViewModels.MainViewModel.GetItems(((ComboBox)a).Text, b.Key);
                this.GridSearchBox.IsDropDownOpen = true;
            }
            );

            w.MyAnswer += (value) =>
            {
                this.MyAnswer = value;
            };

            w.Closed += (object sender2, EventArgs e2) =>
            {
                SerialNumBox1.Text = this.MyAnswer;
            };

    child.Closed += new EventHandler(child_Closed);

    void child_Closed(object sender, EventArgs e)
    {
        // Child window closed
    }

            w.MyMsg2 += value2 => textBox3.Text = value2;

No comments: