Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from ButchersBoy/master
update from original repo
- Loading branch information
Showing
19 changed files
with
1,008 additions
and
189 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<UserControl x:Class="MaterialDesignDemo.Drawers" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:local="clr-namespace:MaterialDesignDemo" | ||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" d:DesignWidth="300"> | ||
<materialDesign:DrawerHost Margin="64" HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="2" BorderBrush="{DynamicResource MaterialDesignDivider}"> | ||
<materialDesign:DrawerHost.LeftDrawerContent> | ||
<StackPanel Margin="16"> | ||
<TextBlock Margin="4" HorizontalAlignment="Center">LEFT FIELD</TextBlock> | ||
<Button Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}" | ||
CommandParameter="{x:Static Dock.Left}" | ||
Margin="4" HorizontalAlignment="Center" | ||
Style="{DynamicResource MaterialDesignFlatButton}"> | ||
CLOSE THIS | ||
</Button> | ||
<Button Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}" | ||
Margin="4" HorizontalAlignment="Center" | ||
Style="{DynamicResource MaterialDesignFlatButton}"> | ||
CLOSE ALL | ||
</Button> | ||
</StackPanel> | ||
</materialDesign:DrawerHost.LeftDrawerContent> | ||
<materialDesign:DrawerHost.TopDrawerContent> | ||
<StackPanel Margin="16" HorizontalAlignment="Center" Orientation="Horizontal"> | ||
<TextBlock Margin="4" VerticalAlignment="Center">TOP BANANA</TextBlock> | ||
<Button Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}" | ||
Style="{DynamicResource MaterialDesignFlatButton}" | ||
Margin="4" VerticalAlignment="Center"> | ||
CLOSE ALL | ||
</Button> | ||
<Button Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}" | ||
CommandParameter="{x:Static Dock.Top}" | ||
Style="{DynamicResource MaterialDesignFlatButton}" | ||
Margin="4" VerticalAlignment="Center"> | ||
CLOSE THIS | ||
</Button> | ||
</StackPanel> | ||
</materialDesign:DrawerHost.TopDrawerContent> | ||
<materialDesign:DrawerHost.RightDrawerContent> | ||
<StackPanel Margin="16"> | ||
<TextBlock Margin="4" HorizontalAlignment="Center">THE RIGHT STUFF</TextBlock> | ||
<Button Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}" | ||
CommandParameter="{x:Static Dock.Right}" | ||
Margin="4" HorizontalAlignment="Center" | ||
Style="{DynamicResource MaterialDesignFlatButton}"> | ||
CLOSE THIS | ||
</Button> | ||
<Button Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}" | ||
Margin="4" HorizontalAlignment="Center" | ||
Style="{DynamicResource MaterialDesignFlatButton}"> | ||
CLOSE ALL | ||
</Button> | ||
</StackPanel> | ||
</materialDesign:DrawerHost.RightDrawerContent> | ||
<materialDesign:DrawerHost.BottomDrawerContent> | ||
<StackPanel Margin="16" HorizontalAlignment="Center" Orientation="Horizontal"> | ||
<TextBlock Margin="4" VerticalAlignment="Center">BOTTOM BRACKET</TextBlock> | ||
<Button Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}" | ||
Style="{DynamicResource MaterialDesignFlatButton}" | ||
Margin="4" VerticalAlignment="Center"> | ||
CLOSE ALL | ||
</Button> | ||
<Button Command="{x:Static materialDesign:DrawerHost.CloseDrawerCommand}" | ||
CommandParameter="{x:Static Dock.Bottom}" | ||
Style="{DynamicResource MaterialDesignFlatButton}" | ||
Margin="4" VerticalAlignment="Center"> | ||
CLOSE THIS | ||
</Button> | ||
</StackPanel> | ||
</materialDesign:DrawerHost.BottomDrawerContent> | ||
<Grid MinWidth="480" MinHeight="480"> | ||
<Grid VerticalAlignment="Center" HorizontalAlignment="Center"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition /> | ||
<RowDefinition /> | ||
<RowDefinition /> | ||
</Grid.RowDefinitions> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition /> | ||
<ColumnDefinition /> | ||
<ColumnDefinition /> | ||
</Grid.ColumnDefinitions> | ||
<Button Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}" | ||
CommandParameter="{x:Static Dock.Left}" | ||
Grid.Row="1" Grid.Column="0" Margin="4"> | ||
<materialDesign:PackIcon Kind="ArrowLeft" /> | ||
</Button> | ||
<Button Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}" | ||
CommandParameter="{x:Static Dock.Top}" | ||
Grid.Row="0" Grid.Column="1" Margin="4"> | ||
<materialDesign:PackIcon Kind="ArrowUp" /> | ||
</Button> | ||
<Button Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}" | ||
CommandParameter="{x:Static Dock.Right}" | ||
Grid.Row="1" Grid.Column="2" Margin="4"> | ||
<materialDesign:PackIcon Kind="ArrowRight" /> | ||
</Button> | ||
<Button Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}" | ||
CommandParameter="{x:Static Dock.Bottom}" | ||
Grid.Row="2" Grid.Column="1" Margin="4"> | ||
<materialDesign:PackIcon Kind="ArrowDown" /> | ||
</Button> | ||
<Button Command="{x:Static materialDesign:DrawerHost.OpenDrawerCommand}" | ||
Grid.Row="1" Grid.Column="1" Margin="4" | ||
Style="{DynamicResource MaterialDesignRaisedAccentButton}"> | ||
<materialDesign:PackIcon Kind="ArrowAll" /> | ||
</Button> | ||
</Grid> | ||
</Grid> | ||
</materialDesign:DrawerHost> | ||
</UserControl> |
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,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace MaterialDesignDemo | ||
{ | ||
/// <summary> | ||
/// Interaction logic for Drawers.xaml | ||
/// </summary> | ||
public partial class Drawers : UserControl | ||
{ | ||
public Drawers() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
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
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,39 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using MaterialDesignThemes.Wpf; | ||
|
||
namespace MaterialDesignDemo.ProvingGroundStuff | ||
{ | ||
public class MeasuringTextBox : TextBox | ||
{ | ||
static MeasuringTextBox() | ||
{ | ||
DefaultStyleKeyProperty.OverrideMetadata(typeof(MeasuringTextBox), new FrameworkPropertyMetadata(typeof(TextBox))); | ||
} | ||
|
||
protected override Size ArrangeOverride(Size arrangeBounds) | ||
{ | ||
var stopwatch = Stopwatch.StartNew(); | ||
var result = base.ArrangeOverride(arrangeBounds); | ||
stopwatch.Stop(); | ||
Debug.WriteLine($"Arrange: {stopwatch.ElapsedMilliseconds} - {stopwatch.ElapsedTicks} - ({GetHashCode()})"); | ||
return result; | ||
} | ||
|
||
|
||
protected override Size MeasureOverride(Size constraint) | ||
{ | ||
var stopwatch = Stopwatch.StartNew(); | ||
var result = base.MeasureOverride(constraint); | ||
stopwatch.Stop(); | ||
Debug.WriteLine($"Measure: {stopwatch.ElapsedMilliseconds} - {stopwatch.ElapsedTicks} - ({GetHashCode()})"); | ||
return result; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.