This question is locked. New answers and comments are not allowed.
I am using RadMessageBox with a custom Control Template.
Here is my template:
I call RadMessageBox with the following code:
The message displays fine, however, the three buttons are stacked vertically on top of each other.
Is there a way to get them lined up next to each other horizontally?
Also, the text in the Buttons is aligned to the left. Any way to get it centered?
Here is my template:
<ControlTemplate x:Key="StoreTemplate" TargetType="special:RadMessageBoxControl"> <Border Padding="12" Background="{StaticResource PhoneChromeBrush}"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <ContentControl x:Name="PART_Title" HorizontalContentAlignment="Left" FontSize="{StaticResource PhoneFontSizeLarge}" FontFamily="{StaticResource PhoneFontFamilySemiBold}" Margin="{StaticResource PhoneMargin}" /> <Grid Grid.Row="1"> <ContentControl HorizontalContentAlignment="Left" VerticalContentAlignment="Top" FontSize="{StaticResource PhoneFontSizeNormal}" FontFamily="{StaticResource PhoneFontFamilyNormal}" x:Name="PART_Message" Margin="12, 12, 12, 24"> <ContentControl.ContentTemplate> <DataTemplate> <TextBlock Text="{Binding}" TextWrapping="Wrap" /> </DataTemplate> </ContentControl.ContentTemplate> </ContentControl> </Grid> <CheckBox x:Name="PART_CheckBox" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" /> <ContentControl Grid.Row="3" x:Name="PART_ButtonsContainer" HorizontalContentAlignment="Stretch"> <ContentControl.ContentTemplate> <DataTemplate> <StackPanel x:Name="PART_ButtonsPanel" Orientation="Horizontal" HorizontalAlignment="Center"></StackPanel> </DataTemplate> </ContentControl.ContentTemplate> </ContentControl> </Grid> </Border></ControlTemplate>I call RadMessageBox with the following code:
var userResponse = await RadMessageBox.ShowAsync(msgTemplate, AppResources.TrialMsgTitle, new string[] { AppResources.UpgradeButtonText, AppResources.TrialButtonText, AppResources.LaterButtonText }, AppResources.TrialMsgMsg, null, false, false, HorizontalAlignment.Stretch, VerticalAlignment.Top);The message displays fine, however, the three buttons are stacked vertically on top of each other.
Is there a way to get them lined up next to each other horizontally?
Also, the text in the Buttons is aligned to the left. Any way to get it centered?