xaml-only

WPF ListBox of Button's: how to change selected item on click with XAML

I have a templated listbox: <ListBox Grid.Row="0" Grid.Column="1" Background="Transparent" BorderThickness="0" x:Name="mainMenu" ItemsSource="{Binding Source={x:Static local:MenuConfig.MainMenu}, Mode=OneTime}" IsSynchronizedWithCurrentItem="True"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <EventSetter ...

How to center text around point using xaml

I would like to be able to place the word "hello" centered on a specific point. I need to do this completely in XAML without extra code. Best I can tell, all the text alignment properties/styles in XAML act on text within some bounding canvas or other element. Since I don't know the length of the text I want to center, I can't cente...