Can i call a function via DataTrigger (XAML)?
问题 I have a function in .xaml.cs which i wanted to call: .xaml.cs private void treeView_SelectedItemChanged(object sender, EventArgs e) { //treeView.ScrollToCenterOfView(sender as TreeViewItem); } like from this post: Make ListView.ScrollIntoView Scroll the Item into the Center of the ListView (C#) Answer 1 But i dont use the SelectedItem, my approach would be like: XAML: <Style.Triggers> <DataTrigger Binding="{Binding Path=IsActive}" Value="true"> // ###call this function </DataTrigger> </Style