Replies: 1 comment 1 reply
-
Sorry for the late reply. <Page.Resources>
<Style x:Key="BasicButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Red" />
<Setter Property="Padding" Value="4,16" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}">
<ContentPresenter Content="{TemplateBinding Content}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Page.Resources>
<Grid>
<Button Content="ShowDialog" Click="ShowDialog" />
</Grid> private async void ShowDialog(object sender, RoutedEventArgs e)
{
var dialog = new ContentDialog()
{
Title = "TItle",
Content = "blablabla",
PrimaryButtonText = "Yes",
CloseButtonText = "Dismiss",
PrimaryButtonStyle = (Style)this.Resources["BasicButtonStyle"],
};
await dialog.ShowAsync();
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I realize I'm a novice when it comes to XAML, but how can I override the style of the buttons on a ContentDialog? I've tried several different ways, but the style is the same. I just want my buttons (Primary and Secondary) to be taller (so they are easier to click on when using a touch screen). Platform is Skia, but I assume that shouldn't matter. I know I can set the PrimaryButtonStyle, but nothing happens, I've tried to change the background, border, height, nothing seems to "take".
Beta Was this translation helpful? Give feedback.
All reactions