MachineUI.ucVLC_new GetVLCObject(string vlcCode) { MachineUI.ucVLC_new returnVLC = null; foreach (MachineUI.ucVLC_new objVLC in FindVisualChildren <MachineUI.ucVLC_new>(this)) { if (objVLC.MachineCode.Equals(vlcCode)) { returnVLC = objVLC; } } return(returnVLC); }
void TranslateVLCPosition(MachineUI.ucVLC_new objVLC, int position) { float aspectRatio = 0; aspectRatio = GetAspectRatio(objVLC.MaxYValue, objVLC.MinYValue, objVLC.MaxValue, objVLC.MinValue); TransformGroup tg = objVLC.RenderTransform as TransformGroup; TranslateTransform rt = tg.Children[3] as TranslateTransform; rt.Y = (position - objVLC.MinValue) * aspectRatio; }
void SetVLCPosition(string vlcCode, int position) { MachineUI.ucVLC_new objVLC = GetVLCObject(vlcCode); TranslateVLCPosition(objVLC, position); }