Skip to content

Commit

Permalink
Merge pull request #47695 from jmarolf/bugfix/adjust-size-for-element…
Browse files Browse the repository at this point in the history
…s-in-naming-options

only specify minimum heights and widths
  • Loading branch information
msftbot[bot] authored Sep 15, 2020
2 parents eba6123 + 8f395db commit c7c2a88
Showing 1 changed file with 20 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,26 +122,28 @@
<StackPanel Orientation="Horizontal">
<Button Name="UpButton"
AutomationProperties.Name="{Binding MoveUpAutomationText}"
Height="24" Width="24"
MinHeight="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
IsEnabled="{Binding CanMoveUp, Mode=OneWay}"
Margin="5 0 0 0"
Command="{StaticResource MoveUp}">
<imaging:CrispImage Name="UpArrowImage"
Height="16"
Width="16"
MinHeight="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Moniker="{x:Static imagecatalog:KnownMonikers.MoveUp}"
Grayscale="{Binding IsEnabled, ElementName=UpButton, Converter={StaticResource NegateBooleanConverter}}"/>
</Button>
<Button Name="DownButton"
AutomationProperties.Name="{Binding MoveDownAutomationText}"
IsEnabled="{Binding CanMoveDown, Mode=OneWay}"
AutomationProperties.AutomationId="Down"
Height="24" Width="24"
MinHeight="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Margin="5 0 5 0"
Command="{StaticResource MoveDown}">
<imaging:CrispImage Name="DownArrowImage"
Height="16"
Width="16"
MinHeight="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Moniker="{x:Static imagecatalog:KnownMonikers.MoveDown}"
Grayscale="{Binding IsEnabled, ElementName=DownButton, Converter={StaticResource NegateBooleanConverter}}"/>
</Button>
Expand All @@ -156,7 +158,7 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox
Height="22"
MinHeight="22"
ItemsSource="{Binding Specifications}"
DisplayMemberPath="Name"
SelectedItem="{Binding SelectedSpecification, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Expand All @@ -180,7 +182,7 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox
Height="22"
MinHeight="22"
ItemsSource="{Binding NamingStyles}"
DisplayMemberPath="Name"
SelectedItem="{Binding SelectedStyle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Expand All @@ -204,7 +206,7 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox
Height="22"
MinHeight="22"
ItemsSource="{Binding NotificationPreferences}"
SelectedItem="{Binding SelectedNotificationPreference,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Visibility="{Binding NotificationsAvailable, Mode=OneWay, Converter={StaticResource BooleanToVisibilityConverter}}"
Expand All @@ -219,8 +221,8 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<imaging:CrispImage Height="16"
Width="16"
<imaging:CrispImage MinHeight="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Moniker="{Binding Moniker}"
Grid.Column="0"/>
<TextBlock Margin="5, 0, 0, 0"
Expand All @@ -243,8 +245,8 @@
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Click="RemoveButton_Click"
Height="16"
Width="16"
MinHeight="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Margin="5, 0, 0, 0"
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
Expand All @@ -263,14 +265,15 @@
<StackPanel Orientation="Horizontal"
Margin="7">
<Button Name="AddButton"
Click="AddButton_Click"
Click="AddButton_Click"
AutomationProperties.Name="{x:Static style:NamingStyleOptionPageControl.AddRuleAutomationText}"
AutomationProperties.AutomationId="Add"
Height="24" Width="24"
MinHeight="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Margin="0 0 0 0">
<imaging:CrispImage Name="AddButtonImage"
Height="16"
Width="16"
MinHeight="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
Moniker="{x:Static imagecatalog:KnownMonikers.Add}" />
</Button>
<vs:DialogButton Margin="7 0 0 0" Content="{Binding Path=ManageSpecificationsButtonText}" Click="ManageSpecificationsButton_Click"/>
Expand Down

0 comments on commit c7c2a88

Please sign in to comment.