-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates ShowMeTheXaml and fixes the selection color
- Loading branch information
Showing
4 changed files
with
111 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
Material.Avalonia.Demo/Styles/ShowMeTheXamlStyles.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<Styles xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:avaloniaEdit="https://github.com/avaloniaui/avaloniaedit" | ||
xmlns:avaloniaEdit1="clr-namespace:ShowMeTheXaml.Avalonia.AvaloniaEdit;assembly=ShowMeTheXaml.Avalonia.AvaloniaEdit" | ||
xmlns:showMeTheXaml="clr-namespace:ShowMeTheXaml;assembly=ShowMeTheXaml.Avalonia" | ||
xmlns:controls="clr-namespace:Material.Styles.Controls;assembly=Material.Styles"> | ||
<StyleInclude Source="avares://ShowMeTheXaml.Avalonia.AvaloniaEdit/XamlDisplayStyles.axaml" /> | ||
|
||
<Style Selector="showMeTheXaml|XamlDisplay"> | ||
<Setter Property="HorizontalAlignment" Value="Stretch" /> | ||
<Setter Property="VerticalAlignment" Value="Stretch" /> | ||
<Setter Property="ClipToBounds" Value="False" /> | ||
<Setter Property="avaloniaEdit1:XamlDisplayAvaloniaEdit.CodeHighlightThemeName" Value="{DynamicResource AvaloniaEditThemeName}" /> | ||
</Style> | ||
|
||
<Style Selector="avaloniaEdit|TextArea"> | ||
<Setter Property="SelectionBrush" Value="{DynamicResource MaterialSelectionColor}" /> | ||
</Style> | ||
|
||
<Style Selector="showMeTheXaml|XamlDisplay[IsEditable=True] /template/ Popup#XamlPopup"> | ||
<Setter Property="Child"> | ||
<Template> | ||
<controls:Card Margin="6"> | ||
<Grid RowDefinitions="* 4 Auto" ColumnDefinitions="* 8 Auto 8 Auto" Margin="2"> | ||
<ScrollViewer Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" | ||
HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible" | ||
MaxHeight="600"> | ||
<avaloniaEdit:TextEditor x:Name="MarkupTextEditor" | ||
IsModified="False" | ||
MinWidth="300" MaxWidth="800" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Stretch" | ||
HorizontalScrollBarVisibility="Disabled" | ||
VerticalScrollBarVisibility="Disabled" | ||
WordWrap="True" | ||
ShowLineNumbers="True" | ||
Foreground="{Binding $parent[showMeTheXaml:XamlDisplay].Foreground}" | ||
Background="{Binding $parent[showMeTheXaml:XamlDisplay].Background}"> | ||
<Interaction.Behaviors> | ||
<avaloniaEdit1:CustomizeEditorBehavior /> | ||
<avaloniaEdit1:XamlDisplayAvaloniaEditThemeBehavior /> | ||
</Interaction.Behaviors> | ||
</avaloniaEdit:TextEditor> | ||
</ScrollViewer> | ||
<Rectangle Grid.Column="0" Grid.Row="2" | ||
Name="MaxSizer" | ||
VerticalAlignment="Top" HorizontalAlignment="Stretch" /> | ||
<TextBox Grid.Column="0" Grid.Row="2" | ||
BorderThickness="0" | ||
ScrollViewer.HorizontalScrollBarVisibility="Disabled" | ||
ScrollViewer.VerticalScrollBarVisibility="Disabled" | ||
MaxWidth="{Binding #MaxSizer.Bounds.Width}" | ||
IsReadOnly="True" TextWrapping="Wrap" | ||
IsVisible="False" | ||
Name="CommonErrorsTextBox" /> | ||
<Button Grid.Column="2" Grid.Row="2" | ||
Theme="{StaticResource MaterialFlatButton}" | ||
Name="ResetButton"> | ||
Reset | ||
</Button> | ||
<Button Grid.Column="4" Grid.Row="2" | ||
Theme="{StaticResource MaterialFlatButton}" | ||
Name="ApplyButton"> | ||
Apply | ||
</Button> | ||
<Interaction.Behaviors> | ||
<avaloniaEdit1:XamlDisplayAvaloniaEditPopupBehavior | ||
MarkupTextEditor="{Binding ElementName=MarkupTextEditor}" | ||
CommonErrorsTextBox="{Binding ElementName=CommonErrorsTextBox}" | ||
ApplyButton="{Binding ElementName=ApplyButton}" | ||
ResetButton="{Binding ElementName=ResetButton}" /> | ||
</Interaction.Behaviors> | ||
</Grid> | ||
</controls:Card> | ||
</Template> | ||
</Setter> | ||
</Style> | ||
|
||
<Style Selector="showMeTheXaml|XamlDisplay[IsEditable=False] /template/ Popup#XamlPopup"> | ||
<Setter Property="Child"> | ||
<Template> | ||
<controls:Card Margin="6"> | ||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible" | ||
MaxHeight="600"> | ||
<avaloniaEdit:TextEditor x:Name="MarkupTextEditor" | ||
IsModified="True" | ||
IsReadOnly="True" | ||
MinWidth="300" MaxWidth="800" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Stretch" | ||
HorizontalScrollBarVisibility="Disabled" | ||
VerticalScrollBarVisibility="Disabled" | ||
WordWrap="True" | ||
ShowLineNumbers="True" | ||
Foreground="{Binding $parent[showMeTheXaml:XamlDisplay].Foreground}" | ||
Background="{Binding $parent[showMeTheXaml:XamlDisplay].Background}"> | ||
<Interaction.Behaviors> | ||
<avaloniaEdit1:CustomizeEditorBehavior /> | ||
<avaloniaEdit1:XamlDisplayAvaloniaEditTextBindingBehavior | ||
MarkupTextEditor="{Binding ElementName=MarkupTextEditor}" /> | ||
<avaloniaEdit1:XamlDisplayAvaloniaEditThemeBehavior /> | ||
</Interaction.Behaviors> | ||
</avaloniaEdit:TextEditor> | ||
</ScrollViewer> | ||
</controls:Card> | ||
</Template> | ||
</Setter> | ||
</Style> | ||
</Styles> |