PageRenderTime 48ms CodeModel.GetById 44ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/MetroDemo/MainWindow.xaml

https://bitbucket.org/aeoth/mahapps.metro/
XAML | 155 lines | 145 code | 8 blank | 2 comment | 0 complexity | 3bb92b0a960736d435528fd16fb464d0 MD5 | raw file
  1<Window
  2        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  5        xmlns:behaviours="clr-namespace:MahApps.Metro.Behaviours;assembly=MahApps.Metro"
  6        xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro.Controls"
  7        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="MetroDemo.MainWindow"
  8        Title="MainWindow"
  9        Height="439"
 10        Width="585"
 11        MouseDown="WindowMouseDown">
 12    <Window.Background>
 13        <SolidColorBrush Color="{DynamicResource WhiteColor}" />
 14    </Window.Background>
 15    
 16    <Window.Resources>
 17        <ResourceDictionary>
 18            <ResourceDictionary.MergedDictionaries>
 19                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml"/>
 20                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml"/>
 21                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml"/>
 22
 23                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml"/>
 24                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml"/>
 25                
 26            </ResourceDictionary.MergedDictionaries>
 27        </ResourceDictionary>
 28    </Window.Resources>
 29    
 30    <i:Interaction.Behaviors>
 31        <behaviours:BorderlessWindowBehavior ResizeWithGrip="False" />
 32    </i:Interaction.Behaviors>
 33    
 34
 35
 36    <Controls:MetroContentControl>
 37        <Grid>
 38            <Grid x:Name="grdOwner" Height="40" VerticalAlignment="Top">
 39                <Grid.Background>
 40                    <SolidColorBrush Color="{DynamicResource HighlightDarkColor}" />
 41                </Grid.Background>
 42                <StackPanel Panel.ZIndex="1" Height="20" VerticalAlignment="Top" Orientation="Horizontal" HorizontalAlignment="Right" Width="66">
 43                    <Button x:Name="btnMin" Click="BtnMinClick" Margin="2,0,0,0" Width="20" Height="20" Style="{DynamicResource ChromelessButtonStyle}" VerticalAlignment="Bottom" VerticalContentAlignment="Bottom" Padding="0" ToolTip="Minimise" RenderTransformOrigin="0.5,0.5" Opacity="0.8">
 44                        <Button.RenderTransform>
 45                            <TransformGroup>
 46                                <ScaleTransform ScaleX="0.8" ScaleY="0.8"/>
 47                                <SkewTransform/>
 48                                <RotateTransform/>
 49                                <TranslateTransform/>
 50                            </TransformGroup>
 51                        </Button.RenderTransform>
 52                        <Rectangle Fill="White" Height="4" VerticalAlignment="Bottom" Width="20"/>
 53                    </Button>
 54                    <Button x:Name="btnMax" Click="BtnMaxClick"  Margin="2,0,0,0" Width="20" Height="20" Style="{DynamicResource ChromelessButtonStyle}" VerticalContentAlignment="Bottom" Padding="0" ToolTip="Maximise" RenderTransformOrigin="0.5,0.5" Opacity="0.8">
 55                        <Button.RenderTransform>
 56                            <TransformGroup>
 57                                <ScaleTransform ScaleX="0.8" ScaleY="0.8"/>
 58                                <SkewTransform/>
 59                                <RotateTransform/>
 60                                <TranslateTransform/>
 61                            </TransformGroup>
 62                        </Button.RenderTransform>
 63                        <Grid Width="20" Height="20">
 64                            <Rectangle Fill="White" Height="4" VerticalAlignment="Bottom"/>
 65                            <Rectangle Fill="White" Height="4" VerticalAlignment="Top" Margin="0,4.687,0,0"/>
 66                            <Rectangle Fill="White" Width="4" HorizontalAlignment="Left" Margin="0,4.687,0,0"/>
 67                            <Rectangle Fill="White" Width="4" HorizontalAlignment="Right" Margin="0,4.687,0,0"/>
 68                        </Grid>
 69                    </Button>
 70                    <Button x:Name="btnClose" Click="BtnCloseClick" Margin="2,0,0,0" Width="20" Height="20" Style="{DynamicResource ChromelessButtonStyle}" ToolTip="Close" RenderTransformOrigin="0.5,0.5" Opacity="0.8">
 71                        <Button.RenderTransform>
 72                            <TransformGroup>
 73                                <ScaleTransform ScaleX="0.8" ScaleY="0.8"/>
 74                                <SkewTransform/>
 75                                <RotateTransform/>
 76                                <TranslateTransform/>
 77                            </TransformGroup>
 78                        </Button.RenderTransform>
 79                        <Grid Width="19" Height="19" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,0,-5">
 80                            <Rectangle Fill="White" RenderTransformOrigin="0.5,0.5" Margin="-0.677,7.542,0.677,7.458" UseLayoutRounding="False">
 81                                <Rectangle.RenderTransform>
 82                                    <TransformGroup>
 83                                        <ScaleTransform/>
 84                                        <SkewTransform/>
 85                                        <RotateTransform Angle="-45"/>
 86                                        <TranslateTransform/>
 87                                    </TransformGroup>
 88                                </Rectangle.RenderTransform>
 89                            </Rectangle>
 90                            <Rectangle Fill="White" RenderTransformOrigin="0.5,0.5" Margin="-0.771,7.542,0.771,7.458" UseLayoutRounding="False">
 91                                <Rectangle.RenderTransform>
 92                                    <TransformGroup>
 93                                        <ScaleTransform/>
 94                                        <SkewTransform/>
 95                                        <RotateTransform Angle="45"/>
 96                                        <TranslateTransform/>
 97                                    </TransformGroup>
 98                                </Rectangle.RenderTransform>
 99                            </Rectangle>
100                        </Grid>
101                    </Button>
102                </StackPanel>
103            </Grid>
104            <TabControl Margin="0,40,0,0" Background="{x:Null}" BorderBrush="{x:Null}">
105            	<TabItem Header="First Tab Item">
106            		<Grid>
107            			<Grid Margin="0,0,226.999,-48.72">
108            				<Button Content="Right Click Me" Click="Button_Click" Height="30" ToolTip="This is a tooltip" Margin="88.694,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="108">
109            					<Button.ContextMenu>
110            						<ContextMenu>
111            							<MenuItem Header="Light Red" Click="MiLightRed" />
112            							<MenuItem Header="Light Green" Click="MiLightGreen"/>
113            							<MenuItem Header="Light Blue" Click="MiLightBlue"/>
114            							<MenuItem Header="Light Purple" Click="MiLightPurple"/>
115            							<Separator />
116            							<MenuItem Header="Dark Red" Click="MiDarkRed" />
117            							<MenuItem Header="Dark Green" Click="MiDarkGreen"/>
118            							<MenuItem Header="Dark Blue" Click="MiDarkBlue"/>
119            							<MenuItem Header="Dark Purple" Click="MiDarkPurple"/>
120            						</ContextMenu>
121            					</Button.ContextMenu>
122            				</Button>
123            				<PasswordBox Margin="88.695,66.96,0,0" Height="30" VerticalAlignment="Top" HorizontalAlignment="Left" Width="154.001" />
124            				<CheckBox Content="CheckBox" Margin="88.695,100.96,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"/>
125            				<RadioButton Content="Radio Button 1" Margin="88.291,134.92,0,0" VerticalAlignment="Top" GroupName="test" HorizontalAlignment="Left" />
126            				<TextBox Text="This is a textbox" Margin="88.694,36.96,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" />
127            				<ComboBox Margin="88.292,176.84,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="120">
128            					<ComboBoxItem Content="ComboBoxItem"/>
129            					<ComboBoxItem Content="ComboBoxItem"/>
130            					<ComboBoxItem Content="ComboBoxItem"/>
131            				</ComboBox>
132            				<ProgressBar x:Name="pb" Value="{Binding Value, ElementName=slider1}" IsIndeterminate="False" Margin="88.696,216.8,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="154" />
133            				<Label Content="Button" VerticalAlignment="Top" Margin="39.07,0,0,0" HorizontalAlignment="Left"/>
134            				<Label Content="Passwordbox" Margin="5.147,71,0,0" RenderTransformOrigin="0.535,-0.381" VerticalAlignment="Top" HorizontalAlignment="Left"/>
135            				<Label Content="Checkbox" Margin="23.1,100.96,0,105.84" d:LayoutOverrides="Height" HorizontalAlignment="Left"/>
136            				<Label Content="Radio Buttons" VerticalAlignment="Top" Margin="0,130.92,0,0" HorizontalAlignment="Left"/>
137            				<Label Content="TextBox" VerticalAlignment="Top" Margin="33.14,37,0,0" HorizontalAlignment="Left"/>
138            				<Label Content="Combobox" VerticalAlignment="Top" Margin="16.224,176.84,0,0" HorizontalAlignment="Left"/>
139            				<RadioButton Content="Radio Button 2" Margin="88.695,155.88,0,0" VerticalAlignment="Top" GroupName="test" HorizontalAlignment="Left" />
140            				<Label Content="Progress Bar" VerticalAlignment="Bottom" Margin="5.147,0,0,0" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment"/>
141            			</Grid>
142            			<Controls:ToggleSwitch HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,-2,0" />
143            			<Label Content="Toggle Switch" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,138.725,0"/>
144            <!--<Slider Height="23" HorizontalAlignment="Left" Margin="273,119,0,0" Name="slider1" VerticalAlignment="Top" Width="218" Maximum="100" Value="50" />-->
145            			<TextBlock HorizontalAlignment="Right" TextWrapping="Wrap" Text="{Binding Value, ElementName=slider1}" Margin="0,0,8,82.08" RenderTransformOrigin="26.277,-1.472" VerticalAlignment="Bottom"/>
146
147            			<Controls:ProgressIndicator Margin="319,83,8,0" ProgressColour="{StaticResource AccentColorBrush}" Height="6" VerticalAlignment="Top" />
148            		</Grid>
149            	</TabItem>
150            	<TabItem Header="Another Item"/>
151            </TabControl>
152            <!--<Slider Height="23" HorizontalAlignment="Left" Margin="273,119,0,0" Name="slider1" VerticalAlignment="Top" Width="218" Maximum="100" Value="50" />-->
153        </Grid>
154    </Controls:MetroContentControl>
155</Window>