Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
punker76 committed Nov 29, 2020
2 parents 4f92159 + 01c4f86 commit d43eabe
Show file tree
Hide file tree
Showing 59 changed files with 7,376 additions and 864 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
assembly-versioning-scheme: Major
assembly-file-versioning-scheme: MajorMinorPatchTag
mode: ContinuousDeployment
next-version: 2.3.0
next-version: 2.4.0
branches:
master:
regex: ^main
Expand Down
4 changes: 2 additions & 2 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
///////////////////////////////////////////////////////////////////////////////

#module nuget:?package=Cake.DotNetTool.Module
#tool "dotnet:?package=NuGetKeyVaultSignTool&version=1.2.18"
#tool "dotnet:?package=NuGetKeyVaultSignTool&version=1.2.28"
#tool "dotnet:?package=AzureSignTool&version=2.0.17"

#tool GitVersion.CommandLine&version=5.3.7
#tool GitVersion.CommandLine&version=5.5.1
#tool gitreleasemanager
#tool xunit.runner.console
#tool vswhere
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<UserControl x:Class="MetroDemo.ExampleViews.ColorPickerExample"
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:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<GroupBox Margin="5 5 5 0" Header="Eye Dropper">
<mah:ColorEyeDropper Height="Auto"
HorizontalContentAlignment="Center"
mah:ControlsHelper.CornerRadius="3"
SelectedColor="{Binding ElementName=ColorCanvasExample, Path=SelectedColor, Mode=TwoWay}">
<TextBlock TextAlignment="Center" TextWrapping="Wrap">
<Run Text="You selected this color: " />
<Run FontWeight="Bold" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=mah:ColorEyeDropper}, Path=SelectedColor}" />
<LineBreak />
<Run Text="Press and hold to select a different color from screen." />
</TextBlock>
</mah:ColorEyeDropper>
</GroupBox>

<GroupBox Margin="5 5 5 0" Header="Color Canvas">
<mah:ColorCanvas x:Name="ColorCanvasExample" SelectedColor="Blue" />
</GroupBox>

<GroupBox Margin="5" Header="Color Picker">
<mah:ColorPicker mah:TextBoxHelper.AutoWatermark="True"
mah:TextBoxHelper.ClearTextButton="True"
mah:TextBoxHelper.UseFloatingWatermark="True"
mah:TextBoxHelper.Watermark="Select a color"
SelectedColor="{Binding ElementName=ColorCanvasExample, Path=SelectedColor}" />
</GroupBox>
</StackPanel>
</ScrollViewer>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Windows.Controls;

namespace MetroDemo.ExampleViews
{
/// <summary>
/// Interaction logic for ColorPickerExample.xaml
/// </summary>
public partial class ColorPickerExample : UserControl
{
public ColorPickerExample()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,33 @@
Grid.Column="1"
Grid.ColumnSpan="2">
<Label Content="FlipView" Style="{DynamicResource DescriptionHeaderStyle}" />

<StackPanel Orientation="Horizontal">
<CheckBox x:Name="ShowBannerCheckBox"
Margin="2"
Content="Show Banner"
IsChecked="{Binding ElementName=FlipView1st, Path=IsBannerEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<CheckBox x:Name="ShowMouseOverCheckBox"
Margin="2"
Content="MouseOver Border"
IsChecked="{Binding ElementName=FlipView1st, Path=MouseHoverBorderEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<CheckBox x:Name="CircularNaviCheckBox"
Margin="2"
Content="Circular Navi"
IsChecked="{Binding ElementName=FlipView1st, Path=CircularNavigation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<CheckBox x:Name="ShowNaviCheckBox"
Margin="2"
Content="Show Navi Buttons"
IsChecked="{Binding ElementName=FlipView1st, Path=IsNavigationEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<CheckBox x:Name="ShowIndexCheckBox"
Margin="2"
Content="Show Navi Index"
IsChecked="{Binding ElementName=FlipView1st, Path=ShowIndex, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>

<Grid Grid.IsSharedSizeScope="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="Group1" />
<ColumnDefinition Width="Auto" SharedSizeGroup="FlipViewSettingsLabel" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
Expand All @@ -120,72 +144,76 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<CheckBox x:Name="ShowBannerCheckBox"
Grid.Row="0"
Grid.Column="0"
Margin="5 2"
Content="Banner"
IsChecked="{Binding ElementName=FlipView1st, Path=IsBannerEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<CheckBox x:Name="ShowMouseOverCheckBox"

<Label Grid.Row="0"
Grid.Column="0"
Content="Navigation Button Orientation" />
<ComboBox x:Name="Orientation"
Grid.Row="0"
Grid.Column="1"
Margin="5 2"
Content="MouseOver Border"
IsChecked="{Binding ElementName=FlipView1st, Path=MouseHoverBorderEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<CheckBox x:Name="CircularNaviCheckBox"
Grid.Row="1"
Grid.Column="0"
Margin="5 2"
Content="Circular Navi"
IsChecked="{Binding ElementName=FlipView1st, Path=CircularNavigation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<CheckBox x:Name="ShowNaviCheckBox"
Grid.Row="1"
Grid.Column="1"
Margin="5 2"
Content="Show NaviButtons"
IsChecked="{Binding ElementName=FlipView1st, Path=IsNavigationEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<ComboBox x:Name="Orientation"
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="1"
Width="120"
Margin="2"
ItemsSource="{Binding Source={mx:EnumBindingSource {x:Type Orientation}}, Mode=OneTime}"
SelectedValue="{Binding ElementName=FlipView1st, Path=Orientation, FallbackValue=Horizontal, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
SelectedValue="{Binding ElementName=FlipView1st, Path=Orientation, FallbackValue={x:Static Orientation.Horizontal}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

<Label Grid.Row="1"
Grid.Column="0"
Content="Navigation Button Position" />
<ComboBox x:Name="NaviButtonsPosition"
Grid.Row="2"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="1"
Width="120"
Margin="2"
ItemsSource="{Binding Source={mx:EnumBindingSource {x:Type mah:NavigationButtonsPosition}}, Mode=OneTime}"
SelectedValue="{Binding ElementName=FlipView1st, Path=NavigationButtonsPosition, FallbackValue=Inside, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
SelectedValue="{Binding ElementName=FlipView1st, Path=NavigationButtonsPosition, FallbackValue={x:Static mah:NavigationButtonsPosition.Inside}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />

<Label Grid.Row="2"
Grid.Column="0"
Content="Navigation Index Placement" />
<ComboBox x:Name="IndexPlacement"
Grid.Row="2"
Grid.Column="1"
Width="120"
Margin="2"
ItemsSource="{Binding Source={mx:EnumBindingSource {x:Type mah:NavigationIndexPlacement}}, Mode=OneTime}"
SelectedValue="{Binding ElementName=FlipView1st, Path=IndexPlacement, FallbackValue={x:Static mah:NavigationIndexPlacement.Bottom}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</Grid>

<mah:FlipView x:Name="FlipView1st"
Height="200"
Margin="0 0 5 0"
Foreground="{DynamicResource MahApps.Brushes.ThemeBackground}"
SelectionChanged="FlipView_SelectionChanged">
IndexHorizontalAlignment="Right"
IndexPlacement="TopOverItem"
ShowIndex="True">
<mah:FlipView.Items>
<Grid Background="#2E8DEF">
<mah:FlipViewItem Background="#2E8DEF"
BannerText="Cupcakes!"
BorderBrush="Black"
BorderThickness="1">
<iconPacks:PackIconModern Width="60"
Height="60"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Kind="FoodCupcake" />
</Grid>
<Grid Background="#00A600">
</mah:FlipViewItem>
<mah:FlipViewItem Background="#00A600" BannerText="XBox!">
<iconPacks:PackIconModern Width="60"
Height="60"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Kind="Xbox" />
</Grid>
<Grid Background="#BF1E4B">
</mah:FlipViewItem>
<mah:FlipViewItem Background="#BF1E4B" BannerText="Chess!">
<iconPacks:PackIconModern Width="60"
Height="60"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Kind="ChessHorse" />
</Grid>
</mah:FlipViewItem>
</mah:FlipView.Items>
</mah:FlipView>

<StackPanel HorizontalAlignment="Center"
DataContext="{Binding ElementName=FlipView1st, Mode=OneWay}"
Orientation="Horizontal">
Expand All @@ -202,18 +230,18 @@
</StackPanel>

<Separator Margin="0 5" />

<mah:FlipView x:Name="FlipView2nd"
Height="300"
Margin="0 0 5 0"
BannerText="Databound Items"
CircularNavigation="{Binding ElementName=CircularNaviCheckBox, Path=IsChecked, Mode=OneWay}"
IsBannerEnabled="{Binding ElementName=ShowBannerCheckBox, Path=IsChecked, Mode=OneWay}"
IsNavigationEnabled="{Binding ElementName=ShowNaviCheckBox, Path=IsChecked, Mode=OneWay}"
IndexPlacement="BottomOverItem"
IsBannerEnabled="False"
IsNavigationEnabled="False"
ItemTemplate="{StaticResource ImageDataTemplate}"
ItemsSource="{Binding FlipViewImages, Mode=OneWay}"
MouseHoverBorderEnabled="{Binding ElementName=ShowMouseOverCheckBox, Path=IsChecked, Mode=OneWay}"
NavigationButtonsPosition="{Binding ElementName=NaviButtonsPosition, Path=SelectedValue, Mode=OneWay}"
Orientation="{Binding ElementName=Orientation, Path=SelectedValue, Mode=OneWay}" />
Orientation="{Binding ElementName=Orientation, Path=SelectedValue, Mode=OneWay}"
ShowIndex="True" />
<StackPanel HorizontalAlignment="Center"
DataContext="{Binding ElementName=FlipView2nd, Mode=OneWay}"
Orientation="Horizontal">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System;
using System.Windows.Controls;
using System.Windows.Threading;
using MahApps.Metro.Controls;

namespace MetroDemo.ExampleViews
{
Expand Down Expand Up @@ -33,22 +32,5 @@ void Tick(object sender, EventArgs e)
customTransitioning.Content = new TextBlock { Text = "Custom transistion! " + dateTime, SnapsToDevicePixels = true };
SecondcustomTransitioning.Content = new TextBlock { Text = "Second custom transistion! " + dateTime, SnapsToDevicePixels = true };
}

private void FlipView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var flipview = ((FlipView)sender);
switch (flipview.SelectedIndex)
{
case 0:
flipview.BannerText = "Cupcakes!";
break;
case 1:
flipview.BannerText = "Xbox!";
break;
case 2:
flipview.BannerText = "Chess!";
break;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,28 @@
</Grid.RowDefinitions>

<Grid Grid.Row="0">
<TextBlock Text="Play, Previous, Next, Volume and Seek bar here." />
<DockPanel>
<TextBlock Margin="4"
VerticalAlignment="Center"
Text="Play, Previous, Next, Volume and Seek bar here.">
<TextBlock.ContextMenu>
<!-- This would cause a memory leak with MahApps.DropShadowEffect.Menu: [x:Shared = True] -->
<ContextMenu HasDropShadow="True">
<MenuItem Header="Some menu option" />
</ContextMenu>
</TextBlock.ContextMenu>
</TextBlock>
<!-- This would cause a memory leak with MahApps.DropShadowEffect.WaitingForData: [x:Shared = True] -->
<TextBox Width="120"
Margin="4"
VerticalAlignment="Center"
mah:TextBoxHelper.IsWaitingForData="True"
DockPanel.Dock="Right" />
<TextBlock HorizontalAlignment="Right"
VerticalAlignment="Center"
DockPanel.Dock="Right"
Text="Quick search:" />
</DockPanel>
</Grid>

<Grid Grid.Row="1">
Expand Down Expand Up @@ -145,22 +166,29 @@
Text="{Binding ElementName=artist, Path=SelectedItem.Name, TargetNullValue=''}" />
</mah:MetroTabItem>
<mah:MetroTabItem Header="albums">
<ListBox x:Name="albums"
ItemsSource="{Binding ElementName=artist, Path=SelectedItem.Albums}"
Style="{DynamicResource MahApps.Styles.ListBox.Virtualized}">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:Album}">
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} - {1}">
<Binding Mode="OneWay" Path="Title" />
<Binding Mode="OneWay" Path="Price" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<DataGrid x:Name="albums"
AutoGenerateColumns="False"
IsReadOnly="True"
ItemsSource="{Binding ElementName=artist, Path=SelectedItem.Albums}"
Style="{DynamicResource MahApps.Styles.DataGrid.Azure}">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Artist.Name}" Header="Artist" />
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="{x:Type models:Album}">
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} - {1}">
<Binding Mode="OneWay" Path="Title" />
<Binding Mode="OneWay" Path="Price" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</mah:MetroTabItem>
</mah:MetroTabControl>

Expand Down
5 changes: 5 additions & 0 deletions src/MahApps.Metro.Samples/MahApps.Metro.Demo/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,11 @@
<exampleViews:ColorExample DataContext="{Binding}" />
</ScrollViewer>
</TabItem>

<TabItem Header="ColorPicker">
<exampleViews:ColorPickerExample />
</TabItem>

<TabItem Header="others">
<ScrollViewer Margin="2"
HorizontalScrollBarVisibility="Auto"
Expand Down
Loading

0 comments on commit d43eabe

Please sign in to comment.