-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
45 changed files
with
1,941 additions
and
442 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,49 @@ | ||
<UserControl x:Class="WPFExample.CustomControls.FinsembleButton" | ||
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:WPFExample.CustomControls" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="800"> | ||
<UserControl.Resources> | ||
|
||
<Style x:Key="FinsembleButton" TargetType="{x:Type Button}"> | ||
<Setter Property="Background" Value="#22262f"></Setter> | ||
<Setter Property="BorderThickness" Value="0"></Setter> | ||
<Setter Property="Foreground" Value="White"></Setter> | ||
<Setter Property="FontSize" Value="14"></Setter> | ||
<Setter Property="Padding" Value="0"></Setter> | ||
<Setter Property="FontWeight" Value="Bold"></Setter> | ||
|
||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type Button}"> | ||
<Border Background="{TemplateBinding Background}"> | ||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/> | ||
</Border> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
<Style.Triggers> | ||
<Trigger Property="IsMouseOver" Value="True"> | ||
<Setter Property="Background" Value="#171a20"/> | ||
</Trigger> | ||
</Style.Triggers> | ||
</Style> | ||
<Style x:Key="FinsembleButtonBorder" TargetType="{x:Type Border}"> | ||
<Setter Property="Margin" Value="5"></Setter> | ||
<Setter Property="CornerRadius" Value="25"></Setter> | ||
<Setter Property="Padding" Value="10"></Setter> | ||
<Setter Property="Background" Value="#22262f"></Setter> | ||
<Style.Triggers> | ||
<DataTrigger Binding="{Binding IsMouseOver, ElementName=Button }" Value="True"> | ||
<Setter Property="Background" Value="#171a20"/> | ||
</DataTrigger> | ||
</Style.Triggers> | ||
</Style> | ||
</UserControl.Resources> | ||
<Border Name="ButtonBorder" Style="{StaticResource FinsembleButtonBorder}"> | ||
<Button Style="{StaticResource FinsembleButton}" Name="Button" Click="Button_OnClick" Content="{Binding ButtonContent, Mode=TwoWay}"></Button> | ||
</Border> | ||
</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,39 @@ | ||
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 WPFExample.CustomControls | ||
{ | ||
/// <summary> | ||
/// Interaction logic for FinsembleButton.xaml | ||
/// </summary> | ||
public partial class FinsembleButton : UserControl | ||
{ | ||
public event EventHandler<RoutedEventArgs> Click; | ||
|
||
public string ButtonContent { get; set; } | ||
public FinsembleButton() | ||
{ | ||
InitializeComponent(); | ||
this.DataContext = this; | ||
} | ||
|
||
private void Button_OnClick(object sender, RoutedEventArgs e) | ||
{ | ||
var eventHandler = this.Click; | ||
|
||
eventHandler?.Invoke(this, e); | ||
} | ||
} | ||
} |
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,149 @@ | ||
<UserControl x:Class="WPFExample.CustomControls.FinsembleDropDown" | ||
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:WPFExample.CustomControls" | ||
mc:Ignorable="d" | ||
d:DesignHeight="450" d:DesignWidth="800"> | ||
<UserControl.Resources> | ||
<ControlTemplate x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}"> | ||
<Grid> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition /> | ||
<ColumnDefinition Width="20" /> | ||
</Grid.ColumnDefinitions> | ||
<Border | ||
x:Name="Border" | ||
Grid.ColumnSpan="2" | ||
CornerRadius="0" | ||
Background="#22262f" /> | ||
<Path | ||
x:Name="Arrow" | ||
Grid.Column="1" | ||
Fill="White" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Data="M0,0 L0,2 L4,6 L8,2 L8,0 L4,4 z" | ||
/> | ||
</Grid> | ||
</ControlTemplate> | ||
|
||
<ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}"> | ||
<Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" /> | ||
</ControlTemplate> | ||
|
||
<Style x:Key="{x:Type ComboBox}" TargetType="{x:Type ComboBox}"> | ||
<Setter Property="SnapsToDevicePixels" Value="true"/> | ||
<Setter Property="OverridesDefaultStyle" Value="true"/> | ||
<Setter Property="FontSize" Value="14"></Setter> | ||
<Setter Property="FontWeight" Value="Bold"></Setter> | ||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/> | ||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> | ||
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/> | ||
<Setter Property="Foreground" Value="White"/> | ||
<Setter Property="Background" Value="#22262f"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ComboBox}"> | ||
<Grid> | ||
<ToggleButton | ||
Name="ToggleButton" | ||
Template="{StaticResource ComboBoxToggleButton}" | ||
Grid.Column="2" | ||
Focusable="false" | ||
IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}" | ||
ClickMode="Press"> | ||
</ToggleButton> | ||
<ContentPresenter Name="ContentSite" IsHitTestVisible="False" Content="{TemplateBinding SelectionBoxItem}" | ||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" | ||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" | ||
Margin="3,3,23,3" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Left" /> | ||
<Popup | ||
Name="Popup" | ||
Placement="Bottom" | ||
IsOpen="{TemplateBinding IsDropDownOpen}" | ||
AllowsTransparency="True" | ||
Focusable="False" | ||
PopupAnimation="Slide"> | ||
|
||
<Grid Name="DropDown" | ||
SnapsToDevicePixels="True" | ||
MinWidth="{TemplateBinding ActualWidth}" | ||
MaxHeight="{TemplateBinding MaxDropDownHeight}"> | ||
<Border | ||
x:Name="DropDownBorder" | ||
Background="#22262f" | ||
BorderThickness="1" | ||
BorderBrush="#888888"/> | ||
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True"> | ||
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" /> | ||
</ScrollViewer> | ||
</Grid> | ||
</Popup> | ||
</Grid> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="HasItems" Value="false"> | ||
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/> | ||
</Trigger> | ||
<Trigger Property="IsEnabled" Value="false"> | ||
<Setter Property="Foreground" Value="#22262f"/> | ||
</Trigger> | ||
<Trigger Property="IsGrouping" Value="true"> | ||
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/> | ||
</Trigger> | ||
<Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true"> | ||
<Setter TargetName="DropDownBorder" Property="CornerRadius" Value="0"/> | ||
<Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/> | ||
</Trigger> | ||
<Trigger Property="IsEditable" Value="true"> | ||
<Setter Property="IsTabStop" Value="false"/> | ||
<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/> | ||
</Trigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
<!-- SimpleStyles: ComboBoxItem --> | ||
<Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}"> | ||
<Setter Property="SnapsToDevicePixels" Value="true"/> | ||
<Setter Property="Foreground" Value="White"/> | ||
<Setter Property="Background" Value="#22262f"/> | ||
<Setter Property="FontSize" Value="12"></Setter> | ||
<Setter Property="FontWeight" Value="Bold"></Setter> | ||
<Setter Property="OverridesDefaultStyle" Value="true"/> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ComboBoxItem}"> | ||
<Border Name="Border" | ||
Padding="2" | ||
SnapsToDevicePixels="true"> | ||
<ContentPresenter /> | ||
</Border> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="IsHighlighted" Value="true"> | ||
<Setter TargetName="Border" Property="Background" Value="#171a20"/> | ||
</Trigger> | ||
<Trigger Property="IsEnabled" Value="false"> | ||
<Setter Property="Foreground" Value="#22262f"/> | ||
</Trigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
</UserControl.Resources> | ||
|
||
|
||
<Grid> | ||
<Border Margin="5" CornerRadius="20" Padding="10" Background="#22262f"> | ||
<ComboBox Name="ItemsComboBox"> | ||
</ComboBox> | ||
</Border> | ||
|
||
</Grid> | ||
</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 WPFExample.CustomControls | ||
{ | ||
/// <summary> | ||
/// Interaction logic for FinsembleDropDown.xaml | ||
/// </summary> | ||
public partial class FinsembleDropDown : UserControl | ||
{ | ||
public FinsembleDropDown() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
Oops, something went wrong.