-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
99 lines (99 loc) · 8.04 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<Window x:Class="Dwarf_Fortress_Log.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Dwarf_Fortress_Log"
mc:Ignorable="d"
xmlns:df="clr-namespace:Dwarf_Fortress_Log.ViewModel"
Title="{Binding Process.MainWindowTitle, Mode=OneWay}" Height="350" Width="432" FontFamily="MS UI Gothic" WindowStyle="None" IsHitTestVisible="False" Left="1" Top="1" Loaded="Window_Loaded" ResizeMode="NoResize" Background="{x:Null}" Foreground="{x:Null}" AllowsTransparency="True" Opacity="{Binding Configuration.Opacity}" Closing="Window_Closing" KeyDown="Window_KeyDown">
<Window.Resources>
<DataTemplate x:Key="LogItemTemplate">
<TextBlock TextWrapping="Wrap" d:Text="Ber Degdeduk, Tanner has created Tinancatten Test 123" Text="{Binding Content}" Background="{Binding ColorBackground}" Foreground="{Binding ColorForeground}" d:Foreground="White" Padding="2,2,2,0" IsHitTestVisible="False"/>
</DataTemplate>
<Style x:Key="FocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" StrokeDashArray="1 2" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" SnapsToDevicePixels="true" StrokeThickness="0" IsHitTestVisible="False"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<SolidColorBrush x:Key="Item.MouseOver.Background" Color="#1F26A0DA"/>
<SolidColorBrush x:Key="Item.MouseOver.Border" Color="#a826A0Da"/>
<SolidColorBrush x:Key="Item.SelectedActive.Background" Color="#3D26A0DA"/>
<SolidColorBrush x:Key="Item.SelectedActive.Border" Color="#FF26A0DA"/>
<SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#3DDADADA"/>
<SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="#FFDADADA"/>
<Style x:Key="ListBoxItemContainerStyle1" TargetType="{x:Type ListBoxItem}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Padding" Value="0,0"/>
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true" IsHitTestVisible="False">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsHitTestVisible="False"/>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.MouseOver.Background}"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.MouseOver.Border}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="False"/>
<Condition Property="IsSelected" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}"/>
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="True"/>
<Condition Property="IsSelected" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Background}"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedActive.Border}"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<DataTemplate x:Key="ItemsControlItemTemplate1">
<Label Background="{Binding ColorBackground}" Padding="2,2,2,2" Foreground="{Binding ColorForeground}" Content="{Binding Item}" Margin="2,0,2,0"/>
</DataTemplate>
<DataTemplate x:Key="ItemsControlItemTemplateBattle">
<Label Background="{Binding ColorBackground}" Padding="2,2,2,2" Foreground="{Binding ColorForeground}" Content="{Binding}" Margin="2,0,2,0"/>
</DataTemplate>
<ItemsPanelTemplate x:Key="ItemsControlItemsPanel">
<StackPanel FlowDirection="RightToLeft" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</Window.Resources>
<d:Window.DataContext>
<df:MainViewModel/>
</d:Window.DataContext>
<Grid IsHitTestVisible="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<ItemsControl ItemsPanel="{DynamicResource ItemsControlItemsPanel}" ItemTemplate="{DynamicResource ItemsControlItemTemplateBattle}" HorizontalAlignment="Right" ItemsSource="{Binding BattleItems, Mode=OneWay}" VerticalAlignment="Top" HorizontalContentAlignment="Right"></ItemsControl>
<ItemsControl ItemsPanel="{DynamicResource ItemsControlItemsPanel}" ItemTemplate="{DynamicResource ItemsControlItemTemplate1}" HorizontalAlignment="Right" ItemsSource="{Binding MissingItems, Mode=OneWay}" VerticalAlignment="Top" HorizontalContentAlignment="Right" Grid.Row="1"></ItemsControl>
<ListBox ItemContainerStyle="{DynamicResource ListBoxItemContainerStyle1}" ItemTemplate="{DynamicResource LogItemTemplate}" x:Name="listBox" ItemsSource="{Binding LogItems}" d:ItemsSource="{d:SampleData ItemCount=50}" HorizontalContentAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Background="{x:Null}" IsHitTestVisible="False" BorderBrush="{x:Null}" Foreground="{x:Null}" ScrollViewer.VerticalScrollBarVisibility="Hidden" Grid.Row="2"/>
</Grid>
</Window>