Skip to content

Commit

Permalink
#87 add Classes to message box components
Browse files Browse the repository at this point in the history
  • Loading branch information
Larymar committed Dec 12, 2021
1 parent c2a14f1 commit 05727ea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 36 deletions.
14 changes: 6 additions & 8 deletions src/MessageBox.Avalonia/Views/MsBoxCustomWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,17 @@
<Image Grid.Row="1" Grid.Column="1" MaxHeight="50" MaxWidth="50" VerticalAlignment="Top"
IsVisible="{Binding Icon}"
Source="{Binding ImagePath}" />
<Grid Grid.Row="1" Grid.Column="3">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="15" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="1" Grid.Column="3" RowDefinitions="Auto,15,*">
<!--Bold text-->
<TextBox Grid.Row="0" Classes="header" FontFamily="{Binding FontFamily}" Text="{Binding ContentHeader}"
IsVisible="{Binding HasHeader}" />
<!--Content text-->
<TextBox Grid.Row="2" FontFamily="{Binding FontFamily}" Text="{Binding ContentMessage}" />
<TextBox Grid.Row="2" Classes="contentMessage" FontFamily="{Binding FontFamily}"
Text="{Binding ContentMessage}" />
</Grid>
<!--Buttons-->
<ItemsPresenter Items="{Binding ButtonDefinitions}" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3"
<ItemsPresenter Classes="buttons-item-presenter" Items="{Binding ButtonDefinitions}" Grid.Row="3"
Grid.Column="1" Grid.ColumnSpan="3"
HorizontalAlignment="Right">
<ItemsPresenter.ItemsPanel>
<ItemsPanelTemplate>
Expand All @@ -91,6 +88,7 @@
<ItemsPresenter.ItemTemplate>
<DataTemplate>
<Button Name="Btn"
Classes="button"
Tag="{Binding TypeName}"
Command="{Binding DataContext.ButtonClick, RelativeSource={RelativeSource AncestorType=Window, AncestorLevel=1}}"
CommandParameter="{Binding #Btn.Content}"
Expand Down
25 changes: 3 additions & 22 deletions src/MessageBox.Avalonia/Views/MsBoxHyperlinkWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,31 +51,12 @@
</Style>

</Window.Styles>
<Grid Classes="MsBoxHyperlinkContainer">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="15" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="15" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="15" />
<RowDefinition Height="*" />
<RowDefinition Height="15" />
<RowDefinition Height="Auto" />
<RowDefinition Height="15" />
</Grid.RowDefinitions>
<Grid Classes="MsBoxHyperlinkContainer" RowDefinitions="15,*,15,Auto,15" ColumnDefinitions="15,Auto,15,*,15">
<!--Icon-->
<Image Grid.Row="1" Grid.Column="1" MaxHeight="50" MaxWidth="50" VerticalAlignment="Top"
<Image Classes="image" Grid.Row="1" Grid.Column="1" MaxHeight="50" MaxWidth="50" VerticalAlignment="Top"
IsVisible="{Binding Icon}"
Source="{Binding ImagePath}" />
<Grid Grid.Row="1" Grid.Column="3">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="15" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="1" Grid.Column="3" RowDefinitions="Auto,15,*">
<!--Bold text-->
<TextBox Grid.Row="0" Classes="header" FontFamily="{Binding FontFamily}" Text="{Binding ContentHeader}"
IsVisible="{Binding HasHeader}" />
Expand Down
12 changes: 6 additions & 6 deletions src/MessageBox.Avalonia/Views/MsBoxStandardWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,22 @@
<TextBox Grid.Row="0" Classes="header" FontFamily="{Binding FontFamily}" Text="{Binding ContentHeader}"
IsVisible="{Binding HasHeader}" />
<!--Content text-->
<TextBox Grid.Row="1" FontFamily="{Binding FontFamily}" Text="{Binding ContentMessage}" />
<TextBox Grid.Row="1" Classes="contentMessage" FontFamily="{Binding FontFamily}" Text="{Binding ContentMessage}" />

</Grid>
<!--Buttons-->
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"
HorizontalAlignment="Right">
<Button Name="OkButton" Content="OK" Tag="Colored" Command="{Binding ButtonClickCommand}"
<Button Classes="button ok" Name="OkButton" Content="OK" Tag="Colored" Command="{Binding ButtonClickCommand}"
CommandParameter="{Binding $self.Content}"
IsVisible="{Binding IsOkShowed}" />
<Button Name="YesButton" Content="Yes" Command="{Binding ButtonClickCommand}" CommandParameter="{Binding $self.Content}"
<Button Classes="button yes" Name="YesButton" Content="Yes" Command="{Binding ButtonClickCommand}" CommandParameter="{Binding $self.Content}"
IsVisible="{Binding IsYesShowed}" />
<Button Content="No" Command="{Binding ButtonClickCommand}" CommandParameter="{Binding $self.Content}"
<Button Classes="button no" Content="No" Command="{Binding ButtonClickCommand}" CommandParameter="{Binding $self.Content}"
IsVisible="{Binding IsNoShowed}" />
<Button Content="Abort" Command="{Binding ButtonClickCommand}" CommandParameter="{Binding $self.Content}"
<Button Classes="button abort" Content="Abort" Command="{Binding ButtonClickCommand}" CommandParameter="{Binding $self.Content}"
IsVisible="{Binding IsAbortShowed}" />
<Button Content="Cancel" Command="{Binding ButtonClickCommand}" CommandParameter="{Binding $self.Content}"
<Button Classes="button cancel" Content="Cancel" Command="{Binding ButtonClickCommand}" CommandParameter="{Binding $self.Content}"
IsVisible="{Binding IsCancelShowed}" />
</StackPanel>
</Grid>
Expand Down

0 comments on commit 05727ea

Please sign in to comment.