operator, leftist, Join on LETF//Allow me to add.
State, type, similar conversion, introduced in xmlns Common xmlns:com= "Clr-namespace:xxx.common",
In <UserControl.Resources> Xkey binding statusconvert (state transition) is the Converter={staticresource St of the column binding that needs to be converted in XAML Atusconvert}
In common, Cconvert class, the public class Statusconvert is defined to implement the IValueConverter interface:
Public ObjectConvert (ObjectValue, Type TargetType,Objectparameter, System.Globalization.CultureInfo culture) { if(Value = =NULL) { returnvalue; } varresult = Clisthelper.statuslist. Where (c = C.selectvalue = =value. ToString ()). FirstOrDefault (); The collection defined in//clistheiper is used here. ext: B if(Result! =NULL) { returnresult. Displayvalue; } returnValue
}
Public Object Convertback (objectobject parameter, System.Globalization.CultureInfo culture) { thrownew notimplementedexception (); }
B:
Public StaticObservablecollection<clistmodel> statuslist {Get { if(_statuslist = =NULL) {_statuslist=NewObservablecollection<clistmodel>(); _statuslist.add (NewClistmodel () {displayvalue ="Normal", Selectvalue ="0" }); _statuslist.add (NewClistmodel () {displayvalue ="void", Selectvalue ="-1" }); } return_statuslist; } }
The WPF DataGrid column shows the 0,-1 (void, delete) status, the type of (expense, income), the operator (in other tables), and how to convert the format.