public virtual void EventInDataTemplate()
        {
            string xaml  = @"
<Grid>
    <Grid.Resources>
        <DataTemplate x:Key=""temp"">
            <test:EventTests_visual CustomEvent=""{b:DXEvent 'Do4($test:BindingTests_a.StaticIntProp)'}""/>
        </DataTemplate>
    </Grid.Resources>
    <ContentControl Content=""{b:DXBinding}"" ContentTemplate=""{StaticResource temp}""/>
    <ContentControl Content=""{b:DXBinding}"" ContentTemplate=""{StaticResource temp}""/>
</Grid>
";
            var    panel = BindingTestHelper.LoadXaml <Grid>(xaml);

            BindingTestHelper.VisualTest(panel, () => {
                BindingTests_a.Static(2);
                var vm            = EventTests_a.Create();
                var tb1           = LayoutTreeHelper.GetVisualChildren(panel.Children[0]).OfType <EventTests_visual>().First();
                var tb2           = LayoutTreeHelper.GetVisualChildren(panel.Children[1]).OfType <EventTests_visual>().First();
                panel.DataContext = vm;
                BindingTestHelper.DoEvents(panel);
                tb1.RaiseCustomEvent();
                tb2.RaiseCustomEvent();
                Assert.AreEqual(2, vm.Do4Counter);
            });
        }
        public virtual void Parameters()
        {
            string xaml = @"
<Grid x:Name=""root"">
    <Grid.Resources>
        <Style x:Key=""st"" TargetType=""TextBox"">
            <Setter Property=""Text"" Value=""{b:DXBinding IntProp+$test:BindingTests_a.StaticIntProp,
                                        BackExpr='IntProp=int.Parse(@v)-$test:BindingTests_a.StaticIntProp'}""/>
        </Style>
    </Grid.Resources>
    <test:EventTests_visual x:Name=""bt1"" CustomEvent=""{b:DXEvent 'Do3(@args, @e(bt2), @sender)'}""/>
    <test:EventTests_visual x:Name=""bt2"" CustomEvent=""{b:DXEvent 'Do3(@args, @e(bt1), @sender)'}""/>
</Grid>";

            var  vm    = EventTests_a.Create();
            Grid panel = BindingTestHelper.LoadXaml <Grid>(xaml);
            var  bt1   = (EventTests_visual)panel.Children[0];
            var  bt2   = (EventTests_visual)panel.Children[1];

            panel.DataContext = vm;
            BindingTestHelper.DoEvents(panel);
            bt1.RaiseCustomEvent();
            Assert.AreEqual(bt2, vm.Do3Parameter);
            Assert.AreEqual(EventArgs.Empty, vm.Do3EventArgs);
            Assert.AreEqual(bt1, vm.Do3Sender);
            bt2.RaiseCustomEvent();
            Assert.AreEqual(bt1, vm.Do3Parameter);
            Assert.AreEqual(EventArgs.Empty, vm.Do3EventArgs);
            Assert.AreEqual(bt2, vm.Do3Sender);
        }
        public virtual void TwoMethods()
        {
            var vm = EventTests_a.Create();
            var bt = BindingTestHelper.BindAssert <EventTests_visual>("test:EventTests_visual", "CustomEvent", "{b:DXEvent 'Do1(); Do2()'}", null, vm);

            bt.RaiseCustomEvent();
            Assert.AreEqual(1, vm.Do1Counter);
            Assert.AreEqual(1, vm.Do2Counter);
        }
        public void T983298()
        {
            var vm = EventTests_a.Create();
            var bt = BindingTestHelper.BindAssert <EventTests_visual>(
                "test:EventTests_visual",
                "CustomEvent",
                "{b:DXEvent Do6(null)}", null, vm);

            bt.RaiseCustomEvent();
            Assert.AreEqual(1, vm.Do6Counter);
        }
        public virtual void OneMethod()
        {
            var vm = EventTests_a.Create();
            var bt = BindingTestHelper.BindAssert <EventTests_visual>("test:EventTests_visual", "CustomRoutedEvent", "{b:DXEvent Do1()}", null, vm);

            Assert.AreEqual(0, vm.Do1Counter);
            bt.RaiseCustomRoutedEvent();
            Assert.AreEqual(1, vm.Do1Counter);

            bt = BindingTestHelper.BindAssert <EventTests_visual>("test:EventTests_visual", "CustomEvent", "{b:DXEvent Do1()}", null, vm);
            bt.RaiseCustomEvent();
            Assert.AreEqual(2, vm.Do1Counter);
        }
        public void NewOperator()
        {
            var vm = EventTests_a.Create();
            var bt = BindingTestHelper.BindAssert <EventTests_visual>(
                "test:EventTests_visual",
                "CustomRoutedEvent",
                "{b:DXEvent Do5(new $Thickness(@s.Margin.Left))}", null, vm);

            bt.RaiseCustomRoutedEvent();
            Assert.AreEqual(new Thickness(), vm.Do5V);
            bt.Margin = new Thickness(1);
            bt.RaiseCustomRoutedEvent();
            Assert.AreEqual(new Thickness(1), vm.Do5V);
        }