guorg / gu.wpf.propertygrid Goto Github PK
View Code? Open in Web Editor NEWSmall lib with styles for using ItemsControl as a property grid.
License: MIT License
Small lib with styles for using ItemsControl as a property grid.
License: MIT License
<Style TargetType="{x:Type propertyGrid:UnitRow}">
<Setter Property="Template" Value="{StaticResource UnitRowPropChangeInfoTemplate}" />
</Style>
Not sure Initialized() is the best place to initialize.
For example SelectorSettingControl does not use a style for Combobox in App.xaml
<Style TargetType="{x:Type ComboBox}">
<Setter Property="Foreground" Value="Green" />
</Style>
Enable p:Grid.RowDefinitions="Auto, *, 20"
for readonly dps
and style for HeaderedContentContol
Inherits & attached.
And lists with dirties and errors.
Perhaps a new lib.
Good idea?
Looks like it is not working now, write tests for it.
Example: localized error message when greater than. '1 är större än största tillåtna värde 0.7'
public class ValueControl : Control
{
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
"Value",
typeof(int),
typeof(ValueControl),
new FrameworkPropertyMetadata(
default(int),
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
null,
CoerceValue));
private bool isResetting;
static ValueControl()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ValueControl), new FrameworkPropertyMetadata(typeof(ValueControl)));
EventManager.RegisterClassHandler(typeof(ValueControl), Validation.ErrorEvent, new EventHandler<ValidationErrorEventArgs>(OnError));
}
public int Value
{
get { return (int)this.GetValue(ValueProperty); }
set { this.SetValue(ValueProperty, value); }
}
private static object CoerceValue(DependencyObject d, object basevalue)
{
var control = (ValueControl)d;
if (control.isResetting)
{
return control.GetValue(ValueProperty);
}
return basevalue;
}
private static void OnError(object sender, ValidationErrorEventArgs e)
{
if (e.Action == ValidationErrorEventAction.Added)
{
var control = (ValueControl)sender;
control.isResetting = true;
BindingOperations.GetBindingExpressionBase(control, ValueProperty)?.UpdateTarget();
control.isResetting = false;
}
}
}
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.