Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(GH-3175) MetroWindow: use BorderThickness as Margin for inner window content #3176

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -35,9 +35,9 @@
Controls:TextBoxHelper.WatermarkAlignment="Right" />
<DatePicker Width="200"
Margin="0 10 0 0"
HorizontalAlignment="Center"
Controls:ControlsHelper.IsReadOnly="True"
SelectedDate="{x:Static system:DateTime.Now}"
HorizontalAlignment="Center" />
SelectedDate="{x:Static system:DateTime.Now}" />
<DatePicker Width="200"
Margin="0 10 0 0"
HorizontalAlignment="Center"
Expand Down
Expand Up @@ -135,8 +135,8 @@

<ControlTemplate.Triggers>
<Trigger Property="Controls:ControlsHelper.IsReadOnly" Value="True">
<Setter TargetName="PART_TextBox" Property="IsReadOnly" Value="True" />
<Setter TargetName="PART_Button" Property="IsEnabled" Value="False" />
<Setter TargetName="PART_TextBox" Property="IsReadOnly" Value="True" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Base" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(Controls:ControlsHelper.MouseOverBorderBrush)}" />
Expand Down
12 changes: 8 additions & 4 deletions src/MahApps.Metro/MahApps.Metro/Themes/MetroWindow.xaml
Expand Up @@ -13,9 +13,11 @@
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />

<ControlTemplate x:Key="WindowTemplateKey" TargetType="{x:Type Controls:MetroWindow}">
<Grid LayoutTransform="{Binding LayoutTransform, RelativeSource={RelativeSource TemplatedParent}}" RenderTransform="{Binding RenderTransform, RelativeSource={RelativeSource TemplatedParent}}">
<Grid Background="{TemplateBinding Background}"
LayoutTransform="{Binding LayoutTransform, RelativeSource={RelativeSource TemplatedParent}}"
RenderTransform="{Binding RenderTransform, RelativeSource={RelativeSource TemplatedParent}}">
<AdornerDecorator>
<Grid Background="{TemplateBinding Background}">
<Grid Margin="{TemplateBinding BorderThickness}">
<Grid.ColumnDefinitions>
<!-- icon -->
<ColumnDefinition Width="Auto" />
Expand Down Expand Up @@ -266,9 +268,11 @@
</ControlTemplate>

<ControlTemplate x:Key="CenterWindowTemplateKey" TargetType="{x:Type Controls:MetroWindow}">
<Grid LayoutTransform="{Binding LayoutTransform, RelativeSource={RelativeSource TemplatedParent}}" RenderTransform="{Binding RenderTransform, RelativeSource={RelativeSource TemplatedParent}}">
<Grid Background="{TemplateBinding Background}"
LayoutTransform="{Binding LayoutTransform, RelativeSource={RelativeSource TemplatedParent}}"
RenderTransform="{Binding RenderTransform, RelativeSource={RelativeSource TemplatedParent}}">
<AdornerDecorator>
<Grid Background="{TemplateBinding Background}">
<Grid Margin="{TemplateBinding BorderThickness}">
<Grid.ColumnDefinitions>
<!-- icon -->
<ColumnDefinition Width="Auto" />
Expand Down