marcuswichelmann / wpfplus Goto Github PK
View Code? Open in Web Editor NEWModern flat themes and useful controls for your next WPF Application
License: MIT License
Modern flat themes and useful controls for your next WPF Application
License: MIT License
The Slider control doesn't look that bad actually but it could be further improved.
ComboBox Drop Down only works when the down arrow is clicked.
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style x:Key="ComboBoxStyle" TargetType="{x:Type ComboBox}"> <Setter Property="OverridesDefaultStyle" Value="True" /> <Setter Property="Background" Value="{DynamicResource TextBoxBackgroundBrush}" /> <Setter Property="Foreground" Value="{DynamicResource TextBoxForegroundBrush}" /> <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> <Setter Property="ScrollViewer.CanContentScroll" Value="True" /> <Setter Property="TextElement.Foreground" Value="{DynamicResource TextBoxForegroundBrush}" /> <Setter Property="FocusVisualStyle" Value="{x:Null}" /> <Setter Property="Validation.ErrorTemplate" Value="{DynamicResource ValidationErrorOverlayTemplate}" /> <Setter Property="Padding" Value="3,0" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ComboBox}"> <Grid> <TextBox x:Name="PART_EditableTextBox" IsReadOnly="{TemplateBinding IsReadOnly}" Focusable="True" Style="{DynamicResource TextBoxStyle}" Visibility="Hidden" /> <Border x:Name="NonEditableBorder" Background="{DynamicResource ComboBoxNonEditableBackgroundBrush}" BorderThickness="1" BorderBrush="{DynamicResource ComboBoxNonEditableBorderBrush}"> <ContentPresenter IsHitTestVisible="False" HorizontalAlignment="Left" VerticalAlignment="Center" Content="{TemplateBinding ComboBox.SelectionBoxItem}" ContentTemplate="{TemplateBinding ComboBox.SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" Margin="{TemplateBinding Padding}" /> </Border> <ToggleButton x:Name="ToggleButton" ClickMode="Press" HorizontalAlignment="Right" Background="{DynamicResource ComboBoxButtonBackgroundBrush}" BorderBrush="{DynamicResource ComboBoxButtonBorderBrush}" BorderThickness="0" Foreground="{DynamicResource ComboBoxButtonForegroundBrush}" IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsDropDownOpen, Mode=TwoWay}"> <ToggleButton.Template> <ControlTemplate TargetType="{x:Type ToggleButton}"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="20" /> </Grid.ColumnDefinitions> <Border Grid.Column="1" x:Name="ButtonBorder" Margin="0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" /> <Path x:Name="Arrow" Grid.Column="1" Data="M0,0 L0,2 L4,6 L8,2 L8,0 L4,4 z" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Center" VerticalAlignment="Center" /> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="ButtonBorder" Property="Background" Value="{DynamicResource ComboBoxButtonHoverBackgroundBrush}" /> </Trigger> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="ButtonBorder" Property="Background" Value="{DynamicResource ComboBoxButtonPressBackgroundBrush}" /> </Trigger> <Trigger Property="IsChecked" Value="True"> <Setter TargetName="ButtonBorder" Property="Background" Value="{DynamicResource ComboBoxButtonCheckedBackgroundBrush}" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="ButtonBorder" Property="Background" Value="{DynamicResource ComboBoxButtonDisabledBackgroundBrush}" /> <Setter TargetName="ButtonBorder" Property="BorderBrush" Value="{DynamicResource ComboBoxButtonDisabledBorderBrush}" /> <Setter TargetName="Arrow" Property="Fill" Value="{DynamicResource ComboBoxButtonDisabledForegroundBrush}" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </ToggleButton.Template> </ToggleButton> <Popup Placement="Bottom" Focusable="False" AllowsTransparency="True" IsOpen="{TemplateBinding ComboBox.IsDropDownOpen}" PopupAnimation="Slide"> <Grid MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}"> <Border BorderThickness="1" Background="{DynamicResource ComboBoxListBackgroundBrush}" BorderBrush="{DynamicResource ComboBoxListBorderBrush}" Margin="0,1,0,0"> <ScrollViewer SnapsToDevicePixels="True"> <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" /> </ScrollViewer> </Border> </Grid> </Popup> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="NonEditableBorder" Property="Background" Value="{DynamicResource ComboBoxNonEditableHoverBackgroundBrush}" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="NonEditableBorder" Property="Background" Value="{DynamicResource ComboBoxNonEditableDisabledBackgroundBrush}" /> <Setter TargetName="NonEditableBorder" Property="BorderBrush" Value="{DynamicResource ComboBoxNonEditableDisabledBorderBrush}" /> </Trigger> <Trigger Property="IsEditable" Value="True"> <Setter Property="IsTabStop" Value="False" /> <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" /> <Setter TargetName="NonEditableBorder" Property="Visibility" Value="Hidden" /> <Setter TargetName="ToggleButton" Property="BorderThickness" Value="1,0,0,0" /> <Setter TargetName="ToggleButton" Property="Focusable" Value="False" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary>
In WPF it's possible to customize the titlebar of a Window. I can add a custom Window type for that with additional content areas for e.g. a branding or a menu bar that are displayed on the themeable titlebar.
Add a control to make choosing numbers easier. WPF still misses a NumericUpDown control like it exists in Windows Forms.
In Helpers.xaml the TextBlock binding to Adorner element is misspelled Adoner so you always get the fallback error message "Invalid Input"
Many thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.