public static void BindLocalizedString(string key, System.Windows.DependencyObject dependencyObject, object targetProperty) { string arg_05_0 = string.Empty; LocExtension locExtension = new LocExtension(key); locExtension.SetBinding(dependencyObject, targetProperty); }
static public bool BindTo(DependencyObject objectToBind, DependencyProperty propertyToBind, string resourceKey) { if (resourceKey == null) { return(false); } if (resourceKey.Count(c => c.Equals(':')) != 2) { Log.Info("localized resource key: " + resourceKey + " for object:" + objectToBind.ToString() + "; propety:" + propertyToBind.ToString() + " is not parsed, it is used directly." + "(Valid key format is assemblyName:resourceFileName:resourceKeyName)"); objectToBind.SetValue(propertyToBind, resourceKey); return(false); } objectToBind.ClearValue(propertyToBind); var loc = new LocExtension(resourceKey); return(loc.SetBinding(objectToBind, propertyToBind)); }
//https://github.com/SeriousM/WPFLocalizationExtension/blob/master/Tests/XamlLocalizationTest/Window1.xaml.cs#L50 static public bool BindTo(DependencyObject objectToBind, DependencyProperty propertyToBind, string assemblyName, string resourceName, string key) { var loc = new LocExtension(assemblyName + ":" + resourceName + ":" + key); return(loc.SetBinding(objectToBind, propertyToBind)); }
/// <summary> /// Initializes static members of the <see cref="DataAxis" /> class. /// </summary> static DataAxis() { // Single axis data var iAxis = new DataAxis(AxisType.I); var lociAxis = new LocExtension("VianaNET:Labels:AxisFrame"); lociAxis.SetBinding(iAxis, DescriptionProperty); var tAxis = new DataAxis(AxisType.T); var loctAxis = new LocExtension("VianaNET:Labels:AxisTime"); loctAxis.SetBinding(tAxis, DescriptionProperty); var xAxis = new DataAxis(AxisType.X); var locxAxis = new LocExtension("VianaNET:Labels:AxisPixelX"); locxAxis.SetBinding(xAxis, DescriptionProperty); var yAxis = new DataAxis(AxisType.Y); var locyAxis = new LocExtension("VianaNET:Labels:AxisPixelY"); locyAxis.SetBinding(yAxis, DescriptionProperty); var pxAxis = new DataAxis(AxisType.PX); var locpxAxis = new LocExtension("VianaNET:Labels:AxisPositionX"); locpxAxis.SetBinding(pxAxis, DescriptionProperty); var pyAxis = new DataAxis(AxisType.PY); var locpyAxis = new LocExtension("VianaNET:Labels:AxisPositionY"); locpyAxis.SetBinding(pyAxis, DescriptionProperty); var dAxis = new DataAxis(AxisType.D); var locdAxis = new LocExtension("VianaNET:Labels:AxisDistance"); locdAxis.SetBinding(dAxis, DescriptionProperty); var dxAxis = new DataAxis(AxisType.DX); var locdxAxis = new LocExtension("VianaNET:Labels:AxisDistanceX"); locdxAxis.SetBinding(dxAxis, DescriptionProperty); var dyAxis = new DataAxis(AxisType.DY); var locdyAxis = new LocExtension("VianaNET:Labels:AxisDistanceY"); locdyAxis.SetBinding(dyAxis, DescriptionProperty); var sAxis = new DataAxis(AxisType.S); var locsAxis = new LocExtension("VianaNET:Labels:AxisLength"); locsAxis.SetBinding(sAxis, DescriptionProperty); var sxAxis = new DataAxis(AxisType.SX); var locsxAxis = new LocExtension("VianaNET:Labels:AxisLengthX"); locsxAxis.SetBinding(sxAxis, DescriptionProperty); var syAxis = new DataAxis(AxisType.SY); var locsyAxis = new LocExtension("VianaNET:Labels:AxisLengthY"); locsyAxis.SetBinding(syAxis, DescriptionProperty); var vAxis = new DataAxis(AxisType.V); var locvAxis = new LocExtension("VianaNET:Labels:AxisVelocity"); locvAxis.SetBinding(vAxis, DescriptionProperty); var vxAxis = new DataAxis(AxisType.VX); var locvxAxis = new LocExtension("VianaNET:Labels:AxisVelocityXDirection"); locvxAxis.SetBinding(vxAxis, DescriptionProperty); var vyAxis = new DataAxis(AxisType.VY); var locvyAxis = new LocExtension("VianaNET:Labels:AxisVelocityYDirection"); locvyAxis.SetBinding(vyAxis, DescriptionProperty); var aAxis = new DataAxis(AxisType.A); var locaAxis = new LocExtension("VianaNET:Labels:AxisAcceleration"); locaAxis.SetBinding(aAxis, DescriptionProperty); var axAxis = new DataAxis(AxisType.AX); var locaxAxis = new LocExtension("VianaNET:Labels:AxisAccelerationXDirection"); locaxAxis.SetBinding(axAxis, DescriptionProperty); var ayAxis = new DataAxis(AxisType.AY); var locayAxis = new LocExtension("VianaNET:Labels:AxisAccelerationYDirection"); locayAxis.SetBinding(ayAxis, DescriptionProperty); DataAxes = new List <DataAxis> { iAxis, tAxis, xAxis, yAxis, pxAxis, pyAxis, dAxis, dxAxis, dyAxis, sAxis, sxAxis, syAxis, vAxis, vxAxis, vyAxis, aAxis, axAxis, ayAxis, }; }
/// <summary> /// Initializes static members of the <see cref="DataAxis" /> class. /// </summary> static DataCharts() { // Double axis data position space var YoverX = new DataCharts(ChartType.YoverX); var locYoverX = new LocExtension("VianaNET:Labels:AxisYoverX"); locYoverX.SetBinding(YoverX, DescriptionProperty); var XoverT = new DataCharts(ChartType.XoverT); var locXoverT = new LocExtension("VianaNET:Labels:AxisXoverT"); locXoverT.SetBinding(XoverT, DescriptionProperty); var YoverT = new DataCharts(ChartType.YoverT); var locYoverT = new LocExtension("VianaNET:Labels:AxisYoverT"); locYoverT.SetBinding(YoverT, DescriptionProperty); var SoverT = new DataCharts(ChartType.SoverT); var locSoverT = new LocExtension("VianaNET:Labels:AxisSoverT"); locSoverT.SetBinding(SoverT, DescriptionProperty); var VoverT = new DataCharts(ChartType.VoverT); var locVoverT = new LocExtension("VianaNET:Labels:AxisVoverT"); locVoverT.SetBinding(VoverT, DescriptionProperty); var VXoverT = new DataCharts(ChartType.VXoverT); var locVXoverT = new LocExtension("VianaNET:Labels:AxisVXoverT"); locVXoverT.SetBinding(VXoverT, DescriptionProperty); var VYoverT = new DataCharts(ChartType.VYoverT); var locVYoverT = new LocExtension("VianaNET:Labels:AxisVYoverT"); locVYoverT.SetBinding(VYoverT, DescriptionProperty); var AoverT = new DataCharts(ChartType.AoverT); var locAoverT = new LocExtension("VianaNET:Labels:AxisAoverT"); locAoverT.SetBinding(AoverT, DescriptionProperty); var AXoverT = new DataCharts(ChartType.AXoverT); var locAXoverT = new LocExtension("VianaNET:Labels:AxisAXoverT"); locAXoverT.SetBinding(AXoverT, DescriptionProperty); var AYoverT = new DataCharts(ChartType.AYoverT); var locAYoverT = new LocExtension("VianaNET:Labels:AxisAYoverT"); locAYoverT.SetBinding(AYoverT, DescriptionProperty); PredefinedDataChartsPositionSpace = new List <DataCharts>(); PredefinedDataChartsPositionSpace.Add(YoverX); PredefinedDataChartsPositionSpace.Add(XoverT); PredefinedDataChartsPositionSpace.Add(YoverT); PredefinedDataChartsPositionSpace.Add(VoverT); PredefinedDataChartsPositionSpace.Add(VXoverT); PredefinedDataChartsPositionSpace.Add(VYoverT); PredefinedDataChartsPositionSpace.Add(AoverT); PredefinedDataChartsPositionSpace.Add(AXoverT); PredefinedDataChartsPositionSpace.Add(AYoverT); // Double axis data phase space var VoverD = new DataCharts(ChartType.VoverD); var locDoverV = new LocExtension("VianaNET:Labels:AxisDoverV"); locDoverV.SetBinding(VoverD, DescriptionProperty); var VXoverDX = new DataCharts(ChartType.VXoverDX); var locDXoverVX = new LocExtension("VianaNET:Labels:AxisDXoverVX"); locDXoverVX.SetBinding(VXoverDX, DescriptionProperty); var VYoverDY = new DataCharts(ChartType.VYoverDY); var locDYoverVY = new LocExtension("VianaNET:Labels:AxisDYoverVY"); locDYoverVY.SetBinding(VYoverDY, DescriptionProperty); var VoverS = new DataCharts(ChartType.VoverS); var locSoverV = new LocExtension("VianaNET:Labels:AxisSoverV"); locSoverV.SetBinding(VoverS, DescriptionProperty); var VXoverSX = new DataCharts(ChartType.VXoverSX); var locSXoverVX = new LocExtension("VianaNET:Labels:AxisSXoverVX"); locSXoverVX.SetBinding(VXoverSX, DescriptionProperty); var VYoverSY = new DataCharts(ChartType.VYoverSY); var locSYoverVY = new LocExtension("VianaNET:Labels:AxisSYoverVY"); locSYoverVY.SetBinding(VYoverSY, DescriptionProperty); var AoverV = new DataCharts(ChartType.AoverV); var locVoverA = new LocExtension("VianaNET:Labels:AxisVoverA"); locVoverA.SetBinding(AoverV, DescriptionProperty); var AXoverVX = new DataCharts(ChartType.AXoverVX); var locVXoverAX = new LocExtension("VianaNET:Labels:AxisVXoverAX"); locVXoverAX.SetBinding(AXoverVX, DescriptionProperty); var AYoverVY = new DataCharts(ChartType.AYoverVY); var locVYoverAY = new LocExtension("VianaNET:Labels:AxisVYoverAY"); locVYoverAY.SetBinding(AYoverVY, DescriptionProperty); PredefinedDataChartsPhaseSpace = new List <DataCharts>(); PredefinedDataChartsPhaseSpace.Add(VoverD); PredefinedDataChartsPhaseSpace.Add(VXoverDX); PredefinedDataChartsPhaseSpace.Add(VYoverDY); PredefinedDataChartsPhaseSpace.Add(VoverS); PredefinedDataChartsPhaseSpace.Add(VXoverSX); PredefinedDataChartsPhaseSpace.Add(VYoverSY); PredefinedDataChartsPhaseSpace.Add(AoverV); PredefinedDataChartsPhaseSpace.Add(AXoverVX); PredefinedDataChartsPhaseSpace.Add(AYoverVY); }
/// <summary> /// Creates a new enum localizer. /// </summary> public LocProxy() { ext = new LocExtension(); ext.SetBinding(this, GetType().GetProperty("Result")); }
/// <summary> /// Creates a new enum localizer. /// </summary> public LocProxy() { ext = new LocExtension(); ext.SetBinding(this, GetType().GetProperty("Result")); }