These are chat archives for JohanLarsson/Gu.Wpf.PropertyGrid

27th
Sep 2016
Arasn
@Arasn
Sep 27 2016 12:15
We have DecimalDigits in row-unit, do we have also an attribute for integer part?
which Row-class can be casted to set Headr of any other row-type: i.e
' ((Gu.Wpf.PropertyGrid.Row)obj).Header '
where obj is any Unit-Row class instance.
Johan Larsson
@JohanLarsson
Sep 27 2016 12:19
I don't understand
Arasn
@Arasn
Sep 27 2016 12:20
I have PowerRow/ForceRow/BoolRow/MomentumRow ...etc and Need to set their properties. obj is an instance of object.
Johan Larsson
@JohanLarsson
Sep 27 2016 12:24
you should try to bind things in wpf
Arasn
@Arasn
Sep 27 2016 12:24

´"
object obj = null;
if (unitWorking == typeof(AngleUnit))
{
var rowObject = new AngleRow();
rowObject.Value = (Angle)GetPropertyValue((int)propertyInfo.GetValue(objStructure), rowType);

obj = rowObject;

}
else if (unitWorking == typeof(ForceUnit))
{
var rowObject = new ForceRow();
rowObject.Value = (Force)GetPropertyValue((int)propertyInfo.GetValue(objStructure), rowType);

obj = rowObject;

}
else if (unitWorking == typeof(Momentum))
{
var rowObject = new MomentumRow();
rowObject.Value = (Momentum)GetPropertyValue((int)propertyInfo.GetValue(objStructure), rowType);

obj = rowObject;

}
else if (unitWorking == typeof(PowerUnit))
{
var rowObject = new PowerRow();
rowObject.Value = (Power)GetPropertyValue((int)propertyInfo.GetValue(objStructure), rowType);
}

after this Need to work with obj to set other Attribute.
this is in C# not XMAL

Arasn
@Arasn
Sep 27 2016 13:23
-> We have DecimalDigits in row-unit, do we have also an attribute for integer part?
Ex: 34,2133 - (integer 2, decimal 4)
3,5522 (integer 1, decimal 4)
Johan Larsson
@JohanLarsson
Sep 27 2016 13:24
you can use stringformat I think
Arasn
@Arasn
Sep 27 2016 14:39

again about this Point:
"for unit rows it will probably be a DoubleBox
You should be able to get it via the attached property Scope.HasError()"

is this for each unit instance ?

Johan Larsson
@JohanLarsson
Sep 27 2016 14:49
I don't understand
The default template creates a validation scope to get notified on validation errors in child controls.
Arasn
@Arasn
Sep 27 2016 14:49
how to get the Error Text that appear when a wrong data inputs
Johan Larsson
@JohanLarsson
Sep 27 2016 14:50
given that there is a scope yo should be able to get if there are errors using var hasError = Scope.GetHasErrors(row)
var errors = Scope.GetErrors(row) and check the error content.
Is this for localization?
Arasn
@Arasn
Sep 27 2016 14:52
not only, also to check the error type.
hasError is bool and has ture value.
Johan Larsson
@JohanLarsson
Sep 27 2016 14:53
HasErrors is bool, Errors should be ReadOnlyObservableCollection<ValidationError>
Arasn
@Arasn
Sep 27 2016 14:54
yes.
Thanks.
Johan Larsson
@JohanLarsson
Sep 27 2016 14:54
It is hard to use unfamiliar frameworks, I feel a bit sorry for you
Also my code is not nice in all places, err on the advanced side too often.
Arasn
@Arasn
Sep 27 2016 14:57
I am very thanksfull for your permanet Support. It is a hug of works in this Project I appreciate. to me, of course a challange to get this working with dynamic C# structures.
Johan Larsson
@JohanLarsson
Sep 27 2016 14:57
What I often do is create toy apps.
For example with dynamic, create a really small toy app where you wire up a dynamic to the grid and see if it works.
Have found it to save a lot of time